diff --git a/packages/cli/src/constructs/check-group.ts b/packages/cli/src/constructs/check-group.ts index 0b8b1026..0c2f5d16 100644 --- a/packages/cli/src/constructs/check-group.ts +++ b/packages/cli/src/constructs/check-group.ts @@ -107,6 +107,11 @@ export interface CheckGroupProps { * Sets a retry policy for the group. Use RetryStrategyBuilder to create a retry policy. */ retryStrategy?: RetryStrategy + /** + * Determines whether the checks in the group should run on all selected locations in parallel or round-robin. + * See https://www.checklyhq.com/docs/monitoring/global-locations/ to learn more about scheduling strategies. + */ + runParallel?: boolean } /** @@ -135,6 +140,7 @@ export class CheckGroup extends Construct { browserChecks?: BrowserCheckConfig multiStepChecks?: MultiStepCheckConfig retryStrategy?: RetryStrategy + runParallel?: boolean static readonly __checklyType = 'check-group' @@ -173,6 +179,7 @@ export class CheckGroup extends Construct { this.localSetupScript = props.localSetupScript this.localTearDownScript = props.localTearDownScript this.retryStrategy = props.retryStrategy + this.runParallel = props.runParallel // `browserChecks` is not a CheckGroup resource property. Not present in synthesize() this.browserChecks = props.browserChecks const fileAbsolutePath = Session.checkFileAbsolutePath! @@ -271,6 +278,7 @@ export class CheckGroup extends Construct { apiCheckDefaults: this.apiCheckDefaults, environmentVariables: this.environmentVariables, retryStrategy: this.retryStrategy, + runParallel: this.runParallel, } } } diff --git a/packages/cli/src/constructs/check.ts b/packages/cli/src/constructs/check.ts index 8dec2f2a..935e78ed 100644 --- a/packages/cli/src/constructs/check.ts +++ b/packages/cli/src/constructs/check.ts @@ -86,6 +86,11 @@ export interface CheckProps { * Sets a retry policy for the check. Use RetryStrategyBuilder to create a retry policy. */ retryStrategy?: RetryStrategy + /** + * Determines whether the check should run on all selected locations in parallel or round-robin. + * See https://www.checklyhq.com/docs/monitoring/global-locations/ to learn more about scheduling strategies. + */ + runParallel?: boolean } // This is an abstract class. It shouldn't be used directly. @@ -106,6 +111,7 @@ export abstract class Check extends Construct { alertChannels?: Array testOnly?: boolean retryStrategy?: RetryStrategy + runParallel?: boolean __checkFilePath?: string // internal variable to filter by check file name from the CLI static readonly __checklyType = 'check' @@ -142,6 +148,7 @@ export abstract class Check extends Construct { this.testOnly = props.testOnly ?? false this.retryStrategy = props.retryStrategy + this.runParallel = props.runParallel ?? false this.__checkFilePath = Session.checkFilePath } @@ -218,6 +225,7 @@ export abstract class Check extends Construct { groupId: this.groupId, environmentVariables: this.environmentVariables, retryStrategy: this.retryStrategy, + runParallel: this.runParallel, } } } diff --git a/packages/cli/src/services/checkly-config-loader.ts b/packages/cli/src/services/checkly-config-loader.ts index eafc2cd0..2cd0f73e 100644 --- a/packages/cli/src/services/checkly-config-loader.ts +++ b/packages/cli/src/services/checkly-config-loader.ts @@ -9,7 +9,7 @@ import { ReporterType } from '../reporters/reporter' export type CheckConfigDefaults = Pick + | 'alertChannels' | 'privateLocations' | 'retryStrategy' | 'runParallel'> export type ChecklyConfig = { /**