Skip to content

Commit 54e9e06

Browse files
committed
fix(testing): align plan example and show run progress
1 parent 68d9d3a commit 54e9e06

2 files changed

Lines changed: 36 additions & 15 deletions

File tree

docs/testing/test-case-authoring-spec.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,33 @@ The index is authoritative for discovery and order. A minimal example is:
7070
"schema_version": "1.0",
7171
"id": "dstack-v0-6-0-release",
7272
"title": "dstack v0.6.0 Release Test Plan",
73-
"guide": "README.md",
73+
"guide": {"path": "README.md", "anchor": "release-test-guide"},
7474
"chapters": [
7575
{
7676
"id": "chapter-gateway",
7777
"title": "Gateway",
7878
"order": 1,
79+
"path": "01-gateway",
7980
"sections": [
8081
{
8182
"id": "section-gateway-proxy-protocol",
8283
"title": "Proxy Protocol",
8384
"order": 1,
85+
"path": "01-gateway/01-proxy-protocol",
8486
"cases": [
8587
{
8688
"id": "tc-gw-pp-001",
8789
"title": "Forward a Proxy v1 client address over TLS termination",
8890
"order": 1,
89-
"path": "01-gateway/01-proxy-protocol/tc-gw-pp-001"
91+
"priority": "P0",
92+
"path": "01-gateway/01-proxy-protocol/tc-gw-pp-001",
93+
"spec": {
94+
"path": "01-gateway/01-proxy-protocol/tc-gw-pp-001/case.md",
95+
"anchor": "tc-gw-pp-001"
96+
},
97+
"requirements": ["req-gw-pp-001"],
98+
"risks": ["risk-gw-spoofing-001"],
99+
"tags": ["gateway", "proxy-protocol"]
90100
}
91101
]
92102
}

tools/dstack-test/dstack-test

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -591,23 +591,34 @@ def main(argv: list[str] | None = None) -> int:
591591
)
592592
elif args.subcommand == "run-plan":
593593
values = []
594-
for case in plan.cases:
594+
total = len(plan.cases)
595+
for index, case in enumerate(plan.cases, 1):
596+
print(f"[{index}/{total}] starting {case.id}", file=sys.stderr, flush=True)
595597
try:
596-
values.append(
597-
run_case(
598-
plan,
599-
case,
600-
args.run_id,
601-
args.agent,
602-
args.model,
603-
args.workdir.resolve(),
604-
prompt_text(args),
605-
args.agent_arg,
606-
args.overwrite,
607-
)
598+
case_value = run_case(
599+
plan,
600+
case,
601+
args.run_id,
602+
args.agent,
603+
args.model,
604+
args.workdir.resolve(),
605+
prompt_text(args),
606+
args.agent_arg,
607+
args.overwrite,
608+
)
609+
values.append(case_value)
610+
print(
611+
f"[{index}/{total}] finished {case.id}: {case_value['status']}",
612+
file=sys.stderr,
613+
flush=True,
608614
)
609615
except DstackTestError as error:
610616
values.append({"case": case.id, "runner_error": str(error)})
617+
print(
618+
f"[{index}/{total}] runner error for {case.id}: {error}",
619+
file=sys.stderr,
620+
flush=True,
621+
)
611622
run = finalize_run(plan, args.run_id, context_value(args.context))
612623
value = {"cases": values, "run": run}
613624
elif args.subcommand == "finalize":

0 commit comments

Comments
 (0)