You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci: Only run E2E test apps that are affected on PRs (#14254)
This PR aims to solve two things:
1. Do not require us to keep a list of test-applications to run on CI.
This is prone to be forgotten, and then certain tests do not run on CI
and we may not notice (this has happened more than once in the past 😬 )
2. Do not run E2E test applications that are unrelated to anything that
was changed.
With this PR, instead of keeping a list of E2E test jobs we want to run
manually in the build.yml file, this is now inferred (on CI) by a script
based on the nx dependency graph and some config in the test apps
package.json. This is how it works:
1. Pick all folders in test-applications, by default all of them should
run. --> This will "fix" the problem we had sometimes that we forgot to
add test apps to the build.yml so they don't actually run on CI
:grimacing:
3. For each test app, look at it's dependencies (and devDependencies),
and see if any of them has changed in the current PR (based on nx
affected projects). So e.g. if you change something in browser, only E2E
test apps that have any dependency that uses browser will run, so e.g.
node-express will be skipped.
4. Additionally, you can configure variants in the test apps
package.json - instead of defining this in the workflow file, it has to
be defined in the test app itself now.
5. Finally, a test app can be marked as optional in the package.json,
and can also have optional variants to run.
6. The E2E test builds the required & optional matrix on the fly based
on these things.
7. In pushes (=on develop/release branches) we just run everything.
8. If anything inside of the e2e-tests package changed, run everything.
--> This could be further optimized to only run changed test apps, but
this was the easy solution for now.
## Example test runs
* In a PR with no changes related to the E2E tests, nothing is run:
https://github.com/getsentry/sentry-javascript/actions/runs/11838604965
* In a CI run for a push, all E2E tests are run:
https://github.com/getsentry/sentry-javascript/actions/runs/11835834748
* In a PR with a change in e2e-tests itself, all E2E tests are run:
https://github.com/getsentry/sentry-javascript/actions/runs/11836668035
* In a PR with a change in the node package, only related E2E tests are
run:
https://github.com/getsentry/sentry-javascript/actions/runs/11838274483
0 commit comments