checkly test command executes all checks in your project on the Checkly cloud infrastructure. This command provides a dry-run capability for testing your monitoring setup before deployment, with support for different environments and configurations.
Prerequisites
Prerequisites
Before using
checkly test, ensure you have:- An initialized Checkly CLI project
- At least one check or resource defined in your project
- Valid Checkly account authentication (run
npx checkly loginif needed) - A
checkly.config.tsorcheckly.config.jsconfiguration file
Basic Usage
The basic command runs all checks in your project as a test run without deploying them to your account as monitors.Terminal
Command Options
string
The Checkly CLI configuration file. If not passed, uses the
checkly.config.ts|js file in the current directory.Usage:Terminal
boolean
default:"false"
Start the checks in the cloud and exit as soon as they’re scheduled. The CLI prints the test session ID and doesn’t wait for results. Get the results later with
checkly test-sessions get <test-session-id>. --detach can’t be combined with the json or github reporters.Usage:Terminal
string[]
Environment variables to be passed to the test run. Can be used multiple times.Usage:Examples:
Terminal
Terminal
string
Path to a dotenv file containing environment variables.Usage:
Terminal
boolean
default:"true"
Exit with a failing status code (Examples:
1) when there are no checks to run, for example because the file arguments, --grep or --tags filters match none. This keeps a typo in a filter from turning a CI job green without running anything.Usage:Terminal
Terminal
Available since CLI v10.0.0. Earlier versions always exit successfully when no checks match.
string
Only run checks where the check name matches a regular expression. Default:
.*Usage:Terminal
string
number
Stop waiting for the remaining checks once this many checks have failed (a whole number of 1 or more), and exit with a failing status code. Use it in CI to see a broken change fail early instead of waiting for the whole run. Overrides Examples:
cli.maxFailures in your Checkly config.Only a check’s final result counts toward the limit: a check that passes after a retry does not count, and neither does a degraded check. If the failure that reaches the limit is the last check to finish, the run completes normally.When the limit is reached, the CLI writes its reports, marks the remaining checks as not finished, and asks Checkly to cancel the test session. Queued API checks and uptime monitors are skipped and reported as cancelled, and running Playwright Check Suite runs are interrupted; other checks still run to completion in Checkly. The json reporter gives those checks "result": "Not finished" and adds a top-level "stoppedEarly": { "reason": "maxFailures", "maxFailures": <n> } field.Cannot be combined with --detach or --update-snapshots.Usage:Terminal
Terminal
string
The slug name of the private location to run checks at. Can’t be combined with Examples:
--location.Usage:Terminal
Terminal
string[]
Filter the checks to be run using a comma separated list of tags. Checks will only be run if they contain all of the specified tags. Multiple Examples:
--tags flags can be passed, in which case checks will be run if they match any of the --tags filters.Usage:Terminal
Terminal
boolean
List all checks to be run but don’t run them. The command exits successfully even when no checks match.Usage:
Terminal
string[]
One or more custom reporters for the test output. Options: Examples:
list, dot, ci, github, json.You can combine multiple reporters by passing multiple --reporter flags or using a comma-separated list. When no --reporter flag is provided, the CLI falls back to the cli.reporters array in checkly.config.ts, then defaults to ci when the CLI detects a CI environment or an AI agent, and to list otherwise. Set CHECKLY_CLI_MODE to interactive, ci or agent to override the detection.Usage:Terminal
Terminal
boolean
default:"true"
Record test results in Checkly as a test session with full logs, traces and videos. Recording is enabled by default; use Usage:
--no-record to disable it.Recording defaults to enabled since CLI v8.0.0. In earlier versions, recording was opt-in via
--record.Terminal
boolean
default:"false"
Force a fresh install of dependencies and update the cached version. Use this when you’ve changed your project’s dependencies and need Checkly to pick up the latest versions instead of using the cache from a previous run.Usage:
Terminal
number
How many times to retry a failing test run. Default: 0, max: 3A check that passes after one or more retries still counts as passed, but the output shows how many retries it needed, for example Examples:
(2 retries), and the summary counts it as flaky.Usage:Terminal
Terminal
string
A name to use when recording results in Checkly.Usage:
Terminal
number
default:"600"
A timeout (in seconds) to wait for each check to make progress once it starts running: report a retry attempt or its result. Checks that have not started yet get up to 900 additional seconds for server-side scheduling.The timer restarts whenever a check starts running and whenever it reports a failed attempt that will be retried, so a check that retries several times can take longer than this value in total. The timeout only ends the wait when a check stops reporting progress.Checkly can stagger the start of checks in large test sessions by up to 900 seconds. If a check still has not started within this value plus that allowance, the CLI reports that the check did not start. That usually means a problem on Checkly’s side: check the status page or contact support.When the CLI stops waiting for a check, whether it stopped making progress or never started, it reports the check as timed out rather than failed: the CLI did not receive a result, and the check may still run and pass in Checkly. Reporters mark it with ⏱ (
T in the dot reporter) and count it as timed out in the summary, and the json reporter gives it "result": "Timed out". The run still exits with code 1.Usage:Terminal
boolean
Update any snapshots using the actual result of this test run.Usage:
Terminal
Snapshots are essential for visual regression testing in Browser checks.
boolean
Always show the full logs of the checks.Usage:
Terminal
boolean
Return an error if checks import dependencies that are not supported by the selected runtime. Default: trueUsage:Runtime-dependent checks run in a specific runtime with a pre-defined set of dependencies. If you’re using private locations and want to provide your own dependencies, disable the built-in dependency validation.
Terminal
Examples
Dry run all your project checks and monitors:Terminal
product and api in the file name:
Terminal
Terminal
Terminal
process.env:
Terminal
Cancelling a run
Available in CLI v8.0.0+.
checkly test records a test session by default, so pressing Ctrl+C cancels it. Queued API checks and uptime monitors are skipped and reported as cancelled, and running Playwright Check Suite runs are interrupted; other checks finish normally. Runs started with --no-record cannot be cancelled.
The CLI keeps running after the first Ctrl+C to report the cancelled results. Press Ctrl+C again to exit immediately without waiting.
To start checks without waiting for them, use --detach. The CLI then exits as soon as the checks are scheduled, and the checks keep running in the cloud.
See Cancellation for the full flow.
Related Commands
checkly pw-test- Run Playwright tests in the Checkly cloudcheckly trigger- Run deployed checks on-demandcheckly deploy- Deploy your application