cypress-io / circleci-orb

Install, cache and run Cypress.io tests on CircleCI with minimal configuration.

Home Page:https://circleci.com/orbs/registry/orb/cypress-io/cypress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding parallelism triggers error: package.json not found

MelMacaluso opened this issue · comments

The orb does not work as expected

  • what version of the orb are you currently using?
    cypress-io/cypress@1.29.0
  • paste the circle.yml file if possible or at least the relevant portion
workflows:
  version: 2
  'Build, test and deploy':
    jobs:
      - cypress/run:
          executor: cypress/base-12
          yarn: true
          build: yarn build:dev
          start: yarn start:dev
          wait-on: 'http://localhost:3004'
          store_artifacts: true
          command: yarn cypress run --spec 'cypress/integration/**/*spec.js'
          parallel: true
          parallelism: 2
          group: 2 machines
      - unit-test
      - build_and_deploy_dev:
          requires:
            - unit-test
            - cypress/run
          filters:
            branches:
              only:
                - master
      - hold:
          type: approval
          requires:
            - build_and_deploy_dev
      - build_and_deploy_prod:
          requires:
            - hold
  • describe what you think should happen
    I would be able to now leverage parallelism in circleci.
  • describe what happens
    Despite the parallelism is recognised now in the circleci ui, it now starts to not find the package.json anymore, that's cause by only editing those 3 lines in the config.yml...here's an example of the failed cypress/run :

image

You'll need to run cypress/install before running cypress/run like so:

- cypress/install
- cypress/run:
    requires:
      - cypress/install
    parallel: true
    parallelism: 4

I have the same problem even with the cypress/install 😕

@MelMacaluso I finally found a workaround by adding this to cypress/run job:

pre-steps:
  - checkout
commented

@MelMacaluso is this still an issue for you?

@MelMacaluso is this still an issue for you?

We had to change it like:

workflows:
  version: 2
  'Build, test and deploy':
    jobs:
      - cypress/install:
          executor: node-executor
          yarn: true
          build: yarn build:dev
      - cypress/run:
          requires:
            - cypress/install
          executor: node-executor
          record: true
          parallel: true
          parallelism: 7
          start: yarn start:dev
          group: 'all ui-order-v2 tests'
          wait-on: 'http://localhost:3004'
          store_artifacts: true
          command: yarn cypress run --record --parallel

Closing as resolved, but I might also suggest trying out v 3.0.0 of our orb as it should simplify your orb file quite a bit.