Skip to content

[visual testing] Upload visual E2E test results for test history - #59858

Merged
robhogan merged 2 commits into
mainfrom
robhogan/upload-test-results
Nov 12, 2026
Merged

robhogan merged 2 commits into
mainfrom
robhogan/upload-test-results

Conversation

@robhogan

@robhogan robhogan commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #59581.

Collects E2E results from every Test All run, for a test history dashboard (flakiness, first failure, PR failures).

After each Test All run, including fork PRs, a trusted workflow_run job copies each E2E job's per-flow results.json, the run's artifact links and a short run description to the visual testing bucket. It reuses the VISUAL_* variables and create-only OIDC access, and skips when they're unset.

Changelog: [Internal]

Test plan:
Ran end-to-end on my fork, including a failed attempt and a rerun. Ran the download step locally against a real failed main run here, and against a stubbed gh for API errors, non-JSON results and an attempt replaced by a later rerun.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 7, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 7, 2026
@robhogan robhogan changed the title Upload E2E test results for test history Upload visual E2E test results for test history Nov 7, 2026
@robhogan
robhogan force-pushed the robhogan/upload-test-results branch from 8a9a3d5 to 48087cf Compare November 10, 2026 16:11
@robhogan
robhogan changed the base branch from main to robhogan/visual-cas-baselines November 10, 2026 16:11
@robhogan
robhogan force-pushed the robhogan/upload-test-results branch from 48087cf to e4379a8 Compare November 10, 2026 16:24
@robhogan
robhogan added this pull request to stack #59971 November 12, 2026 14:16
@robhogan
robhogan force-pushed the robhogan/upload-test-results branch from e4379a8 to 5c3259b Compare November 12, 2026 14:18
@robhogan
robhogan requested a review from cortinico November 12, 2026 15:33
Base automatically changed from robhogan/visual-cas-baselines to main November 12, 2026 15:34
After every Test All run, including PRs from forks, a trusted `workflow_run` workflow on the default branch copies each E2E job's per-flow `results.json`, an `artifacts.json` listing every artifact in the run with its GitHub link (so recordings and logs can be linked), and a `run.json` describing the run to `verify/incoming/<repo>/<run-id>-<attempt>/` in the visual testing bucket. It reuses the visual testing GCP variables and skips when they are unset. Artifacts are copied as data: only `results.json` is extracted from each archive, size-limited, and nothing is executed. An attempt whose test state a later rerun has replaced isn't recorded, so a late upload of an earlier attempt can't store incomplete or later results. GitHub API calls are retried. Objects are write-once, with `run.json` uploaded last to mark a run complete.

Changelog: [Internal]
@robhogan
robhogan force-pushed the robhogan/upload-test-results branch from 5c3259b to 7b75010 Compare November 12, 2026 15:34
steps:
- name: Download test results
run: |
set -euo pipefail

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably having this in a standalone bash file would be better?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 06844c8 - it all lives in .github/workflow-scripts/upload-test-results.sh now.

Comment on lines +122 to +129
retry() {
for attempt in 1 2 3; do
"$@" && return 0
echo "Attempt $attempt failed"
sleep $((attempt * 10))
done
return 1
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe we already have another GH Action to perform an action thrice with retry 🤔 can we reuse it?

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mostly nits

@robhogan
robhogan merged commit b8f0db7 into main Nov 12, 2026
83 checks passed
@robhogan robhogan changed the title Upload visual E2E test results for test history [visual testing] Upload visual E2E test results for test history Nov 13, 2026
usama-liaqat pushed a commit to usama-liaqat/react-native that referenced this pull request Nov 14, 2026
* Upload Test All results to GCS for test history

After every Test All run, including PRs from forks, a trusted `workflow_run` workflow on the default branch copies each E2E job's per-flow `results.json`, an `artifacts.json` listing every artifact in the run with its GitHub link (so recordings and logs can be linked), and a `run.json` describing the run to `verify/incoming/<repo>/<run-id>-<attempt>/` in the visual testing bucket. It reuses the visual testing GCP variables and skips when they are unset. Artifacts are copied as data: only `results.json` is extracted from each archive, size-limited, and nothing is executed. An attempt whose test state a later rerun has replaced isn't recorded, so a late upload of an earlier attempt can't store incomplete or later results. GitHub API calls are retried. Objects are write-once, with `run.json` uploaded last to mark a run complete.

Changelog: [Internal]

* Move test result upload steps into a script and download with download-artifact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants