Prove that a second check of the same heads keeps every package the first passed, the digest being taken inside the check ask as the build module answers it (issue 1917)
mesh/delivery superseded: a newer head of the same pull request
mesh/check failed: unit: github.com/novox/mesh-host/internal/apply.TestJudgeDirectoriesSaysWhatTheWalkWouldRefuseAndChangesNothing: judge_directories_…
mesh/delivery superseded: a newer head of the same pull request
mesh/check failed: unit: github.com/novox/mesh-host/internal/apply.TestJudgeDirectoriesSaysWhatTheWalkWouldRefuseAndChangesNothing: judge_directories_…
This commit is contained in:
@@ -824,3 +824,22 @@ func TestACheckAskWaitingInItsStreamIsNotBounded(t *testing.T) {
|
||||
t.Fatalf("verdict %+v after %d asks, want a pass from the one ask", out.Verdict, len(b.asks.Asks()))
|
||||
}
|
||||
}
|
||||
|
||||
// 1917: the digest is taken inside the check ask, as the build module's own digest step answers it (no step key is asked
|
||||
// of it), so a second check of the same heads keeps every package the first one passed: "N kept", nothing run again.
|
||||
func TestASecondCheckOfTheSameHeadsKeepsWhatTheFirstPassed(t *testing.T) {
|
||||
b := newBench(t)
|
||||
first := b.judge(t, caseOf(t, pullOf(repoA, 7, head1))).Verdict
|
||||
u := first.Levels[delivery.LevelUnit]
|
||||
if first.State != delivery.VerdictPass || u.Run == 0 || u.Kept != 0 {
|
||||
t.Fatalf("the first check = %+v", first)
|
||||
}
|
||||
b.steps.calls = nil
|
||||
second := b.judge(t, caseOf(t, pullOf(repoA, 7, head1))).Verdict
|
||||
if s := second.Levels[delivery.LevelUnit]; second.State != delivery.VerdictPass || s.Kept != u.Run || s.Run != 0 {
|
||||
t.Fatalf("the second check's unit level = %+v, want %d kept and none run", s, u.Run)
|
||||
}
|
||||
if n := len(b.steps.tool("test")); n != 0 {
|
||||
t.Errorf("%d test steps ran on the second check", n)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user