circleci-orb icon indicating copy to clipboard operation
circleci-orb copied to clipboard

Adding parallelism triggers error: package.json not found

Open MelMacaluso opened this issue 4 years ago • 3 comments

The orb does not work as expected

  • what version of the orb are you currently using? cypress-io/[email protected]
  • 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

MelMacaluso avatar Aug 23 '21 12:08 MelMacaluso

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

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

vcantu avatar Mar 14 '22 23:03 vcantu

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

kevinpainchaud avatar Jul 26 '22 09:07 kevinpainchaud

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

pre-steps:
  - checkout

kevinpainchaud avatar Jul 29 '22 06:07 kevinpainchaud

@MelMacaluso is this still an issue for you?

jordanpowell88 avatar Dec 20 '22 20:12 jordanpowell88

@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

MelMacaluso avatar Dec 20 '22 23:12 MelMacaluso

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.

jennifer-shehane avatar Mar 01 '23 15:03 jennifer-shehane