Skip to content

Commit

Permalink
Drop log output when cache is created
Browse files Browse the repository at this point in the history
  • Loading branch information
runesoerensen committed Nov 10, 2024
1 parent 6e130f1 commit 01efd1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buildpacks/dotnet/src/layers/nuget_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub(crate) fn handle(
LayerState::Empty { cause } => {
nuget_cache_layer.write_metadata(NugetCacheLayerMetadata { restore_count: 1.0 })?;
match cause {
EmptyLayerCause::NewlyCreated => Some("Created NuGet package cache".to_string()),
EmptyLayerCause::NewlyCreated => None,
EmptyLayerCause::InvalidMetadataAction { .. } => {
Some("Purged NuGet package cache due to invalid metadata".to_string())
}
Expand Down
3 changes: 1 addition & 2 deletions buildpacks/dotnet/tests/nuget_layer_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ fn test_nuget_restore_and_cache() {
.env("MSBUILD_VERBOSITY_LEVEL", "normal"),
|context| {
assert_empty!(context.pack_stderr);
assert_contains!(&context.pack_stdout, "Created NuGet package cache");
assert_not_contains!(&context.pack_stdout, "NuGet cache");
assert_contains!(&context.pack_stdout, "Installed Newtonsoft.Json 13.0.3 from https://api.nuget.org/v3/index.json to /layers/heroku_dotnet/nuget-cache/newtonsoft.json/13.0.3 with content hash HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==.");
assert_contains!(&context.pack_stdout, "Restored /workspace/consoleapp.csproj");

// Verify NuGet package layer caching behavior
let config = context.config.clone();
context.rebuild(config, |rebuild_context| {
assert_not_contains!(&rebuild_context.pack_stdout, "Created NuGet package cache");
assert_not_contains!(&rebuild_context.pack_stdout, "Installed Newtonsoft.Json 13.0.3");
assert_contains!(&rebuild_context.pack_stdout, "Reusing NuGet package cache");
assert_contains!(&rebuild_context.pack_stdout, "Restored /workspace/consoleapp.csproj");
Expand Down

0 comments on commit 01efd1e

Please sign in to comment.