Skip to content

Add failure preservation and artifact upload for GTest XML results (#985) - #985

Closed
agampe wants to merge 1 commit into
facebook:mainfrom
agampe:export-D102739348
Closed

Add failure preservation and artifact upload for GTest XML results (#985)#985
agampe wants to merge 1 commit into
facebook:mainfrom
agampe:export-D102739348

Conversation

@agampe

@agampe agampe commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary:

The Redex CI composite action already sets GTEST_OUTPUT=xml:/tmp/test-results/ to generate GTest XML reports, but the XML files were never uploaded and were lost when the runner exited. Additionally, if tests failed, subsequent steps would not run.

This change adds three things to setup-build-and-test-w-make-impl/action.yml:

  1. Exit code capture: The "Run tests" step now uses set +e and captures the exit code to $GITHUB_OUTPUT instead of failing immediately. This ensures subsequent steps (artifact upload) always run. Also clears stale XML files before running tests.

  2. Artifact upload: A new actions/upload-artifact@v4 step uploads /tmp/test-results/ with unique artifact names per matrix entry (using inputs.job_name). Uses if-no-files-found: ignore so 32-bit builds that skip tests are unaffected. 14-day retention.

  3. Failure gate: A final step checks the captured exit code and runs exit 1 if tests failed, preserving the red failure signal on the job after artifacts are safely uploaded.

Differential Revision: D102739348

@meta-cla meta-cla Bot added the CLA Signed label Apr 28, 2026
@meta-codesync

meta-codesync Bot commented Apr 28, 2026

Copy link
Copy Markdown

@agampe has exported this pull request. If you are a Meta employee, you can view the originating Diff in D102739348.

…acebook#985)

Summary:

The Redex CI composite action already sets GTEST_OUTPUT=xml:/tmp/test-results/ to generate GTest XML reports, but the XML files were never uploaded and were lost when the runner exited. Additionally, if tests failed, subsequent steps would not run.

This change adds three things to setup-build-and-test-w-make-impl/action.yml:

1. **Exit code capture**: The "Run tests" step now uses `set +e` and captures the exit code to `$GITHUB_OUTPUT` instead of failing immediately. This ensures subsequent steps (artifact upload) always run. Also clears stale XML files before running tests.

2. **Artifact upload**: A new `actions/upload-artifact@v4` step uploads /tmp/test-results/ with unique artifact names per matrix entry (using `inputs.job_name`). Uses `if-no-files-found: ignore` so 32-bit builds that skip tests are unaffected. 14-day retention.

3. **Failure gate**: A final step checks the captured exit code and runs `exit 1` if tests failed, preserving the red failure signal on the job after artifacts are safely uploaded.

Differential Revision: D102739348
@meta-codesync meta-codesync Bot changed the title Add failure preservation and artifact upload for GTest XML results Add failure preservation and artifact upload for GTest XML results (#985) Apr 28, 2026
@agampe
agampe force-pushed the export-D102739348 branch from d93af34 to 73863bc Compare April 28, 2026 07:59
@meta-codesync meta-codesync Bot closed this in a9f402f Apr 28, 2026
@meta-codesync

meta-codesync Bot commented Apr 28, 2026

Copy link
Copy Markdown

This pull request has been merged in a9f402f.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant