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

Tests fail when using Corepack v0.25.0 jumper binary #377

Closed
merceyz opened this issue Feb 20, 2024 · 2 comments · Fixed by #392
Closed

Tests fail when using Corepack v0.25.0 jumper binary #377

merceyz opened this issue Feb 20, 2024 · 2 comments · Fixed by #392

Comments

@merceyz
Copy link
Member

merceyz commented Feb 20, 2024

The tests in this repo fails when v0.25.0 is installed globally.

Output from one of the tests:

$ NOCK_ENV="replay" CI=true yarn test up
FAIL tests/Up.test.ts
  UpCommand
    ✕ should upgrade the package manager from the current project (460 ms)

  ● UpCommand › should upgrade the package manager from the current project

    expect(received).resolves.toMatchObject(expected)

    - Expected  - 1
    + Received  + 4

      Object {
        "exitCode": 0,
    -   "stderr": "",
    +   "stderr": "Corepack is about to download https://registry.npmjs.org/yarn.
    + Corepack is about to download https://repo.yarnpkg.com/tags.
    + Corepack is about to download https://repo.yarnpkg.com/2.4.3/packages/yarnpkg-cli/bin/yarn.js.
    + ",
      }

      18 |       });
      19 |
    > 20 |       await expect(runCli(cwd, [`up`])).resolves.toMatchObject({
         |                                                  ^
      21 |         exitCode: 0,
      22 |         stderr: ``,
      23 |       });

      at Object.toMatchObject (../../../.yarn/berry/cache/expect-npm-29.7.0-62e9f7979e-10c0.zip/node_modules/expect/build/index.js:174:22)
      at toMatchObject (tests/Up.test.ts:20:50)
      at NodeFS.mktempPromise (../../../.yarn/berry/cache/@yarnpkg-fslib-npm-3.0.1-df63ac76ba-10c0.zip/node_modules/@yarnpkg/fslib/lib/xfs.js:86:24)
      at Object.<anonymous> (tests/Up.test.ts:15:5)

Reproduction steps:

docker run --rm -it --network host node:20.11.1 bash

mkdir -p /root/.cache/node/corepack
npm install -g corepack@0.25.1
corepack enable

git clone --depth=1 https://github.com/nodejs/corepack
cd corepack
yarn
yarn build
NOCK_ENV="replay" CI=true yarn test up
@aduh95
Copy link
Contributor

aduh95 commented Feb 21, 2024

That doesn't make sense to me, I don't see how the global Corepack version would be relevant in this context 🤔

@aduh95
Copy link
Contributor

aduh95 commented Feb 21, 2024

Note that it doesn't reproduce with the following:

docker run --rm -it --network host node:20.11.1 bash

mkdir -p /root/.cache/node/corepack
npm install -g corepack@0.25.1
alias yarn="corepack yarn"

git clone --depth=1 https://github.com/nodejs/corepack
cd corepack
yarn
yarn build
NOCK_ENV="replay" CI=true yarn test up

@aduh95 aduh95 changed the title Tests fail when Corepack v0.25.0 is installed globally Tests fail when using Corepack v0.25.0 jumper binary Feb 21, 2024
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 a pull request may close this issue.

2 participants