From 320d27c99d90314944079efd4de080f9e63e1729 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Tue, 21 Jul 2026 11:59:47 +0200 Subject: [PATCH 1/2] chore: clear cache for default test When retried, it will use the cache created in the first instance and it will fail log parsing checks. Clearing the cache will ensure no layer reuse. --- integration/installers/miniconda_default_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration/installers/miniconda_default_test.go b/integration/installers/miniconda_default_test.go index 6e0a1da..eff6579 100644 --- a/integration/installers/miniconda_default_test.go +++ b/integration/installers/miniconda_default_test.go @@ -73,7 +73,8 @@ func minicondaTestDefault(t *testing.T, context spec.G, it spec.S) { WithBuildpacks( settings.Buildpacks.PythonInstallers.Online, settings.Buildpacks.BuildPlan.Online, - ), + ). + WithClearCache(), name, source, ) From 37014da8eed321e2b6f2db1cff1912b9fa3f4b43 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 22 Jul 2026 21:13:35 +0200 Subject: [PATCH 2/2] refactor: keep all logs when a retry happens The RetryBuild struct is used with conda tests which are prone to errors unrelated to the buildpack itself. Restarting the build usually fixes that but will take advantage of the cache having been created during the first build and thus loses the information searched. Thus Keeping all the logs will allow the tests that verify that conda has been installed once. It is not possible for all the tests to just clear the cache as some of them are verifying that the existing cache is indeed not used. --- integration/helpers.go | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/integration/helpers.go b/integration/helpers.go index ef013df..fc1e891 100644 --- a/integration/helpers.go +++ b/integration/helpers.go @@ -8,6 +8,7 @@ package integration_helpers import ( "errors" "fmt" + "strings" "testing" "github.com/paketo-buildpacks/occam" @@ -76,9 +77,24 @@ type RetryBuild struct { retry int } +type LogList []fmt.Stringer + +func (l LogList) String() string { + var builder strings.Builder + + for index, value := range l { + if index > 0 { + builder.WriteString("\n") + } + builder.WriteString(value.String()) + } + + return builder.String() +} + func (r *RetryBuild) Execute(packBuild occam.PackBuild, name string, source string) (occam.Image, fmt.Stringer, error) { var image occam.Image - var logs fmt.Stringer + var allLogs LogList var errs error for i := range r.retry + 1 { @@ -86,14 +102,16 @@ func (r *RetryBuild) Execute(packBuild occam.PackBuild, name string, source stri r.t.Logf("Retry %v\n", i) } var err error + var logs fmt.Stringer image, logs, err = packBuild.Execute(name, source) + allLogs = append(allLogs, logs) if err == nil { - return image, logs, err + return image, allLogs, err } else { errs = errors.Join(errs, err) r.t.Logf("Build failed: %v\n", err) } } - return image, logs, errs + return image, allLogs, errs }