Skip to content

ci: Collect jest test file names in frontend.yml, and adjust matrix size based on the list len()#116749

Merged
ryan953 merged 3 commits into
masterfrom
ryan953/ci-jest-file-list
Jun 3, 2026
Merged

ci: Collect jest test file names in frontend.yml, and adjust matrix size based on the list len()#116749
ryan953 merged 3 commits into
masterfrom
ryan953/ci-jest-file-list

Conversation

@ryan953

@ryan953 ryan953 commented Jun 3, 2026

Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 3, 2026
@ryan953 ryan953 force-pushed the ryan953/ci-jest-file-list branch from 83ae74a to 61aa356 Compare June 3, 2026 02:26
Comment thread .github/workflows/frontend.yml Outdated
@ryan953 ryan953 force-pushed the ryan953/ci-jest-file-list branch 2 times, most recently from 35570ca to eda8fbb Compare June 3, 2026 02:36
@ryan953 ryan953 force-pushed the ryan953/ci-jest-file-list branch from eda8fbb to 2fd8df1 Compare June 3, 2026 02:37
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@ryan953 ryan953 force-pushed the ryan953/ci-jest-file-list branch from 8ecbad8 to cc37ee8 Compare June 3, 2026 03:35
Move the jest test file list from a GitHub Actions job output to an
uploaded artifact. This avoids output size limits and makes the data
flow more explicit.

Also fixes pre-existing issues:
- Runner sharding was broken: ${#JEST_TESTS[@]} always returned 1
  since JEST_TESTS is a string, not an array. Use jq to count the
  JSON array length instead.
- jest_test_config step was skipped on push events, leaving the
  matrix output empty. Move the event check into the script so the
  step always runs.
- jest-tests checkout no longer needs fetch-depth: 100 since it
  reads test files from the artifact, not git history.
- Remove unused typecheckable_rules_changed output.
- Extract inline bash into .github/workflows/scripts/jest-test-config.sh.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
@ryan953 ryan953 force-pushed the ryan953/ci-jest-file-list branch from cc37ee8 to 2910134 Compare June 3, 2026 03:39
@ryan953 ryan953 marked this pull request as ready for review June 3, 2026 03:44
@ryan953 ryan953 requested review from a team as code owners June 3, 2026 03:44
Comment thread .github/workflows/scripts/jest-test-config.sh Outdated
Comment thread jest.config.ts Outdated
Comment thread .github/workflows/frontend.yml
Comment thread jest.config.ts Outdated
The `jq -r '.'` in the changedSince path converted the JSON array from
`jest --listTests --json` into newline-separated paths, making the output
invalid JSON. This caused `jq 'length'` to fail and `jest.config.ts` to
crash on `JSON.parse` when reading `jest-test-files.json`.

Also remove `continue-on-error` on the artifact download so a missing
file fails fast, and add an early guard in `jest.config.ts` that errors
if CI sharding is configured but the test list is absent. Fix
`passWithNoTests` to check presence rather than array length.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 692cce5. Configure here.

Comment thread .github/workflows/frontend.yml

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, I like this a lot. Nice!

@ryan953 ryan953 merged commit fb17da7 into master Jun 3, 2026
74 checks passed
@ryan953 ryan953 deleted the ryan953/ci-jest-file-list branch June 3, 2026 15:02
ryan953 added a commit that referenced this pull request Jun 3, 2026
ryan953 added a commit that referenced this pull request Jun 4, 2026
This updates the tags that are included with the spans that we log
whenever jest runs. I don't think any dashboards currently look at the
tags, but they'll be nice to help slice&dice the data to see why
outliers exist.

I think going forward we'll see PR runs (where branch!=master) that have
different perf characteristics. This will let us see how many tests were
included, how many nodes they got spread over, we'll expect to see
`strategy=by_duration` in all cases too.

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

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants