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

feat(parallel): support runParallel in checks and groups [sc-18210] #900

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/cli/src/constructs/check-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ export interface CheckGroupProps {
* Sets a retry policy for the group. Use RetryStrategyBuilder to create a retry policy.
*/
retryStrategy?: RetryStrategy
/**
shiini2 marked this conversation as resolved.
Show resolved Hide resolved
* 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
}

/**
Expand Down Expand Up @@ -135,6 +140,7 @@ export class CheckGroup extends Construct {
browserChecks?: BrowserCheckConfig
multiStepChecks?: MultiStepCheckConfig
retryStrategy?: RetryStrategy
runParallel?: boolean

static readonly __checklyType = 'check-group'

Expand Down Expand Up @@ -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!
Expand Down Expand Up @@ -271,6 +278,7 @@ export class CheckGroup extends Construct {
apiCheckDefaults: this.apiCheckDefaults,
environmentVariables: this.environmentVariables,
retryStrategy: this.retryStrategy,
runParallel: this.runParallel,
}
}
}
8 changes: 8 additions & 0 deletions packages/cli/src/constructs/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -106,6 +111,7 @@ export abstract class Check extends Construct {
alertChannels?: Array<AlertChannel>
testOnly?: boolean
retryStrategy?: RetryStrategy
runParallel?: boolean
__checkFilePath?: string // internal variable to filter by check file name from the CLI

static readonly __checklyType = 'check'
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -218,6 +225,7 @@ export abstract class Check extends Construct {
groupId: this.groupId,
environmentVariables: this.environmentVariables,
retryStrategy: this.retryStrategy,
runParallel: this.runParallel,
}
}
}
2 changes: 1 addition & 1 deletion packages/cli/src/services/checkly-config-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ReporterType } from '../reporters/reporter'

export type CheckConfigDefaults = Pick<CheckProps, 'activated' | 'muted' | 'doubleCheck'
| 'shouldFail' | 'runtimeId' | 'locations' | 'tags' | 'frequency' | 'environmentVariables'
| 'alertChannels' | 'privateLocations' | 'retryStrategy'>
| 'alertChannels' | 'privateLocations' | 'retryStrategy' | 'runParallel'>

export type ChecklyConfig = {
/**
Expand Down
Loading