aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/pkg_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-03 22:47:18 +0900
committerOphestra <cat@gensokyo.uk>2026-03-04 17:27:54 +0900
commit94e3debc632b6f3f309218395339ca0e9ba754b7 (patch)
treef975d1274d186c19fb3b5f4047a6e1d894720fbb /internal/pkg/pkg_test.go
parentea87664a759991a14c6891d53a488e3b7af26ee8 (diff)
internal/pkg: write per-artifact logs
This is currently only used by execArtifact. A later patch will add additional logging facilities. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/pkg_test.go')
-rw-r--r--internal/pkg/pkg_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/pkg/pkg_test.go b/internal/pkg/pkg_test.go
index 700aa962..f8a72564 100644
--- a/internal/pkg/pkg_test.go
+++ b/internal/pkg/pkg_test.go
@@ -314,6 +314,11 @@ func checkWithCache(t *testing.T, testCases []cacheTestCase) {
t.Fatal(err)
}
+ // destroy non-deterministic status files
+ if err := os.RemoveAll(base.Append("status").String()); err != nil {
+ t.Fatal(err)
+ }
+
var checksum pkg.Checksum
if err := pkg.HashDir(&checksum, base); err != nil {
t.Fatalf("HashDir: error = %v", err)
@@ -382,6 +387,9 @@ func cureMany(t *testing.T, c *pkg.Cache, steps []cureStep) {
} else if step.pathname != ignorePathname && !pathname.Is(step.pathname) {
t.Fatalf("Cure: pathname = %q, want %q", pathname, step.pathname)
} else if checksum != makeChecksumH(step.checksum) {
+ if checksum == (unique.Handle[pkg.Checksum]{}) {
+ checksum = unique.Make(pkg.Checksum{})
+ }
t.Fatalf(
"Cure: checksum = %s, want %s",
pkg.Encode(checksum.Value()), pkg.Encode(step.checksum),