cypress-io / circleci-orb

Install, cache and run Cypress.io tests on CircleCI with minimal configuration.
https://circleci.com/orbs/registry/orb/cypress-io/cypress
MIT License
160 stars 101 forks source link

package manager:PNPM not supported in circleci orb #442

Open Petra-N opened 10 months ago

Petra-N commented 10 months ago

Hey all, Just wanted to ask, when will circleci orb support pnpm as well. Currently working on a project which is using pnpm, would like to run cypress in ci and it would be definitely easier if pnpm would be supported as well.

Thanks a lot! Petra

ramykl commented 10 months ago

Any update about this. This would be useful, or at least add more documentation around how to use this with pnpm

ramykl commented 10 months ago

PR to support this in the Node orb, and then we can add it here. https://github.com/CircleCI-Public/node-orb/pull/199

MikeMcC399 commented 7 months ago

See also https://circleci.com/developer/orbs/orb/cypress-io/cypress#usage-pnpm

LingVuDev commented 6 months ago

The error message still remains as the underlying node orb does not support pnpm in it's enum.

start-command: pnpm dev
install-command: pnpm install
package-manager: pnpm
Type error for argument pkg-manager: expected type: enum ("npm" "yarn" "yarn-berry"), actual value: "pnpm" (type string)
JuicyBenjamin commented 5 months ago

We are experiencing the same issue. Would be nice if looked at.

Screenshot 2024-04-15 at 14 33 13
pho3nixf1re commented 4 months ago

Is this simply a matter of adding pnpm to the enum or is there more that needs to be done? If so I can submit a PR today if we can get a release out quickly. This has become a big blocker for my team and I would like to have it resolved quickly if possible.

For others that may come along here in the future, can we bypass this limitation by using cypress/run-tests directly?

pho3nixf1re commented 4 months ago

I see now that this is actually an issue with the official node orb which does not support pnpm. Has anyone found a way around this issue?

mjameson commented 2 months ago

Running into the same issue, anyone have any updates on this?

MikeMcC399 commented 2 months ago

The documented Usage Examples > pnpm does not work:

version: '2.1'
orbs:
  cypress: cypress-io/cypress@3
workflows:
  use-my-orb:
    jobs:
      - cypress/run:
          install-command: pnpm install --frozen-lockfile
          package-manager: pnpm
          start-command: pnpm start

As previously posted in https://github.com/cypress-io/circleci-orb/issues/442#issuecomment-2056747396, it results in a CircleCI pipeline error message (reposted as text for better searchability):

Error calling workflow: 'use-my-orb'
Error calling job: 'cypress/run'
Error calling command: 'install'
Error calling command: 'node/install-packages'
Type error for argument pkg-manager: expected type: enum ("npm" "yarn" "yarn-berry"), actual value: "pnpm" (type string)
MikeMcC399 commented 2 months ago

Also, as previously mentioned in this thread, @ramykl submitted a PR https://github.com/CircleCI-Public/node-orb/pull/199 to add pnpm support to the circleci/node orb, however the only people responding to this PR are former CircleCI employees and the PR is otherwise stuck for the last 6 months or so.

MikeMcC399 commented 2 months ago

This is an example of using pnpm with the Cypress CircleCI Orb and Cypress Docker images:

version: 2.1
orbs:
  cypress: cypress-io/cypress@3
executors:
  cypress-browsers:
    docker:
      - image: cypress/browsers:node-20.15.1-chrome-126.0.6478.126-1-ff-128.0-edge-126.0.2592.102-1
jobs:
  pnpm-chrome-test:
    executor: cypress-browsers
    steps:
      - checkout
      - run: npm install -g pnpm@9
      - run: pnpm install --frozen-lockfile
      - cypress/run-tests:
          cypress-command: 'npx cypress run --browser chrome'
          start-command: pnpm start

workflows:
  test:
    jobs:
      - pnpm-chrome-test

The above example is not optimized for caching, however it does work.

The non-working example on https://circleci.com/developer/orbs/orb/cypress-io/cypress#usage-pnpm should be removed.

MikeMcC399 commented 1 month ago
ramykl commented 3 weeks ago

Revisited and PR made