Files
mesh-lab/replays/register_test.go
T
jochen 4db1616bbd Replay the crash loop: a container that exits at start fails its gate on the first machine (hq ADR 0240)
The agent server crash-looped about a hundred times behind every passing check.
R-crashloop raises a container whose program exits at start, has the node-engine
at its commit judge it through the runtime, and the controller at its commit
judge the gate from what the engine said — two repositories, each at its own
commit before the fix and on it.
2026-10-07 02:01:52 +02:00

43 lines
1.4 KiB
Go

package replays
import (
"regexp"
"testing"
)
// Every replay says what happened, what it asserts, where its fix is, and how it is run.
func TestEveryReplayIsWhole(t *testing.T) {
seen := map[string]bool{}
for _, r := range Register {
if seen[r.ID] {
t.Errorf("%s is registered twice", r.ID)
}
seen[r.ID] = true
if r.Issue == 0 || r.What == "" || r.Asserts == "" || r.Repository == "" || r.Fix == "" || r.Test == "" {
t.Errorf("%s does not say its incident, its outcome, its fix and its test: %+v", r.ID, r)
}
// By its issue, or — for a replay that is not one core incident's — by a name of its own.
if !regexp.MustCompile(`^R(\d+|-[a-z][a-z0-9-]*)$`).MatchString(r.ID) {
t.Errorf("%q is not a replay's id", r.ID)
}
switch r.Kind {
case InRepository, Gate:
if len(r.Files) == 0 || r.Package == "" {
t.Errorf("%s runs in its repository and lays no files over the commit", r.ID)
}
case Liveness:
if len(r.Files) == 0 || len(r.With) == 0 {
t.Errorf("%s runs two repositories and lays the controller's half over its commit: %+v", r.ID, r)
}
case Bus, Resolver:
default:
t.Errorf("%s is of no kind the prover runs: %q", r.ID, r.Kind)
}
}
for _, issue := range []string{"236", "262", "263", "266"} {
if _, ok := Find(issue); !ok {
t.Errorf("to-be 45 Phase 5 is done when the replay of %s fails before its fix and passes after; it has none", issue)
}
}
}