October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

An Exit Code Cannot Say Whether Anything Happened

A green status reports what a command claims—not necessarily whether the intended tests ran. Runner rules, configuration, counts, and fresh artifacts reveal more.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A green check can mean only that a command finished without reporting failure. It does not, by itself, prove that the intended tests were selected, executed, or useful for the question you needed answered. To interpret a result, check the runner’s rules and the evidence from that specific run.

What an exit code tells you—and what it does not

An exit status is the command’s report of its outcome under that command’s own conventions. A zero status often indicates that the command did not report failure, but it is not a universal certificate that a test suite ran or that the intended scope was checked. As Seth Wheeler puts it in his article about didrun, “Exit code 0 means ‘I did not fail’”—a concise framing, not a formal definition that applies identically to every tool.

As an Amazon Associate I earn from qualifying purchases.

For a test check, separate four claims:

  • The process ran: the command started and returned a result.
  • The process did not report failure: its exit status was accepted as successful under its conventions.
  • Tests were collected and executed: the runner found tests and ran them, rather than finding none or skipping them.
  • The check produced relevant evidence: the tests covered the intended code or behavior, and the result reflects the question the check was meant to answer.

Each claim requires evidence. A successful process status cannot establish all four at once.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why a green result can mean different things across runners

There is no universal no-tests policy. These documented behaviors illustrate why you should inspect the runner, its configuration, and the command actually invoked—not infer meaning from a green status alone.

Runner Documented no-tests behavior What to check
pytest Its exit-code reference lists 0 when all tests are collected and pass, and 5 when no tests are collected. Confirm the intended tests were selected; a nonempty collection does not establish that the scope was adequate. pytest exit codes
Vitest passWithNoTests defaults to false. Enabling it allows Vitest not to fail when no tests are found. Review the effective configuration and CLI options, since they can change the meaning of a zero-test run. Vitest passWithNoTests configuration
Microsoft vstest By default, finding no matching tests or discovering no tests produces a warning and does not fail the run. RunConfiguration.TreatNoTestsAsError can make a zero-test run return 1. Check filters, discovery output, and whether TreatNoTestsAsError is set. Microsoft vstest command-line documentation

The examples are specific to the cited documentation. Versions, wrappers, plugins, filters, and configuration can affect behavior, so do not transfer one runner’s rule to another.

Collection is not the same as execution—or useful coverage

A runner may distinguish an empty collection from a passing run, yet a result can still leave important questions unanswered. Were tests skipped? Did a filter select only a subset? Did the selected tests exercise the code or behavior that matters? A positive collection count is useful evidence, not proof that the right tests ran.

Wheeler’s article uses an all-skipped pytest run to illustrate the gap between collection and execution. The pytest exit-code reference cited above documents the no-tests-collected status; it does not independently establish the outcome of that all-skipped example. Treat it as Wheeler’s illustration, not as an additional rule established by that reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Output matching can also mislead. A wrapper that looks only for a word such as “passed” may accept output that also says zero tests ran. Counts and selection details provide stronger evidence than a reassuring phrase alone.

Use evidence tied to the current run

When deciding whether a check did meaningful work, inspect its output and artifacts from that invocation. Wheeler’s article recommends positive counts, expected output, and checking whether a report was written or changed during the run. These are practical recommendations described in his article, not independently tested guarantees.

  • Look for counts: verify how many tests were collected, selected, executed, passed, failed, or skipped, as applicable. Set a meaningful minimum when the project’s expected test scope makes that possible.
  • Check selection: review filters, paths, tags, and discovery output so that a nonzero count corresponds to the intended tests.
  • Verify artifacts are fresh: an old report file already on disk is not evidence that the current command produced it. Tie the artifact to the invocation—for example, by checking that it was created or updated during that run.
  • Distinguish kinds of failure: an expected test failure is different from a syntax, setup, or infrastructure error. A useful check should make clear which occurred.
  • Treat interruption as incomplete: a timeout or interrupted process should not be interpreted as a successful completed check merely because some output or an earlier artifact exists.

Wheeler describes didrun as modeling four outcomes: ran-and-passed, ran-and-failed, did-not-run, and ran-and-failed-wrongly. His article says it requires at least one declared evidence predicate, such as matching output, parsing a count with a minimum, observing a file written during the run, or requiring a minimum duration. He characterizes duration as weak evidence and prefers a count. These are descriptions of didrun’s approach, not independent test results or an endorsement.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Examples that need attribution

Wheeler reports that go test ./... printed [no test files] while exiting with status 0, and that a wrapper invocation returned 3. Those are examples reported in his article; the documentation cited here does not independently verify Go’s behavior. Do not treat the example as a rule for every Go project or wrapper.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

He also reports that didrun’s tests caught six intentionally introduced mutations. That is an author-reported, project-specific result, not an independently verified study or an industry statistic.

How to make a CI check harder to misread

  1. Inspect the exact command and configuration. Include wrapper scripts, filters, environment settings, and runner options that affect discovery or no-test handling.
  2. Define what a valid run must show. Decide what counts as enough work: for example, a minimum test count or a required current-run report. Choose evidence appropriate to the check rather than relying on a generic success phrase.
  3. Make empty runs visible. Where supported, configure the runner to fail when no tests are found, or add a separate guard that checks the expected count. Do not assume the default matches your policy.
  4. Separate expected failures from broken checks. Ensure the result distinguishes a test detecting the problem under examination from a command that failed to start, parse, discover, or complete.
  5. Exercise the guard itself. Check what happens when the selected test set is empty and when the command fails for the wrong reason. A guard that has never been challenged with those cases may not be checking the condition you intended.

Read green as a status, then verify the evidence

A successful exit code is one useful signal, not proof that the intended work happened. Runner-specific no-tests rules tell you how an empty run is reported; counts, selection details, and fresh artifacts help establish what this invocation actually did. The key is to make the evidence behind a green result part of the check.

For the original discussion and didrun’s described model, see Seth Wheeler’s article.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.