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
chore: CircleCI performance improvements on PRs #9993
chore: CircleCI performance improvements on PRs #9993
Conversation
07fe19f
to
c48288b
Compare
a1070ee
to
3d68cdd
Compare
36186a2
to
fe65bbc
Compare
63f7de6
to
3c9a435
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition! I think this can have a big impact on how fast our tests run.
Something came to my mind when reviewing this, if a user updates a method within a file that is not under /Scenes
, we can run all tests. Ideally, we would run tests only in files that are importing that method but that might not be trivial. What do you think about it?
Yes, that would be ideal. There might even be tools that calculate an import tree to run all tests that import files (importing files) which import the updated file. I remember reading an article about someone doing this for Ruby projects. This could be a next step to avoid running non-related tests and, at the same time, to make sure all tests that could potentially fail run in CircleCI. |
ignore: | ||
- main | ||
- /.*release$/ | ||
- /.*build-me$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought, non-blocking: Always running all tests for main, release and hot fixes makes a lot of sense, for build-me I wonder if forcing a run based on something like a label would be better than having to rename the branch: https://github.com/marketplace/actions/run-circle-ci-on-label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great idea! 👍 It might be good to keep both because this is how to force all tests to run in Gravity. I'll try to make this version with the label work as well and then add it here and to Gravity's CircleCI config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add the beta-ios
and beta-android
branches here ❤️
echo "No ts|tsx files are updated. Skipping tests." | ||
then | ||
yarn jest $JEST_OPTIONS | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great addition! minor comment about how we force a build
ff2c2f1
5c4bff7
to
80e4bec
Compare
609406d
to
8da1183
Compare
@@ -0,0 +1,20 @@ | |||
# Because we don't run all tests on every PR, adding the label "build-me" to a PR will trigger all tests to run on CircleCI. | |||
name: Run all js tests on "build-me" label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should trigger all tests when adding the label build-me
to the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brainbicycle well, this does not work as expected.... Do you have an idea how this could work? I've tried a bit but couldn't find out how to correctly trigger the tests when adding the build-me
label with GitHub actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it def doesn't have to block anything, I might mess with it one of these future fridays
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!! ⚡
8da1183
to
61d21cd
Compare
This reverts commit 231bb4d.
Description
This PR aims to improve CircleCI performance by running only relevant Jest tests on PR commits.
With this change, CircleCI only runs a subset of relevant Jest tests when:
release
,build-me
, orhotfix
ts(x)
files outside ofsrc/app/Scenes/
,the PR does not include abuild-me
tag.If a PR only updates
ts(x)
within a scene, CircleCI will from now on only run a subset of relevant tests (within the same scene or with a similar name).To Do
beta-
branches to ignored branchesyarn.lock
andpackage.json
updates need to trigger test suiteGithub Action idea to trigger when adding a tag
# Because we don't run all tests on every PR, adding the label "build-me" to a PR will trigger all tests to run on CircleCI. name: Run all js tests on "build-me" label on: pull_request: types: - labeled
jobs:
trigger:
permissions:
contents: none
runs-on: ubuntu-latest
steps:
- name: Trigger all js tests
run: |
curl
-X POST
--header "Content-Type: application/json"
-d "{"branch": "$GITHUB_HEAD_REF"}"
https://circleci.com/api/v1.1/project/github/artsy/eigen/build?circle-token=${{ secrets.CircleToken }}
Tests
Ideas
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.