From 19ccd7b832070a190ec4306bce144feb52ba4e7f Mon Sep 17 00:00:00 2001 From: Miguel Langarano Date: Wed, 27 Sep 2023 00:08:34 -0500 Subject: [PATCH] feature: implement ci timeout pass flag --- CHANGELOG.md | 7 ++----- packages/cypress-cloud/bin/lib/program.ts | 3 ++- packages/cypress-cloud/lib/bootstrap/serializer.ts | 4 ++-- packages/cypress-cloud/lib/run.ts | 7 ++++--- packages/cypress-cloud/types.ts | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f470b22..b24fed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,8 @@ - - # [2.0.0-beta.1](https://github.com/currents-dev/cypress-cloud/compare/v2.0.0-beta.0...v2.0.0-beta.1) (2023-09-22) - ### Bug Fixes -* debugging fixes ([d502b12](https://github.com/currents-dev/cypress-cloud/commit/d502b121b4a5bb85921fa26b6b04a12274be3b19)) +- debugging fixes ([d502b12](https://github.com/currents-dev/cypress-cloud/commit/d502b121b4a5bb85921fa26b6b04a12274be3b19)) # [2.0.0-beta.0](https://github.com/currents-dev/cypress-cloud/compare/v1.10.0-beta.1...v2.0.0-beta.0) (2023-09-19) @@ -339,4 +336,4 @@ - implement generic http client with retries ([a9711bd](https://github.com/currents-dev/cypress-cloud/commit/a9711bde1fbb2cd37dbc8979593159d183bfa866)) - improve setup steps ([9bf16fe](https://github.com/currents-dev/cypress-cloud/commit/9bf16fe5f3773db4aa2f169515303ea6d0973da6)) - separate stdout per spec file ([a9d01c3](https://github.com/currents-dev/cypress-cloud/commit/a9d01c349cbfe140a568a452b0e7163e6d27f2db)) -- setup github actions ([d439f56](https://github.com/currents-dev/cypress-cloud/commit/d439f5660698177087fcc2e7a61c64ea263816f6)) \ No newline at end of file +- setup github actions ([d439f56](https://github.com/currents-dev/cypress-cloud/commit/d439f5660698177087fcc2e7a61c64ea263816f6)) diff --git a/packages/cypress-cloud/bin/lib/program.ts b/packages/cypress-cloud/bin/lib/program.ts index 6e309fa..1a4a526 100644 --- a/packages/cypress-cloud/bin/lib/program.ts +++ b/packages/cypress-cloud/bin/lib/program.ts @@ -129,7 +129,8 @@ ${getLegalNotice()} ) .default(undefined) .argParser((i) => (i === "false" ? false : true)) - ).addOption( + ) + .addOption( new Option( `--ci-timeout-pass [bool]`, `Enable ci runner to pass/fail but no error even if the run timed out` diff --git a/packages/cypress-cloud/lib/bootstrap/serializer.ts b/packages/cypress-cloud/lib/bootstrap/serializer.ts index 70355cf..0df27c5 100644 --- a/packages/cypress-cloud/lib/bootstrap/serializer.ts +++ b/packages/cypress-cloud/lib/bootstrap/serializer.ts @@ -66,8 +66,8 @@ function getCypressCLIParams( const testingType = result.testingType === "component" ? { - component: true, - } + component: true, + } : {}; return { ..._.omit(result, "testingType", "ciTimeoutPass"), diff --git a/packages/cypress-cloud/lib/run.ts b/packages/cypress-cloud/lib/run.ts index bd54c60..45e714d 100644 --- a/packages/cypress-cloud/lib/run.ts +++ b/packages/cypress-cloud/lib/run.ts @@ -64,7 +64,7 @@ export async function run(params: CurrentsRunParameters = {}) { batchSize, autoCancelAfterFailures, experimentalCoverageRecording, - ciTimeoutPass + ciTimeoutPass, } = validatedParams; const config = await getMergedConfig(validatedParams); @@ -88,7 +88,8 @@ export async function run(params: CurrentsRunParameters = {}) { info(`Cypress version: ${dim(_cypressVersion)}`); info("Discovered %d spec files", specs.length); info( - `Tags: ${tag.length > 0 ? tag.join(",") : false}; Group: ${group ?? false + `Tags: ${tag.length > 0 ? tag.join(",") : false}; Group: ${ + group ?? false }; Parallel: ${parallel ?? false}; Batch Size: ${batchSize}` ); info("Connecting to cloud orchestration service..."); @@ -109,7 +110,7 @@ export async function run(params: CurrentsRunParameters = {}) { batchSize, autoCancelAfterFailures, coverageEnabled: experimentalCoverageRecording, - ciTimeoutPass + ciTimeoutPass, }); setRunId(run.runId); diff --git a/packages/cypress-cloud/types.ts b/packages/cypress-cloud/types.ts index 6aa9cd5..e32a0b6 100644 --- a/packages/cypress-cloud/types.ts +++ b/packages/cypress-cloud/types.ts @@ -182,7 +182,7 @@ export type CurrentsRunParameters = StrippedCypressModuleAPIOptions & { // User-facing `run` interface // We can resolve the projectId and recordKey from different sources, so we can't really enforce them via the type definition -export interface CurrentsRunAPI extends CurrentsRunParameters { } +export interface CurrentsRunAPI extends CurrentsRunParameters {} // Params after validation and resolution export interface ValidatedCurrentsParameters extends CurrentsRunParameters {