Skip to content

Commit 6b92828

Browse files
MDA2AVclaude
andcommitted
Unscored tests are a separate bucket, never counted in pass/warn/fail
All counts now exclude unscored tests: pass, warn, fail only count scored tests. Unscored is always the fixed number of tests with scored=false. pass + warn + fail + unscored = total. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 72d8325 commit 6b92828

2 files changed

Lines changed: 40 additions & 26 deletions

File tree

.github/workflows/probe.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ jobs:
158158
'durationMs': r.get('durationMs', 0),
159159
})
160160
161-
scored_results = [r for r in results if r['scored'] and r['verdict'] != 'Warn']
162-
total = len(scored_results)
163-
passed = sum(1 for r in scored_results if r['verdict'] == 'Pass')
164-
warned = sum(1 for r in results if r['verdict'] == 'Warn')
165-
unscored = sum(1 for r in results if not r['scored'] and r['verdict'] != 'Warn')
161+
scored_results = [r for r in results if r['scored']]
162+
scored_pass = sum(1 for r in scored_results if r['verdict'] == 'Pass')
163+
scored_fail = sum(1 for r in scored_results if r['verdict'] == 'Fail')
164+
scored_warn = sum(1 for r in scored_results if r['verdict'] == 'Warn')
165+
unscored = sum(1 for r in results if not r['scored'])
166166
return {
167-
'summary': {'total': len(results), 'scored': total, 'passed': passed, 'failed': total - passed, 'warnings': warned, 'unscored': unscored},
167+
'summary': {'total': len(results), 'scored': len(scored_results), 'passed': scored_pass, 'failed': scored_fail, 'warnings': scored_warn, 'unscored': unscored},
168168
'results': results,
169169
}
170170

docs/static/probe/render.js

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,26 @@ window.ProbeRender = (function () {
231231
sorted.forEach(function (sv, i) {
232232
var s = sv.summary;
233233
var total = s.total || 1;
234-
var warnings = s.warnings || 0;
235-
var failed = s.failed || 0;
236-
var passPct = ((total - warnings - failed) / total) * 100;
237-
var warnPct = (warnings / total) * 100;
238-
var failPct = (failed / total) * 100;
234+
235+
// Compute counts from results — unscored tests are a separate bucket
236+
var unscored = 0, scoredPass = 0, scoredWarn = 0, scoredFail = 0;
237+
if (sv.results) {
238+
sv.results.forEach(function (r) {
239+
if (r.scored === false) { unscored++; return; }
240+
if (r.verdict === 'Pass') scoredPass++;
241+
else if (r.verdict === 'Warn') scoredWarn++;
242+
else if (r.verdict === 'Fail') scoredFail++;
243+
});
244+
} else {
245+
scoredPass = s.passed || 0;
246+
scoredFail = s.failed || 0;
247+
scoredWarn = s.warnings || 0;
248+
}
249+
250+
var passPct = (scoredPass / total) * 100;
251+
var warnPct = (scoredWarn / total) * 100;
252+
var failPct = (scoredFail / total) * 100;
253+
var unscoredPct = (unscored / total) * 100;
239254
var rank = i + 1;
240255

241256
html += '<div style="display:flex;align-items:center;gap:10px;">';
@@ -246,28 +261,27 @@ window.ProbeRender = (function () {
246261
var trackBg = document.documentElement.classList.contains('dark') ? '#2a2f38' : '#f0f0f0';
247262
html += '<div style="flex:1;height:22px;background:' + trackBg + ';border-radius:3px;overflow:hidden;display:flex;">';
248263
html += '<div style="height:100%;width:' + passPct + '%;background:' + PASS_BG + ';transition:width 0.3s;"></div>';
249-
if (warnings > 0) {
264+
if (scoredWarn > 0) {
250265
html += '<div style="height:100%;width:' + warnPct + '%;background:' + WARN_BG + ';transition:width 0.3s;"></div>';
251266
}
252-
if (failed > 0) {
267+
if (scoredFail > 0) {
253268
html += '<div style="height:100%;width:' + failPct + '%;background:' + FAIL_BG + ';transition:width 0.3s;"></div>';
254269
}
270+
if (unscored > 0) {
271+
html += '<div style="height:100%;width:' + unscoredPct + '%;background:' + SKIP_BG + ';transition:width 0.3s;"></div>';
272+
}
255273
html += '</div>';
256274
// Score: pass + warn [fail] [unscored] / total
257-
// Unscored excludes warns (already counted in warnings)
258-
var unscored = s.unscored != null ? s.unscored
259-
: sv.results ? sv.results.filter(function (r) { return r.scored === false && r.verdict !== 'Warn'; }).length
260-
: 0;
261275
html += '<div style="min-width:200px;text-align:right;font-size:13px;">';
262-
html += '<span style="font-weight:700;color:' + PASS_BG + ';">' + s.passed + '</span>';
263-
if (warnings > 0) {
264-
html += ' + <span style="font-weight:700;color:' + WARN_BG + ';">' + warnings + '</span>';
276+
html += '<span style="font-weight:700;color:' + PASS_BG + ';">' + scoredPass + '</span>';
277+
if (scoredWarn > 0) {
278+
html += ' + <span style="font-weight:700;color:' + WARN_BG + ';">' + scoredWarn + '</span>';
265279
}
266-
if (failed > 0) {
267-
html += ' <span style="color:' + FAIL_BG + ';">' + failed + ' fail</span>';
280+
if (scoredFail > 0) {
281+
html += ' <span style="color:' + FAIL_BG + ';">' + scoredFail + ' fail</span>';
268282
}
269283
if (unscored > 0) {
270-
html += ' <span style="color:#656d76;font-size:11px;">' + unscored + ' unscored</span>';
284+
html += ' <span style="color:' + SKIP_BG + ';">' + unscored + ' unscored</span>';
271285
}
272286
html += ' <span style="color:#656d76;font-size:12px;">/ ' + total + '</span>';
273287
html += '</div>';
@@ -500,9 +514,9 @@ window.ProbeRender = (function () {
500514
scored: scored.length,
501515
passed: scored.filter(function (r) { return r.verdict === 'Pass'; }).length,
502516
failed: scored.filter(function (r) { return r.verdict === 'Fail'; }).length,
503-
warnings: filtered.filter(function (r) { return r.verdict === 'Warn'; }).length,
504-
errors: filtered.filter(function (r) { return r.verdict === 'Error'; }).length,
505-
unscored: filtered.filter(function (r) { return r.scored === false && r.verdict !== 'Warn'; }).length
517+
warnings: scored.filter(function (r) { return r.verdict === 'Warn'; }).length,
518+
errors: scored.filter(function (r) { return r.verdict === 'Error'; }).length,
519+
unscored: filtered.filter(function (r) { return r.scored === false; }).length
506520
}
507521
};
508522
})

0 commit comments

Comments
 (0)