Skip to content

Commit

Permalink
feat(testing): add --ci-build-id option to cypress in order to make p…
Browse files Browse the repository at this point in the history
…arallel work for some ci (#2218)
  • Loading branch information
andrew-yangy authored and FrozenPandaz committed Dec 19, 2019
1 parent 8579894 commit 6ef95bd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/angular/api-cypress/builders/cypress.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Possible values: `electron`, `chrome`, `chromium`, `canary`

The browser to run tests in.

### ciBuildId

Type: `string`

A unique identifier for a run to enable grouping or parallelization.

### copyFiles

Type: `string`
Expand Down
6 changes: 6 additions & 0 deletions docs/react/api-cypress/builders/cypress.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ Possible values: `electron`, `chrome`, `chromium`, `canary`

The browser to run tests in.

### ciBuildId

Type: `string`

A unique identifier for a run to enable grouping or parallelization.

### copyFiles

Type: `string`
Expand Down
6 changes: 6 additions & 0 deletions docs/web/api-cypress/builders/cypress.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ Possible values: `electron`, `chrome`, `chromium`, `canary`

The browser to run tests in.

### ciBuildId

Type: `string`

A unique identifier for a run to enable grouping or parallelization.

### copyFiles

Type: `string`
Expand Down
9 changes: 7 additions & 2 deletions packages/cypress/src/builders/cypress/cypress.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface CypressBuilderOptions extends JsonObject {
env?: Record<string, string>;
spec?: string;
copyFiles?: string;
ciBuildId?: string;
}

try {
Expand Down Expand Up @@ -75,7 +76,8 @@ function run(
baseUrl,
options.browser,
options.env,
options.spec
options.spec,
options.ciBuildId
)
),
options.watch ? tap(noop) : take(1),
Expand Down Expand Up @@ -106,6 +108,7 @@ function run(
* @param browser
* @param env
* @param spec
* @param ciBuildId
*/
function initCypress(
cypressConfig: string,
Expand All @@ -118,7 +121,8 @@ function initCypress(
baseUrl: string,
browser?: string,
env?: Record<string, string>,
spec?: string
spec?: string,
ciBuildId?: string
): Observable<BuilderOutput> {
// Cypress expects the folder where a `cypress.json` is present
const projectFolderPath = dirname(cypressConfig);
Expand Down Expand Up @@ -147,6 +151,7 @@ function initCypress(
options.record = record;
options.key = key;
options.parallel = parallel;
options.ciBuildId = ciBuildId;

return fromPromise<any>(
!isWatching || headless ? Cypress.run(options) : Cypress.open(options)
Expand Down
4 changes: 4 additions & 0 deletions packages/cypress/src/builders/cypress/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
"type": "string",
"description": "DEPRECATED: A regex string that is used to choose what additional integration files to copy to the dist folder",
"x-deprecated": true
},
"ciBuildId": {
"type": "string",
"description": "A unique identifier for a run to enable grouping or parallelization."
}
},
"additionalProperties": false,
Expand Down

0 comments on commit 6ef95bd

Please sign in to comment.