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

Cypress AWS codebuild error: spec must be a string or comma-separated list #570

Open
tcetin opened this issue Oct 16, 2022 · 0 comments
Open

Comments

@tcetin
Copy link

tcetin commented Oct 16, 2022

I am trying to run tests parallelly in AWS. I created the configuration file like this real app build spec file.

So my cypress command gives this error:

Opening Cypress...
Cypress encountered an error while parsing the argument: --spec

You passed: true

The error was: spec must be a string or comma-separated list

My problem is the environments that I use during the cypress command are getting as empty.

  - echo $CY_GROUP_SPEC
  - CY_GROUP=$(echo $CY_GROUP_SPEC | cut -d'|' -f1)
  - CY_BROWSER=$(echo $CY_GROUP_SPEC | cut -d'|' -f2)
  - CY_SPEC=$(echo $CY_GROUP_SPEC | cut -d'|' -f3)
  - CY_CONFIG=$(echo $CY_GROUP_SPEC | cut -d'|' -f4)

I use this command to run cypress:

  • NO_COLOR=1 ./node_modules/.bin/cypress run --browser $CY_BROWSER --spec "$CY_SPEC" --config "$CY_CONFIG" --headless. --record --key $CYPRESS_KEY --parallel --ci-build-id $CODEBUILD_INITIATOR --group "$CY_GROUP"

I defined these env variables like this on the top of the file:

batch:
  build-matrix:
      dynamic:
        env:
          image:
              - ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/cypress:latest
          variables:
            CY_GROUP_SPEC:
              - "UI - Chrome|chrome|cypress/e2e/account/*"
              - "UI - Chrome|chrome|cypress/e2e/auth/*"
              - "UI - Chrome|chrome|cypress/e2e/mastering/*"
              - "UI - Chrome|chrome|cypress/e2e/pages/**/*"
              - "UI - Chrome|chrome|cypress/e2e/user-flows/**/*"
            WORKERS:
              - 1
              - 2
              - 3
              - 4
              - 5

I use Cypress 10.3.0 version.

So basically, the configuration is the same with this example build spec file.

How can I solve this issue?

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

No branches or pull requests

1 participant