Skip to content

[Hackathon] Add CI reports to test wait so resumed runs can produce artifacts without rerunning tests #456

Closed as not planned

Description

@ronkenx9

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.xml

All 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 expects accepted[] (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

  1. 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.
  2. Fetch-spy tests prove that reporting never dispatches or reruns a test, including when a run is already terminal or missing.
  3. 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.
  4. --output json remains parseable; annotation routing matches existing JSON-mode conventions; no flags preserves existing output/exit behavior.
  5. Invalid artifact paths fail before polling; write-time failures do not erase already collected results or mask a failing verdict.

Overlap check

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

  1. zeshi-du commented on Oct 20, 2026

    @zeshi-du
    Contributor

    Thanks @ronkenx9. The recovery-job workflow makes sense, and you're right that test wait can re-attach to runs but can't write the CI reports.

    We won't add it to test wait right now: in 1.0 it becomes run wait, and the report flags on the run commands are being reworked at the same time. We'd rather add reporting to run wait once that surface settles. Keeping this open so it carries into that work.

  2. ronkenx9 commented on Oct 22, 2026

    @ronkenx9
    ContributorAuthor

    Closing per the maintainer note: not planned before the 1.0 run wait rework. Happy to pick it up again then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions