Skip to content

ci(qdc): reconstruct pytest summary from --report-log on abort - #1291

Merged
Mengsheng Wu (mengshengwu) merged 1 commit into
mainfrom
ci/qdc-pytest-reportlog
Aug 5, 2026
Merged

ci(qdc): reconstruct pytest summary from --report-log on abort#1291
Mengsheng Wu (mengshengwu) merged 1 commit into
mainfrom
ci/qdc-pytest-reportlog

Conversation

@mengshengwu

@mengshengwu Mengsheng Wu (mengshengwu) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The Actions Summary page for test-sdk-qdc shows a bare No JUnit XML recovered line whenever the on-device pytest process aborts mid-run (Fatal Python error, Windows fatal exception). --junitxml only flushes at session end, so a native crash truncates the file to nothing and there is no cell-level record for the run.
  • Add --report-log alongside --junitxml on the QDC pytest command. pytest-reportlog writes one NDJSON record per test as it completes and flushes after every write, so the ledger survives an abort.
  • run_qdc_pytest.py still prefers the JUnit XML when it is complete; when it is empty or absent it reconstructs the same markdown from the NDJSON. Nodeids that started but never produced a call-phase report are surfaced as process aborted before test completed so the crashing cell is visible on the summary page.

Test plan

  • Unit test with a synthetic NDJSON stream (2 pass + 1 fail + 1 mid-call abort): summary renders 1 pass, 2 fail; abort row shows process aborted before test completed.
  • Regression test against the existing JUnit XML path: pass / fail / skip render unchanged.
  • Real QDC run — verify the Summary page for a failing job now lists each cell (was: only No JUnit XML recovered). Pending CI on this PR.

pytest's --junitxml flushes only at session end, so any mid-run process
abort (Fatal Python error, Windows fatal exception) leaves the XML empty
and the Actions Summary page falls back to a bare 'No JUnit XML recovered'
line. Add --report-log alongside --junitxml — it emits one NDJSON record
per test as each finishes and flushes after every write, so the ledger
survives the abort. run_qdc_pytest prefers the JUnit XML when it's
complete and reconstructs the same markdown from the NDJSON otherwise,
tagging tests that started but never produced a call-phase report so the
aborting cell is visible on the summary.

Signed-off-by: Mengsheng Wu <mengshengwu@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant