feat(02-02): record manifest route cases and report coverage

Drive ordered route cases through RecordFlow, resume in batches of
15, and print recorded/passing/failing/unrecorded coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-09-17 12:36:48 +02:00
parent aa165fe3d0
commit 24c1f43e84
7 changed files with 1147 additions and 18 deletions

View File

@@ -116,6 +116,22 @@ func TestParityCommands(t *testing.T) {
if err == nil || !strings.Contains(err.Error(), "loopback") {
t.Fatalf("proxy non-loopback listen: %v", err)
}
manDir := t.TempDir()
fx := filepath.Join(manDir, "fx")
man := filepath.Join(manDir, "manifest.yaml")
if err := os.WriteFile(man, []byte("version: 1\nauth_groups:\n - public\nroutes:\n - id: GET /cli public\n method: GET\n path: /sample\n auth_group: public\n status: ported\n cases:\n - id: ok\n status: 200\n fixture: routes/cli.yaml\n request:\n method: GET\n path: /sample\n"), 0o644); err != nil {
t.Fatal(err)
}
if err := runParity("parity:record", "--manifest", man, "--target", origJSON.URL, "--fixtures", fx, "--resume", "true", "--next-batch", "15"); err != nil {
t.Fatalf("manifest record: %v", err)
}
if err := runParity("parity:record", "--manifest", man, "--target", origJSON.URL, "--fixtures", fx, "--next-batch", "16"); err == nil {
t.Fatal("batch 16 must fail")
}
if err := runParity("parity:replay", "--manifest", man, "--fixtures", fx, "--target", origJSON.URL); err != nil {
t.Fatalf("manifest replay: %v", err)
}
}
func commandNames() []string {