0
votes

I'm currently using CircleCI to run my Cypress test suite against a single environment. The CircleCI config specifies the following:

docker:
      - image: cypress/base:10
    parallelism: 16
    steps:
      - *quick_attach
      - restore_cache:
          key: dependency-cache-{{ checksum "yarn.lock" }}-v2
      - run:
          name: Run Cypress Tests
          command: >
            CYPRESS_BRANCH=$CIRCLE_BRANCH
            CYPRESS_SOURCE=CircleCI
            CYPRESS_RECORD_KEY=$CYPRESS_RECORD_KEY
            /bin/bash ./scripts/cypress_run_circleci_all.sh

Inside cypress_run_circleci_all.sh, I have a hashmap and loop over it.

#!/bin/bash 
set -e

declare -A environments
environments[dev]="https://dev.mydomain.com"
environments[qa]="https://qa.mydomain.com"


##  loop through the all environments
for env_name in ${!environments[@]}
do
    TAGS="all-envs-test,${env_name}"
    CYPRESS_baseUrl=${environments[$env_name]} \
    yarn cypress:run:desktop --record \
    --group Desktop \
    --parallel \
    --tag \"$TAGS\" || true
    echo "sleeping 60s"
    sleep 60
done

Everything works as expected for the first environment, but the second environment always finishes very quickly. I'm guessing there's something about running multiple cypress commands as part of the parallel command that's breaking things, but I'm unsure what.

Any suggestions on what I'm doing wrong, and what I could do to acheive what I want (running cypress tests sequentially against multiple environments, with each run against an environment running in parallel).

1

1 Answers

1
votes

The Cypress Real World App is a payment application to demonstrate real-world usage of Cypress testing methods, patterns, and workflows. It contains a CircleCI config to run tests against Windows and Linux and uses the ci-build-id parameter for the Cypress CircleCI Orb to link the builds in the Cypress Dashboard