Skip to content

fix: duplicate JUnit XML filename overwrites encoder test results - #3376

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/test-duplicate-junit-xml-filename
Open

fix: duplicate JUnit XML filename overwrites encoder test results#3376
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/test-duplicate-junit-xml-filename

Conversation

@andrewwhitecdw

Copy link
Copy Markdown
Contributor

This PR fixes a script issue in qa/L2_jax_unittest/test.sh: duplicate JUnit XML filename overwrites encoder test results.

Changes

  • qa/L2_jax_unittest/test.sh: duplicate JUnit XML filename overwrites encoder test results.

Details

--- a/qa/L2_jax_unittest/test.sh
+++ b/qa/L2_jax_unittest/test.sh
@@ -1,1 +1,1 @@
-NVTE_JAX_CUSTOM_CALLS="false" NVTE_JAX_UNITTEST_LEVEL="L2" python3 -m pytest -c $TE_PATH/tests/jax/pytest.ini -v --junitxml=$XML_LOG_DIR/pytest_test_single_gpu_encoder.xml $TE_PATH/examples/jax/encoder/test_single_gpu_encoder.py || test_fail "test_single_gpu_encoder.py"
+NVTE_JAX_CUSTOM_CALLS="false" NVTE_JAX_UNITTEST_LEVEL="L2" python3 -m pytest -c $TE_PATH/tests/jax/pytest.ini -v --junitxml=$XML_LOG_DIR/pytest_test_single_gpu_encoder_without_custom_call.xml $TE_PATH/examples/jax/encoder/test_single_gpu_encoder.py || test_fail "test_single_gpu_encoder.py"

Tests

  • qa/L2_jax_unittest/test.sh
--- a/qa/L2_jax_unittest/test.sh
+++ b/qa/L2_jax_unittest/test.sh
@@ -27,5 +27,11 @@
 : ${TE_PATH:=/opt/transformerengine}
 : ${XML_LOG_DIR:=/logs}
 mkdir -p "$XML_LOG_DIR"
+
+# Guard against accidental JUnit XML filename collisions in this script
+DUPE_JUNITXML=$(grep -v "DUPE_JUNITXML" "$0" | grep -oE -- '--junitxml=[^[:space:]]+' | sed 's/--junitxml=//' | sort | uniq -d)
+if [ -n "$DUPE_JUNITXML" ]; then
+    error_exit "Duplicate JUnit XML output paths detected: $DUPE_JUNITXML"
+fi
+
 NVTE_JAX_UNITTEST_LEVEL="L2" python3 -m pytest -c $TE_PATH/tests/jax/pytest.ini -v --junitxml=$XML_LOG_DIR/pytest_jax_not_distributed.xml $TE_PATH/tests/jax --ignore=$TE_PATH/tests/jax/test_multi_process_ep.py -k 'not distributed' || test_fail "tests/jax/*not_distributed_*"

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@github-actions github-actions Bot added the community-contribution PRs from external contributor outside the core maintainers, representing community-driven work. label Aug 13, 2026
@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR prevents the custom-call-disabled encoder test from overwriting the standard encoder test’s JUnit report.

  • Gives the custom-call-disabled test a distinct XML filename.
  • Adds a startup guard that detects duplicate --junitxml output paths in the QA script.

Confidence Score: 5/5

The PR appears safe to merge and preserves both encoder test reports under distinct filenames.

The updated report path is unique among the script’s JUnit outputs, and the added guard correctly detects exact duplicate output tokens without changing test execution.

Important Files Changed

Filename Overview
qa/L2_jax_unittest/test.sh Renames the colliding encoder report and adds a static duplicate-output check; no actionable defect was identified.

Reviews (1): Last reviewed commit: "fix: duplicate JUnit XML filename overwr..." | Re-trigger Greptile

if [ -n "$DUPE_JUNITXML" ]; then
error_exit "Duplicate JUnit XML output paths detected: $DUPE_JUNITXML"
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel changing the file name below is probably enough. Having the script constantly grepping in files might cause issues in CI (my suspicion). Thanks.

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

Labels

community-contribution PRs from external contributor outside the core maintainers, representing community-driven work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants