Skip to content
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

build: Selectively run ember tests #3571

Merged
merged 3 commits into from
May 19, 2021
Merged

build: Selectively run ember tests #3571

merged 3 commits into from
May 19, 2021

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented May 19, 2021

Only run ember tests if packages/ember or it's dependents have changed.

Ran yarn init -y && yarn add @sentry/ember && npm ls --depth 4 --parseable | grep "@sentry/" to get dependents

ember-test-env/node_modules/@sentry/ember
ember-test-env/node_modules/@sentry/browser
ember-test-env/node_modules/@sentry/core
ember-test-env/node_modules/@sentry/tracing
ember-test-env/node_modules/@sentry/hub
ember-test-env/node_modules/@sentry/minimal
ember-test-env/node_modules/@sentry/types
ember-test-env/node_modules/@sentry/utils

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@github-actions
Copy link
Contributor

github-actions bot commented May 19, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 20.76 KB (0%)
@sentry/browser - Webpack 21.98 KB (0%)
@sentry/react - Webpack 22.01 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.16 KB (0%)

Copy link
Member

@HazAT HazAT left a comment

Choose a reason for hiding this comment

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

💯

Strictly speaking, if we changed anything in @sentry/ember dependencies we would need to run the tests. But they take soooooooooooo long that I think I am ok with it.

@AbhiPrasad AbhiPrasad force-pushed the abhi/skip-ember-tests branch from 0b786f0 to 6f0b9da Compare May 19, 2021 18:20
@AbhiPrasad AbhiPrasad marked this pull request as ready for review May 19, 2021 18:20
@AbhiPrasad AbhiPrasad requested a review from kamilogorek as a code owner May 19, 2021 18:20
@AbhiPrasad AbhiPrasad enabled auto-merge (squash) May 19, 2021 18:21
@AbhiPrasad AbhiPrasad merged commit 9dffb92 into master May 19, 2021
@AbhiPrasad AbhiPrasad deleted the abhi/skip-ember-tests branch May 19, 2021 18:30
lobsterkatie added a commit that referenced this pull request Dec 1, 2021
Given that ember tests take longer to run than most other tests (and have been known to fail for reasons having nothing to do with whatever PR we're working on), in #3571 we stopped running them locally and on PRs*, instead only running them when merging to `master` or releasing.

*Provided the PR didn't touch any of the `@sentry/ember` code

As a result, we didn't catch a currently-failing ember test until later than we would have liked. To prevent that from happening again, this restores the running of ember tests (both locally and on PRs), but restricts which tests run in each circumstance, in order to prevent this change from slowing down the overall repo test suite more than necessary. Specifically:

- Locally, we run tests only against the current version of ember.
- In the context of a PR, we run tests against the current version, the LTS version, and a version using `embroider` (which is an optional ember compiler many people use).
- When merging to `master` or creating a release, for greatest safety, we test against current, LTS, embroider, beta, and "classic" (a legacy ember version).

Key changes:

- Up until now, the logic controlling which set of ember tests to run has been split between a script (`run_tests.js`, which differentiated local runs from CI runs), and the GHA workflow config (`build.yml`, which differentiated PRs from merges into master and creation of releases). That work is now consolidated into the ember-try config (since ember-try is the runner which needs to know which tests to run in the first place!).
- As a result of the above change, the method for forcing tests for all versions of ember to run needed to be modified. That option is now handled by a new script, `run-CI-tests.js`, which simply mimics the the third situation above by setting environment variables, thereby tricking ember-try into thinking it needs to run all tests.
AbhiPrasad pushed a commit that referenced this pull request Dec 1, 2021
Given that ember tests take longer to run than most other tests (and have been known to fail for reasons having nothing to do with whatever PR we're working on), in #3571 we stopped running them locally and on PRs*, instead only running them when merging to `master` or releasing.

*Provided the PR didn't touch any of the `@sentry/ember` code

As a result, we didn't catch a currently-failing ember test until later than we would have liked. To prevent that from happening again, this restores the running of ember tests (both locally and on PRs), but restricts which tests run in each circumstance, in order to prevent this change from slowing down the overall repo test suite more than necessary. Specifically:

- Locally, we run tests only against the current version of ember.
- In the context of a PR, we run tests against the current version, the LTS version, and a version using `embroider` (which is an optional ember compiler many people use).
- When merging to `master` or creating a release, for greatest safety, we test against current, LTS, embroider, beta, and "classic" (a legacy ember version).

Key changes:

- Up until now, the logic controlling which set of ember tests to run has been split between a script (`run_tests.js`, which differentiated local runs from CI runs), and the GHA workflow config (`build.yml`, which differentiated PRs from merges into master and creation of releases). That work is now consolidated into the ember-try config (since ember-try is the runner which needs to know which tests to run in the first place!).
- As a result of the above change, the method for forcing tests for all versions of ember to run needed to be modified. That option is now handled by a new script, `run-CI-tests.js`, which simply mimics the the third situation above by setting environment variables, thereby tricking ember-try into thinking it needs to run all tests.
onurtemizkan pushed a commit that referenced this pull request Dec 19, 2021
Given that ember tests take longer to run than most other tests (and have been known to fail for reasons having nothing to do with whatever PR we're working on), in #3571 we stopped running them locally and on PRs*, instead only running them when merging to `master` or releasing.

*Provided the PR didn't touch any of the `@sentry/ember` code

As a result, we didn't catch a currently-failing ember test until later than we would have liked. To prevent that from happening again, this restores the running of ember tests (both locally and on PRs), but restricts which tests run in each circumstance, in order to prevent this change from slowing down the overall repo test suite more than necessary. Specifically:

- Locally, we run tests only against the current version of ember.
- In the context of a PR, we run tests against the current version, the LTS version, and a version using `embroider` (which is an optional ember compiler many people use).
- When merging to `master` or creating a release, for greatest safety, we test against current, LTS, embroider, beta, and "classic" (a legacy ember version).

Key changes:

- Up until now, the logic controlling which set of ember tests to run has been split between a script (`run_tests.js`, which differentiated local runs from CI runs), and the GHA workflow config (`build.yml`, which differentiated PRs from merges into master and creation of releases). That work is now consolidated into the ember-try config (since ember-try is the runner which needs to know which tests to run in the first place!).
- As a result of the above change, the method for forcing tests for all versions of ember to run needed to be modified. That option is now handled by a new script, `run-CI-tests.js`, which simply mimics the the third situation above by setting environment variables, thereby tricking ember-try into thinking it needs to run all tests.
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