Repository navigation
chore: faster twake-mui unit tests and npm cache in CI - #220
Merged
Merged
Conversation
npm test ran vitest run --project unit, which still loads vitest.config.ts and its storybook, argos and playwright plugins (about 1 s of startup the unit tests never use). The unit project now lives in vitest.unit.config.ts: npm test runs it alone, vitest.config.ts lists it next to the storybook project, so npm run screenshots is unchanged. The unit project also stops isolating test files: re-importing MUI for each of the 17 files cost more than the tests. They pass in any order (shuffled runs, 1 and 4 workers). Same 17 files and 123 tests; locally (4 CPU) 4.3 s -> 2.3 s, median of 3 runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setup-node only restores the npm cache when the package manager is set in package.json; ask for it, so npm ci reuses the tarballs downloaded by previous runs, as the Argos workflow already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
unitvitest project of twake-mui into its ownvitest.unit.config.ts.npm testnow runs it alone.vitest run --project unitstill loadedvitest.config.ts, along with the storybook, argos and playwright plugins that the unit tests never use.vitest.config.tslists the new file next to the storybook project, sonpm run screenshotsis unchanged.actions/setup-nodeto cache npm downloads (cache: 'npm') in the three CI/CD jobs, asargos.ymlalready does. Todaynpm citakes 17–44 s.Measures
Docker container with 4 CPU and 16 GB, like
ubuntu-latest. Median of 3 paired runs ofnpm test --workspace=@linagora/twake-mui:The npm cache gain will show from the second run onwards, once a cache entry exists for the lockfile.
Test plan
npm run lint,npm run lint:fmt,npm run buildnpm test: same 17 files and 123 tests, also with shuffled file ordervitest list --project storybookstill finds the stories throughvitest.config.ts🤖 Generated with Claude Code