Skip to content

[Reference] test: arbitrary change to 1 test file#110624

Closed
JoshuaKGoldberg wants to merge 5 commits into
masterfrom
frontend-jest-ci-changed-since-testing
Closed

[Reference] test: arbitrary change to 1 test file#110624
JoshuaKGoldberg wants to merge 5 commits into
masterfrom
frontend-jest-ci-changed-since-testing

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Mar 13, 2026

Copy link
Copy Markdown
Member

Verifying #110568 works for: just one test, no source.

  • Jest (0): 2 passed, 2 total
  • Jest (1): No tests found, exiting with code 0
  • Jest (2): No tests found, exiting with code 0
  • Jest (3): No tests found, exiting with code 0
  • Total: 2 tests out of 14,640

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 13, 2026
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from e489c3c to 2f37360 Compare March 19, 2026 12:53
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from 5db3758 to 0d36981 Compare March 19, 2026 13:13
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from 2f37360 to f44f300 Compare March 19, 2026 13:16
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from 0d36981 to 5af8491 Compare March 19, 2026 13:17
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from 5af8491 to 10f4393 Compare March 19, 2026 13:36
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from f44f300 to 78fe0de Compare March 19, 2026 13:37
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from 10f4393 to 1da3c89 Compare March 19, 2026 13:38
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from 78fe0de to cbcf12f Compare March 19, 2026 14:04
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from 1da3c89 to 89dfa3e Compare March 19, 2026 14:04
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from cbcf12f to 9e2e96f Compare March 19, 2026 14:10
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from 89dfa3e to 085ac61 Compare March 19, 2026 14:11
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from 9e2e96f to bfb60f9 Compare March 19, 2026 14:47
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from 085ac61 to d7218b1 Compare March 19, 2026 14:48
@JoshuaKGoldberg JoshuaKGoldberg changed the title test: arbitrary change to banner.spec.tsx test: arbitrary change to 1 test file Mar 19, 2026
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from bfb60f9 to ad17db8 Compare March 19, 2026 15:06
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from d7218b1 to cf4a149 Compare March 19, 2026 15:07
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from ad17db8 to 33ec412 Compare March 19, 2026 15:15
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from cf4a149 to 805f7df Compare March 19, 2026 15:15
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from 33ec412 to a7801c2 Compare March 19, 2026 17:04
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from 805f7df to 665d1d0 Compare March 19, 2026 17:07
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from a7801c2 to 1d52432 Compare March 19, 2026 17:19
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from 665d1d0 to cddee3d Compare March 19, 2026 17:19
@JoshuaKGoldberg JoshuaKGoldberg changed the title test: arbitrary change to 1 test file [Reference] test: arbitrary change to 1 test file Mar 19, 2026
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from 1d52432 to 6138aa6 Compare March 25, 2026 16:36
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch 2 times, most recently from e66bf4d to ea5f175 Compare March 25, 2026 16:55
The git diff for the non-frontend file guard was comparing against HEAD
(the synthetic merge commit) instead of HEAD^2 (the PR branch tip).
This included base branch changes in the diff, causing false positives
that unnecessarily forced full test runs.

Made-with: Cursor
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since branch from 14d8c0e to 5c9ae7e Compare March 26, 2026 20:13
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the frontend-jest-ci-changed-since-testing branch from ea5f175 to fd8ea03 Compare March 26, 2026 20:17
JoshuaKGoldberg added a commit that referenced this pull request Mar 30, 2026
_"Why run many unit test when few do trick?"_ – Kevin Malone, Senior
Frontend Developer

Changes the Frontend > Jest jobs to use Jest's [`--changedSince`
option](https://jestjs.io/docs/cli#--changedsince) when possible. That
has them only run test suites that are impacted by the changes in a PR
based on the module dependency graph. Jest requires the commit history
since the base commit, so this adds a second _"run only necessary Jest
tests"_ flow in `frontend-optional.yml`. Specifically, that:

1. Increases the frontend-optional fetch-depth in PRs to `100`, which
should get most PRs' commits pretty quickly
2. Tries to compute a `MERGE_BASE` using `git merge-base`
* Note that this also clears `MERGE_BASE` if the PR touches any
non-`static/` files.
3. If `MERGE_BASE` could be computed, passes it as a process env var to
test scripts for use as Jest's `changedSince`
* If `MERGE_BASE` couldn't be computed, the new _"run only necessary
Jest tests"_ flow is skipped

My plan (thanks to reviewer feedback) is to keep this running as a
secondary, optional test flow on `master` for a couple weeks. If all
seems well, we can remove the original _"run all Jest tests"_ logic and
only run the _"run only necessary Jest tests"_ logic.

The following PRs exercise different scales of changes:

| PR | Source Files | Test Files | Interconnectivity | Ran Suites | /
1,881 suites |
|---|---|---|---|---|---|
| [#110624](#110624) | 0 | 1 |
⬜️ None | 1 | 0.05% |
| [#111073](#111073) | 0 | 6 |
⬜️ None | 6 | 0.32% |
| [#111122](#111122) | 0 | 100 |
⬜️ None | 100 | 5.3% |
| [#111074](#111074) | 1 | 0 | 🟦
Low | 5 | 0.27% |
| [#111075](#111075) | 4 | 0 | 🟦
Low | 7 | 0.37% |
| [#111076](#111076) | 3 | 3 | 🟦
Low | 13 | 0.69% |
| [#111110](#111110) | 20 | 20 |
🟦 Low | 74 | 3.9% |
| [#111111](#111111) | 100 | 100
| 🟦 Low | 196 | 10.4% |
| [#111119](#111119) | 1 | 1 | 🟨
Medium | 30 | 1.6% |
| [#111628](#111628) | 3 | 3 | 🟨
Medium | 78 | 4.1% |
| [#111629](#111629) | 10 | 10 |
🟨 Medium | 167 | 8.9% |
| [#111633](#111633) | 25 | 25 |
🟨 Medium | 227 | 12.1% |
| [#111652](#111652) | 100 | 100
| 🟨 Medium | 549 | 29.2% |
| [#111115](#111115) | 3 | 3 | 🟧
High | 1,652 | 87.8% |
| [#111083](#111083) | 20 | 20 |
🟧 High | 1,660 | 88.3% |
| [#111086](#111086) | 100 | 100
| 🟧 High | 1,721 | 91.5% |
| [#110568](#110568) | 0 | 0 | 🟥
Config (Full) | 1,881 | 100% |

For low-connectivity changes (isolated components, feature-specific
views), `--changedSince` provides pretty great savings: even 100
low-connectivity files only trigger ~10% of suites. Medium-connectivity
files still scale pretty well, with 100 files hitting ~29%.
High-connectivity files (widely-imported utils, core components) sadly
trigger 85-90% of suites, which is inevitable given Sentry's highly
connected module graph.

Fixes ENG-7103
Base automatically changed from frontend-jest-ci-changed-since to master March 30, 2026 14:17
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant