Repository navigation
Description
Verified against (commit SHA or released version)
988c035 (v0.14.0), confirmed current main on 2026-10-16. Verified using a clean build on macOS; all probes were offline dry-runs, with no credentials or billed executions.
Discord Username / User ID
ronin.9331
What does this improvement do?
Add CI report output to testsprite test wait <run-id...>, so a job can reattach to existing runs and produce JUnit, summary JSON and GitHub annotations without dispatching tests again.
The CLI already tells users to resume interrupted/timed-out polling with test wait. That command supports one or several run IDs and preserves verdict-based exit codes, but it does not expose --report junit --report-file, --summary-file, or --gh-output. These reporting surfaces exist on run/batch-wait paths.
Concrete workflow: a CI job launches tests, saves the acknowledged run IDs, and loses its polling process. A recovery job can wait on those same runs today, but cannot use the CLI's standard report writers to populate its CI test results. Users must build their own conversion or start another run if they want the normal built-in reporting workflow. This proposal closes that reporting gap; it does not require a new runner, API endpoint or persistent journal.
Details / implementation notes
Reproduction on current main
# Controls: existing single-run and multi-run reattachment are supported.
testsprite --dry-run --output json test wait run_one
testsprite --dry-run --output json test wait run_one run_two
# Missing capability: each exits 5 with VALIDATION_ERROR / unknown option.
testsprite --dry-run --output json test wait run_one --summary-file summary.json
testsprite --dry-run --output json test wait run_one run_two --report junit --report-file results.xml
testsprite --dry-run --output json test wait run_one --gh-output
# Positive reporting control: exits 0 and creates a canned JUnit report.
testsprite --dry-run --output json test run --all --project p1 --wait --report junit --report-file results.xmlAll six cases were checked against a clean upstream build. The first two exit 0 with parseable JSON; the three unsupported-flag cases exit 5; the last exits 0 and creates XML. This verifies an absent feature, not a claim that existing documented wait behavior is defective. No real failed-run recovery was executed.
Proposed bounded scope
- Support the existing reporting flags on
test wait, for one or multiple explicit run IDs. - Reuse the shared JUnit and CI presenters, adapting the wait result shape rather than passing its
{results, summary}envelope to a reducer that expectsaccepted[](which would silently yield an empty report). - Retain available test/run IDs, titles, terminal status, failure detail, timestamps and dashboard links from polling for report generation. Distinguish repeated executions of the same test by run ID. Do not change existing stdout schemas merely to carry internal reporting metadata.
- Generate reports from observed results before the existing failure exit is raised. Show timed-out and poll-error members explicitly rather than making partial recovery look fully green. Preserve wait's documented exit-code precedence and keep stdout parseable in JSON mode.
- Keep this read-only with respect to remote runs: no trigger, rerun or cancellation requests. Do not silently replace missing runs with newer runs of the same test.
- Validate output destinations before polling; use existing atomic JUnit writing and established summary-write behavior. Report handling must not conceal the original run/poll failure.
- Document and test dry-run artifact behavior consistently with the existing report flags.
Acceptance tests
- A mocked recovery of mixed passed/failed runs writes matching JUnit/summary counts and exits with the existing wait failure code; a successful control remains exit 0.
- Fetch-spy tests prove that reporting never dispatches or reruns a test, including when a run is already terminal or missing.
- Cover single and multiple IDs, two executions of the same test, absent optional fields, timeout, auth/poll errors, and an interrupted partial wait with honest partial reporting where results are available.
--output jsonremains parseable; annotation routing matches existing JSON-mode conventions; no flags preserves existing output/exit behavior.- Invalid artifact paths fail before polling; write-time failures do not erase already collected results or mask a failing verdict.
Overlap check
- [Hackathon] JUnit XML report export for batch test runs (CI integration) #95 / PR feat(test): JUnit XML report export for batch --wait runs #96 shipped JUnit for starting batch runs; this adds it to reattachment.
- [Hackathon] Add "testsprite ci": one-shot run + gate + GitHub-native output #99 / PR feat(test): GitHub-native CI output for "test run --all" (--gh-output, --summary-file) #264 supplied the existing CI output layer. This reuses that layer, not a new top-level
cicommand or an Action replacement. - [Hackathon] Make Interrupted Batch Runs Recoverable (Run Journal + Reattach) #80 concerns persistence/discovery of lost run IDs. This proposal requires explicit known run IDs and adds no journal or local-state lifecycle.
- [Hackathon] Validate --report-file and --summary-file paths before dispatching tests #455 concerns preflight validation of already-supported artifact paths; this is a distinct command capability and should coordinate on shared validation.
- [Hackathon] fix(test): batch --wait poll drops failure diagnostics from accepted[] rows #448 concerns dropped diagnostics in dispatched batch
accepted[]rows; this must retain evidence from the wait poll results without taking over that issue.
I searched current issues and PRs and reviewed the related issue discussions; I found no existing proposal or claim for this reattachment-reporting scope.
I'd like to contribute this for the Season 4 CLI Improvement Bonus. Please confirm the scope and eligibility during triage; I will follow the accepted-label/assignment flow before implementation and opening a PR. No implementation has started.
Confirmations
- I have searched existing issues and this is not a duplicate.
- I have provided my Discord identity above for reward coordination.
Activity
zeshi-du commentedon Oct 20, 2026
Thanks @ronkenx9. The recovery-job workflow makes sense, and you're right that
test waitcan re-attach to runs but can't write the CI reports.We won't add it to
test waitright now: in 1.0 it becomesrun wait, and the report flags on the run commands are being reworked at the same time. We'd rather add reporting torun waitonce that surface settles. Keeping this open so it carries into that work.ronkenx9 commentedon Oct 22, 2026
Closing per the maintainer note: not planned before the 1.0
run waitrework. Happy to pick it up again then.