Name the build errors in one place, and which are not built again until the source changes (issue 1587, S14, ADR 0498 §2 §4 §5)
not stored, not pinned, version taken and refused kind (moved here from the builder); FailedUntilChanged keeps an unpinned upstream or a taken version from rebuilding in a loop, while a failed push is built again.
This commit is contained in:
@@ -74,3 +74,25 @@ func TestReferencedNamesTheArtifactsWithoutAReference(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// The errors a build module answers open with a fixed prefix (ADR 0498 clauses 2, 4 and 5; ADR 0478 clause 2), and three
|
||||
// of them are not built again until the module's fingerprint changes; a failed push is.
|
||||
func TestOnlyAPushFailureIsBuiltAgainBeforeTheFingerprintChanges(t *testing.T) {
|
||||
for _, c := range []struct {
|
||||
err string
|
||||
again bool
|
||||
}{
|
||||
{NotStored + "code: the store said 500", true},
|
||||
{NotPinned + "nats: upstream names no digest", false},
|
||||
{VersionTaken + "@novox/mesh-sdk@0.1.15 holds another file", false},
|
||||
{RefusedKind + "a package in go", false},
|
||||
{"go test: 2 failed", true},
|
||||
} {
|
||||
if got := FailedUntilChanged(c.err); got == c.again {
|
||||
t.Errorf("FailedUntilChanged(%q) = %v", c.err, got)
|
||||
}
|
||||
}
|
||||
if NotStored != "not stored: " || NotPinned != "not pinned: " || VersionTaken != "version taken: " || RefusedKind != "refused kind: " {
|
||||
t.Fatal("a prefix changed its words")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user