seek-oss / sku

Front-end development toolkit
https://seek-oss.github.io/sku
MIT License
480 stars 35 forks source link

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

Closed askoufis closed 4 months ago

askoufis commented 4 months ago

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.

changeset-bot[bot] commented 4 months ago

⚠️ No Changeset found

Latest commit: c959f509a27ba2e74f449cf1346a8e35e495dbb3

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