{"record":{"id":"a46d60b47e53d8b2","repo":"karatelabs/karate","slug":"dry-run-nothing-was-executed","errorCode":null,"errorMessage":"DRY RUN — nothing was executed","messagePattern":"DRY RUN — nothing was executed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"karate-core/src/main/java/io/karatelabs/core/SuiteResult.java","lineNumber":320,"sourceCode":"        int featurePassed = getFeaturePassedCount();\n        int featureFailed = getFeatureFailedCount();\n        // a dry run cannot fail (nothing runs) and its skips count as passed — printing \"all passed\" for it\n        // would report a green for a suite that never touched the system under test\n        String featureStatus = featureFailed > 0\n                ? Console.fail(featureFailed + \" failed\")\n                : dryRun ? Console.warn(\"parsed only\") : Console.pass(\"all passed\");\n\n        Console.println(String.format(\"features: %4d | passed: %4d | %s\",\n                featureTotal, featurePassed, featureStatus));\n\n        // Scenario stats\n        int scenarioTotal = getScenarioCount();\n        int scenarioPassed = getScenarioPassedCount();\n        int scenarioFailed = getScenarioFailedCount();\n        int scenarioSkipped = getScenarioSkippedCount();\n        String scenarioStatus = scenarioFailed > 0\n                ? Console.fail(scenarioFailed + \" failed\")\n                : dryRun ? Console.warn(\"DRY RUN — nothing was executed\") : Console.pass(\"all passed\");\n\n        if (scenarioSkipped > 0) {\n            Console.println(String.format(\"scenarios: %3d | passed: %4d | skipped: %4d | %s\",\n                    scenarioTotal, scenarioPassed, scenarioSkipped, scenarioStatus));\n        } else {\n            Console.println(String.format(\"scenarios: %3d | passed: %4d | %s\",\n                    scenarioTotal, scenarioPassed, scenarioStatus));\n        }\n\n        // Footer with version, env, and HTML report (URL last for easy clicking)\n        Console.println(Console.cyan(\"-\".repeat(60)));\n        StringBuilder footer = new StringBuilder(\"Karate \" + Globals.KARATE_VERSION);\n        if (env != null && !env.isEmpty()) {\n            footer.append(\" | env: \").append(Console.cyan(env));\n        }\n        if (reportUrl != null) {\n            footer.append(\" | HTML report:\");\n            Console.println(footer.toString());","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/core/SuiteResult.java#L302-L338","documentation":"Like error 827, this is a status string, not an error: in SuiteResult.printSummary(), when a dry run completes with no scenario failures, the scenarios line prints 'DRY RUN — nothing was executed' instead of 'all passed', so nobody mistakes a dry run for a real green suite.","triggerScenarios":"Suite finished as a dry run (dryRun flag on Runner/Suite) and printSummary is called with scenarioFailed == 0; skipped scenarios counted as passed by design.","commonSituations":"Verifying feature files parse and tag filters resolve before a real run; a CI pipeline that intended real tests but the dry-run option stayed enabled in shared setup code.","solutions":["Set dryRun(false) (or drop the flag) to actually execute scenarios","Use the dry-run output deliberately as a pre-flight check before the real run in the pipeline","Surface the summary status in CI logs so a 'DRY RUN' line is visible to reviewers"],"exampleFix":"// before\n// CI step: mvn test -Dkarate.dryRun=true  (always)\n// after: separate preflight and real steps\n// mvn test -Dkarate.dryRun=true   # preflight parse check\n// mvn test                        # real execution","handlingStrategy":"validation","validationCode":"SuiteResult r = Runner.path(\"classpath:features\").outputHtmlReport(true).parallel(2); // no .dryRun(true)\nif (r.getScenarioCount() == 0) throw new AssertionError(\"no scenarios executed\");","typeGuard":"function ranForReal(res){ return !res.isDryRun() && res.getScenarioCount() > 0; }","tryCatchPattern":null,"preventionTips":["Search your runner setup for dryRun(true) left over from debugging","Gate releases on runs whose summary says 'all passed', not 'DRY RUN'","Make dry-run a separate, clearly named pipeline step","Assert executed-scenario counts in CI to catch silently skipped runs"],"tags":["dry-run","console-output","summary"],"backgroundTag":"dry-run-mode","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}