Skip to content

Commit 8d9ce83

Browse files
pcarletonclaude
andcommitted
Count warnings as failures in overall test result
Warnings now contribute to the overall failure status, causing the test to exit with code 1 when any warnings are present. Also displays warning checks in the output summary, similar to how failures are displayed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b0b4e24 commit 8d9ce83

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/runner/client.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,13 @@ export function printClientResults(
166166
const failed = checks.filter((c) => c.status === 'FAILURE').length;
167167
const warnings = checks.filter((c) => c.status === 'WARNING').length;
168168

169-
// Determine if there's an overall failure (client timeout or exit failure)
169+
// Determine if there's an overall failure (failures, warnings, client timeout, or exit failure)
170170
const clientTimedOut = clientOutput?.timedOut ?? false;
171171
const clientExitedWithError = clientOutput
172172
? clientOutput.exitCode !== 0
173173
: false;
174-
const overallFailure = failed > 0 || clientTimedOut || clientExitedWithError;
174+
const overallFailure =
175+
failed > 0 || warnings > 0 || clientTimedOut || clientExitedWithError;
175176

176177
if (verbose) {
177178
// Verbose mode: JSON goes to stdout for piping to jq/jless
@@ -209,6 +210,18 @@ export function printClientResults(
209210
});
210211
}
211212

213+
if (warnings > 0) {
214+
console.error('\nWarning Checks:');
215+
checks
216+
.filter((c) => c.status === 'WARNING')
217+
.forEach((c) => {
218+
console.error(` - ${c.name}: ${c.description}`);
219+
if (c.errorMessage) {
220+
console.error(` Warning: ${c.errorMessage}`);
221+
}
222+
});
223+
}
224+
212225
if (overallFailure) {
213226
console.error('\n❌ OVERALL: FAILED');
214227
} else {

0 commit comments

Comments
 (0)