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

Ensure sku-init test does a thorough cleanup, run it separately to other tests #962

Merged
merged 2 commits into from May 8, 2024

Conversation

askoufis
Copy link
Contributor

@askoufis askoufis commented May 7, 2024

This fixes the same issue that #960 fixes, but now I have a better understanding of the problem, but still not an exact root cause. #960 will still be merged, but just as an update to pnpm v9.

Note

There are some hoisting changes in this PR, in addition to the fix. These were done as an attempt to fix the problem, but didn't actually do anything. I've left them in because they're still worth doing IMO.

The Problem

The sku-init test runs the sku CLI's init command. As part of sku init, the newly-created app has its dependencies installed. In the past, this has barely modified the lockfile, only adding an entry for the sku-init workspace package, and nothing else.

For some reason, potentially related to peer dependencies, a second @vanilla-extract/css package is now being installed during the sku-init test. This interferes with style loading in one of the braid-design-system tests, probably because the sku-init test tends to run before the braid-design-system suite in CI.

The result is master (and other branches) tests failing with this error.

The Fix

The sku-init test file no longer runs alongside all the other tests in the tests directory. Instead, it is run after all the other tests, so as not to affect them. Additionally, the test now runs a pnpm install after completion in order to undo any of the changes to the lockfile/node_modules it makes. This doesn't matter on CI, but it allows all tests to be run locally without interfering with one another.

@askoufis askoufis requested a review from a team as a code owner May 7, 2024 07:17
Copy link

changeset-bot bot commented May 7, 2024

⚠️ No Changeset found

Latest commit: c959f50

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@askoufis askoufis changed the title Ensure sku-init test does a thorough cleanup, run it separately to the rest of the tests Ensure sku-init test does a thorough cleanup, run it separately to other tests May 7, 2024
@@ -3,6 +3,7 @@ module.exports = {
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest',
},
maxWorkers: process.env.CI ? 2 : undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting this here as we can no longer pass the flag to pnpm test anymore because that script now runs multiple other scripts.

@askoufis askoufis merged commit e532c39 into master May 8, 2024
4 checks passed
@askoufis askoufis deleted the clean-up-init-test branch May 8, 2024 03:24
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.

None yet

2 participants