Skip to content

ci: Only run affected unit tests on PRs #13052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 1, 2024
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Jul 25, 2024

This PR updates our unit test runner on CI to only run unit tests for packages that have been changed.

In addition, it also updates the list of packages to run in node/browser only unit test envs - we've been running some in both. We only actually need to run the fully-browser-only unit tests in the "Browser Unit Tests" job, the rest (including e.g. core, ...) runs in the node unit tests in all node versions.

In a follow up step, maybe we can further streamline this and simply run only unit tests and ensure that e.g. the browser ones only run in one of the node versions, not all of them. Or find another way that does not require us to keep 2 lists of packages in separate places. But for now, this should be an improvement.

I opened a test PR to show this in action, where only something in the react package was changed:

@mydea mydea self-assigned this Jul 25, 2024
Copy link
Contributor

github-actions bot commented Jul 25, 2024

size-limit report 📦

Path Size
@sentry/browser 22.45 KB (0%)
@sentry/browser (incl. Tracing) 34.22 KB (0%)
@sentry/browser (incl. Tracing, Replay) 70.28 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 63.62 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 74.68 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 87.26 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 89.11 KB (0%)
@sentry/browser (incl. metrics) 26.75 KB (0%)
@sentry/browser (incl. Feedback) 39.37 KB (0%)
@sentry/browser (incl. sendFeedback) 27.06 KB (0%)
@sentry/browser (incl. FeedbackAsync) 31.7 KB (0%)
@sentry/react 25.22 KB (0%)
@sentry/react (incl. Tracing) 37.22 KB (0%)
@sentry/vue 26.6 KB (0%)
@sentry/vue (incl. Tracing) 36.06 KB (0%)
@sentry/svelte 22.58 KB (0%)
CDN Bundle 23.64 KB (0%)
CDN Bundle (incl. Tracing) 35.88 KB (0%)
CDN Bundle (incl. Tracing, Replay) 70.31 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 75.57 KB (0%)
CDN Bundle - uncompressed 69.37 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 106.31 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 218.16 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 230.99 KB (0%)
@sentry/nextjs (client) 37.07 KB (0%)
@sentry/sveltekit (client) 34.79 KB (0%)
@sentry/node 114.65 KB (0%)
@sentry/node - without tracing 89.33 KB (0%)
@sentry/aws-serverless 98.5 KB (0%)

@mydea mydea force-pushed the fn/unit-tests-affected branch from 2d1a4ad to d164c7a Compare July 31, 2024 12:25
@mydea mydea marked this pull request as ready for review August 1, 2024 06:48
@mydea mydea force-pushed the fn/unit-tests-affected branch from 5d8543e to 125a3f5 Compare August 1, 2024 06:48
@@ -434,6 +434,11 @@ jobs:
timeout-minutes: 10
runs-on: ubuntu-20.04
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to check this out here so we can use it to get changed files

Copy link
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

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

Really cool!

@mydea mydea merged commit 2306458 into develop Aug 1, 2024
128 checks passed
@mydea mydea deleted the fn/unit-tests-affected branch August 1, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants