test: make yarn tests agnostic of corepack defaults#8413
Conversation
|
@jeremylong Perhaps you can try this PR locally. If it's still not working, there is something else locally we're missing here:
|
|
For corepack I have: $ corepack --version
0.29.4
$ where corepack
/Users/jeremy/.nvm/versions/node/v18.20.5/bin/corepack
/opt/homebrew/bin/corepack
$ ls -l /opt/homebrew/bin/corepack
lrwxr-xr-x 1 jeremy admin 45 Dec 18 2024 /opt/homebrew/bin/corepack -> ../lib/node_modules/corepack/dist/corepack.js
$ ls -l /Users/jeremy/.nvm/versions/node/v18.20.5/bin/corepack
lrwxr-xr-x 1 jeremy staff 45 Nov 11 2024 /Users/jeremy/.nvm/versions/node/v18.20.5/bin/corepack -> ../lib/node_modules/corepack/dist/corepack.js |
|
I just re-ran this locally and received |
|
Using some more of my free amp credits - we found the problem:
I ran |
|
Ahh ok, fair enough, yeah. Thank you Amp! I'll modify this PR. (edit: done) I personally think the Yarn 1/Classic impl should be removed very soon anyway ( see #8423 - if you could express an opinion it'd be useful) Yarn 1/Classic is seemingly completely EOL and even the |
The tests will fail currently if ones default corepack-yarn version is not Yarn Classic (v1). Setting the package manager makes this explicit; although the tests still rely on having a corepack-based yarn installation. Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
Ensure that the dependency that needs to be resolved cannot already be cached by Yarn, and thus the lockfile must be consulted; even in offline mode. Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
5d2aa02 to
ae177eb
Compare
Description of Change
As noted in #8405 attempts to make tests agnostic of machine or npm-level corepack default yarn version.
The tests will fail currently if ones default corepack-yarn version is not Yarn Classic (v1). Setting the package manager makes this explicit; although the tests still rely on having a corepack-based yarn installation in order to switch between yarn versions.
Based on the comment below at #8413 (comment) they also fail if the dependency in the
package.jsonhappens to be in the local yarn cache, which we can fix by pointing to a non-existent dependency.Related issues
Have test cases been added to cover the new functionality?
yes