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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user