bahmutov / bahmutov/cypress-split-example
Error: Do not know how to determine the correct split using AWS CodeBuild
- Dominant language
- JavaScript
- Stars
- 12
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
## Research Done:
Using your existing [**GitLab CI example**](https://gitlab.com/bahmutov/cypress-split-gitlab-example), I have tried to mimic this in AWS CodeBuild project as follows:
### Created CodeBuild buildspec file:
Using reference from [**cypress-realworld-app**](https://github.com/cypress-io/cypress-realworld-app/blob/develop/buildspec.yml):
```
version: 0.2
batch:
fast-fail: false
build-matrix:
dynamic:
env:
compute-type:
- BUILD_GENERAL1_MEDIUM
WORKERS:
- 1
- 2
phases:
install:
commands:
- yarn install --frozen-lockfile
build:
commands:
- npx @bahmutov/print-env CI_
- npx cypress run --env split=true
```
### Updated `Cypress.config.ts` as follows:
```
import { defineConfig } from 'cypress';
import cypressSplit from 'cypress-split'
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
specPattern: 'cypress/e2e/**/*.cy.ts',
testIsolation: true,
setupNodeEvents(on, config) {
cypressSplit(on, config)
// IMPORTANT: return the config object
return config
},
},
```
### Error after executed Cypress headless mode:
```
Error: Do not know how to determine the correct split
--
676 | at cypressSplit (/codebuild/output/src/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/cypress-split-gitlab-example/node_modules/cypress-split/src/index.js:78:13)
677 | at setupNodeEvents (file:///codebuild/output/src/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/cypress-split-gitlab-example/cypress.config.ts:10:13)
678 | at /root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:122:14
679 | at tryCatcher (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23)
680 | at Promise.attempt.Promise.try (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/bluebird/js/release/method.js:39:29)
681 | at RunPlugins.load (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:119:9)
682 | at RunPlugins.runSetupNodeEvents (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:59:17)
683 | at EventEmitter. (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:185:22)
684 | at EventEmitter.emit (node:events:514:28)
685 | at process. (/root/.cache/Cypress/13.3.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)
686 | at process.emit (node:events:514:28)
687 | at emit (node:internal/child_process:951:14)
688 | at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
```
## Question:
Q1. How to use this package with AWS Codebuild?
Q2. In `.gitlab-ci.yml` there is flag `parallel: 3` being used! Where to place this flag in AWS CodeBuild buildspec file?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.