-
Notifications
You must be signed in to change notification settings - Fork 8
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
Make nimble component lint and test run concurrently #2065
Conversation
@@ -0,0 +1,7 @@ | |||
{ |
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.
@mollykreis would you mind buddying this 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.
@mollykreis I'm gonna merge this PR so we can get some runtime on it but will address concerns in a follow-up
"pack": "npm run pack --workspaces --if-present", | ||
"change": "beachball change", | ||
"check": "beachball check --changehint \"Run 'npm run change' to generate a change file\"", | ||
"invoke-publish": "cross-env-shell beachball publish --yes --access public --message \\\"applying package updates [skip ci]\\\" -n $NPM_SECRET_TOKEN", | ||
"validate": "npm run build && npm run lint && npm run test", |
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.
Intentionally removed, didn't think anyone really used it
"lint-concurrently": "npm run lint-concurrently -w packages/nimble-components", | ||
"test-concurrently": "npm run test-concurrently -w packages/nimble-components", |
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.
Why do these two commands specific list the nimble-components package instead of using the --if-present
flag?
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's an intentional break from the pattern but I can see how it's being masked / not clear from the naming.
The sequential commands are fast and can afford to stack more on, the concurrent ones all need to start concurrently.
If we add a new concurrent command using --if-present
it'll run the concurrent commands sequentially., i.e:
seqA -> seqB -> seqC -> end
concA -> concB -> concC -> end
Instead we want:
seqA -> seqB -> seqC -> end
concA -> end
concB -> end
concC -> end
I have a proposal that will make that more explicit (i.e. we specifically want components to run in parallel) in a follow-up PR.
Pull Request
🤨 Rationale
Investigating locally I found that by far the nimble-components lint steps (both eslint and prettier) as well as the karma runs (chrome and firefox) are the slowest to run. Updated the concurrent run so that the component commands run in parallel from the start along with synchronous test and lint runs of every other package.
With this change the following commands all start at the same time:
And can see in the following table that the last to finish are the components commands:
In the end this ends up shaving off only about 2-3 minutes from the CI. I suspect we are probably at the point of diminishing returns for concurrent execution.
👩💻 Implementation
npm run concurrently-lint-test
🧪 Testing
Tested locally and CI.
✅ Checklist