Skip to content

Add JUnit output to the test runner - #11197

Open
CliveUnger wants to merge 1 commit into
triton-lang:mainfrom
CliveUnger:cunger/test-runner-junit
Open

Add JUnit output to the test runner#11197
CliveUnger wants to merge 1 commit into
triton-lang:mainfrom
CliveUnger:cunger/test-runner-junit

Conversation

@CliveUnger

Copy link
Copy Markdown
Contributor

This PR was authored with the help of Codex Sol 5.6


  • add --junit-dir support to python -m triton._test_runner suite
  • write a distinct JUnit XML report for each pytest subprocess
  • support the unit, Gluon, and GSAN runner partitions
  • resolve relative report directories before launching subprocesses
  • add coverage for report naming, concurrent partitions, and relative paths

Motivation

Downstream CI systems need machine-readable test results from Triton's
source-owned test runner. Supplying JUnit paths inside the runner keeps test
selection, parallelism, and report partitioning under the same ownership and
prevents concurrent pytest subprocesses from overwriting one another.

JUnit output remains opt-in. Existing invocations behave unchanged unless
--junit-dir or TRITON_TEST_JUNIT_DIR is provided.

Testing

  • python -m pytest -q python/test/unit/runtime/test_driver.py
  • pre-commit run --from-ref github/main --to-ref HEAD

References:

@CliveUnger
CliveUnger requested a review from ptillet as a code owner August 6, 2026 19:22
@ThomasRaoux

Copy link
Copy Markdown
Collaborator

this feels pretty intrusive for something used downstream, I expect it will be hard to maintain. Did you look at alternative ways to do this?
Is your goal to gather statistics from CI?

@CliveUnger

Copy link
Copy Markdown
Contributor Author

this feels pretty intrusive for something used downstream, I expect it will be hard to maintain. Did you look at alternative ways to do this? Is your goal to gather statistics from CI?

The idea is to serialize test results into a standardized format and it is opt-in only. This can be use for CI statistics yes, but just generally for automation in CI or locally. Unfortunately, overriding the pytest flags like PYTEST_ADDOPTS=--junitxml=... is not enough because that flag only lets you set a single filepath, which would be overwritten by each pytest invocation, which is why we needed the solution presented in this PR.

@CliveUnger
CliveUnger force-pushed the cunger/test-runner-junit branch from 24463c5 to 85344da Compare August 6, 2026 23:24
@CliveUnger

Copy link
Copy Markdown
Contributor Author

@ThomasRaoux I tried re-writing this to be a simpler and less intrusive. Still remains opt-in only, but uses uuid in the file names to avoid outputs overwriting each other.

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.

3 participants