Repository navigation
Conversation
…etection `checkly test` and `checkly pw-test` exited 0 when nothing matched, so a typo in a file filter passed silently in CI. Both now take --[no-]fail-on-no-matching (default on), like `trigger` and `checks run`. The two raw process.exit calls are gone: cancelling `checkly init` throws an oclif ExitError(0), and a second Ctrl+C during a run re-raises SIGINT to the listeners that were in place before the run. The default reporter now follows detectCliMode() instead of ci-info's isCI, and detectOperator() folds in ci-info so vendors that set no CI variable (Jenkins, TeamCity, CodeBuild) still count as CI. BREAKING CHANGE: `checkly test` and `checkly pw-test` exit 1 when no checks match. Pass --no-fail-on-no-matching to keep the old exit 0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Affected Components
What
Three small fixes to how the CLI ends a run and how it decides it is in CI.
1. "No checks found" passed silently.
checkly testandcheckly pw-testprinted "Unable to find checks to run" and then exited 0. A typo in a file filter, or a Playwright config that matches nothing, turned a CI job green while testing nothing.checkly triggerandcheckly checks runalready fail in that case.2. Two raw
process.exitcalls. Both stopped the process in the middle of a command:checkly initprompt calledprocess.exit(0)from inside the prompt library.process.exit(1), skipping the signal handlers registered before the run.3. Two ways to detect CI that disagreed. The default reporter used
ci-info'sisCI, while everything else (thex-checkly-sourceheader, confirmations, prompts, skills) useddetectCliMode(). For an agent inside GitHub Actions, or withCHECKLY_CLI_MODEset, the two gave different answers.Fix
testandpw-testtake--[no-]fail-on-no-matching, on by default and identical to the flag ontriggerandchecks run. When nothing matches they set exit code 1.makeOnCancelthrowsErrors.ExitError(0), which oclif turns into a clean exit 0 with output flushed.when-exit) get to clean up.detectCliMode()is the single source of truth.detectOperator()now also checksci-info'sisCI, so CI vendors that set noCIvariable (Jenkins, TeamCity, CodeBuild) are still detected, andCI=falsenow means "not CI". The default reporter islistin interactive mode andciotherwise.trigger.tsused its own copy ofprepareReportersTypes; it now uses the shared one.Breaking / behaviour changes
checkly testandcheckly pw-testexit 1 when no checks match. Pass--no-fail-on-no-matchingfor the old behaviour. This is why the title has!.checkly test --listwith no matches also exits 1, because the no-checks branch runs before--list.cimode instead ofinteractive. For example,checkly deploywithout--forcethere now prints the JSON preview and exits 2, where before it showed a prompt nobody could answer.cireporter by default instead oflist.Notes for the Reviewer
ci-inforeads the environment once at import, so any spec that calls the realdetectOperator()must mock it. Without the mock, threeapi.spec.tstests fail only in CI.cli-mode.spec.tsandapi.spec.tsnow mock it, and the full unit suite passes both normally and withCI=true GITHUB_ACTIONS=true.CHECKLY_CLI_MODE=interactive, so in GitHub Actions e2e now gets thelistreporter, the same one local e2e runs always used. A new e2e case runs--reporter ciexplicitly so that reporter keeps end-to-end coverage.test --listwith no matches stay at exit 0, since it is a query rather than a run?Testing
cli-mode.spec.tscovers a CI vendor with noCIvariable andCI=false.test-helper.spec.tscovers the default reporter in ci/agent mode.abstract-check-runner.spec.tsasserts the second SIGINT is re-raised rather thanprocess.exit. A newprompts-helpers.spec.tscovers the cancel exit.test.spec.ts): no matching checks now expects exit 1,--no-fail-on-no-matchingexpects exit 0, plus a new--reporter cicase. Not run locally (needs the e2e account); this draft is open to run them.pnpm lint,tsc --noEmitand the full unit suite (227 files) pass locally and under simulated CI env.No new commands, so no backend/API dependency. Help output gains
--[no-]fail-on-no-matchingontestandpw-test.🤖 Generated with Claude Code