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

Use GH Actions for parallelism rather than Yarn #1029

Merged
merged 3 commits into from
Dec 16, 2022
Merged

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Dec 16, 2022

yarn test is a multi-package command: it really runs yarn test for
each package in parallel using yarn workspaces foreach. This works
fine as long as all of the tests pass. But because this command produces
a lot of output, if tests fail for any package, it can be very difficult
to locate the failure. (The same goes for yarn validate:changelog.)

There are a few ways we could solve this when these commands are run
locally, but it's particularly a pain point when run on CI. For this
reason, this commit adjusts the GitHub Actions configuration so that we
use GitHub Actions instead of Yarn to run these commands in parallel
across the monorepo. This means that if tests fail for a particular
package, you only see output for that package and no other package.

@mcmire mcmire force-pushed the run-tests-individually branch 8 times, most recently from 581e249 to 6a56125 Compare December 16, 2022 19:52
@mcmire mcmire changed the title Run tests for each package individually in CI Use GH Actions for parallelism rather than Yarn Dec 16, 2022
`yarn test` is a multi-package command: it really runs `yarn test` for
each package in parallel using `yarn workspaces foreach`. This works
fine as long as all of the tests pass. But because this command produces
a lot of output, if tests fail for any package, it can be very difficult
to locate the failure. (The same goes for `yarn validate:changelog`.)

There are a few ways we could solve this when these commands are run
locally, but it's particularly a pain point when run on CI. For this
reason, this commit adjusts the GitHub Actions configuration so that we
use GitHub Actions instead of Yarn to run these commands in parallel
across the monorepo. This means that if tests fail for a particular
package, you only see output for that package and no other package.
@mcmire mcmire force-pushed the run-tests-individually branch from a868fc4 to 7c8adb2 Compare December 16, 2022 19:59
@mcmire
Copy link
Contributor Author

mcmire commented Dec 16, 2022

Here is a failing build so that you can see what it looks like when tests and/or changelog validation fails: https://github.com/MetaMask/controllers/actions/runs/3716135888 (some jobs are canceled because I pushed a new commit before this was fully finished, but you get the idea)

@Gudahtt
Copy link
Member

Gudahtt commented Dec 16, 2022

Nice. Good idea.

@mcmire mcmire marked this pull request as ready for review December 16, 2022 20:38
@mcmire mcmire requested a review from a team as a code owner December 16, 2022 20:38
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@mcmire mcmire merged commit bd80f0d into main Dec 16, 2022
@mcmire mcmire deleted the run-tests-individually branch December 16, 2022 21:04
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
`yarn test` is a multi-package command: it really runs `yarn test` for
each package in parallel using `yarn workspaces foreach`. This works
fine as long as all of the tests pass. But because this command produces
a lot of output, if tests fail for any package, it can be very difficult
to locate the failure. (The same goes for `yarn validate:changelog`.)

There are a few ways we could solve this when these commands are run
locally, but it's particularly a pain point when run on CI. For this
reason, this commit adjusts the GitHub Actions configuration so that we
use GitHub Actions instead of Yarn to run these commands in parallel
across the monorepo. This means that if tests fail for a particular
package, you only see output for that package and no other package.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
`yarn test` is a multi-package command: it really runs `yarn test` for
each package in parallel using `yarn workspaces foreach`. This works
fine as long as all of the tests pass. But because this command produces
a lot of output, if tests fail for any package, it can be very difficult
to locate the failure. (The same goes for `yarn validate:changelog`.)

There are a few ways we could solve this when these commands are run
locally, but it's particularly a pain point when run on CI. For this
reason, this commit adjusts the GitHub Actions configuration so that we
use GitHub Actions instead of Yarn to run these commands in parallel
across the monorepo. This means that if tests fail for a particular
package, you only see output for that package and no other package.
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