Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/dashboard/src/components/RunList.mobile.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function runMeta(overrides: Partial<RunMeta> = {}): RunMeta {
}

describe('buildRunListItemView', () => {
it('deducts execution errors from quality totals for both table and mobile views', () => {
it('keeps displayed totals distinct from quality totals when execution errors are present', () => {
const view = buildRunListItemView(
runMeta({
execution_error_count: 2,
Expand All @@ -27,6 +27,7 @@ describe('buildRunListItemView', () => {
);

expect(view.errors).toBe(2);
expect(view.totalCount).toBe(10);
expect(view.qualityCount).toBe(8);
expect(view.passedCount).toBe(6);
expect(view.failedCount).toBe(2);
Expand Down
15 changes: 8 additions & 7 deletions apps/dashboard/src/components/RunList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Displays all available runs with a pass/fail status dot, human-readable name,
* a per-run "on remote" indicator (whether the run is backed up to the
* configured results branch), date, quality test count, execution-error count,
* configured results branch), date, total test count, execution-error count,
* and coloured pass-rate pill. Clicking a row navigates to the run detail view.
*
* On phone-width viewports the rows collapse to dense cards so right-side table
Expand Down Expand Up @@ -73,6 +73,7 @@ interface RunListItemView {
label: string;
display: RunDisplay;
errors: number;
totalCount: number;
qualityCount: number;
passing: boolean;
passedCount: number;
Expand Down Expand Up @@ -108,6 +109,7 @@ export function buildRunListItemView(run: RunMeta, passThreshold: number): RunLi
const display = formatRunDisplay(run, { includePassRate: false });
const label = display.label;
const errors = executionErrorCount(run);
const totalCount = run.test_count;
const qualityCount = Math.max(0, run.test_count - errors);
const passing = qualityCount > 0 ? run.pass_rate >= passThreshold : errors === 0;
const passedCount = Math.round(run.pass_rate * qualityCount);
Expand All @@ -127,6 +129,7 @@ export function buildRunListItemView(run: RunMeta, passThreshold: number): RunLi
label,
display,
errors,
totalCount,
qualityCount,
passing,
passedCount,
Expand Down Expand Up @@ -431,7 +434,7 @@ export function RunList({
label,
display,
errors,
qualityCount,
totalCount,
passedCount,
failedCount,
experimentNamespace,
Expand Down Expand Up @@ -495,7 +498,7 @@ export function RunList({
<PassRatePill rate={run.pass_rate} />
</MobileRunMetric>
<MobileRunMetric label="Total" valueClassName="text-gray-300">
{qualityCount}
{totalCount}
</MobileRunMetric>
<MobileRunMetric label="Passed" valueClassName="text-emerald-300">
{passedCount}
Expand Down Expand Up @@ -548,7 +551,7 @@ export function RunList({
label,
display,
errors,
qualityCount,
totalCount,
passedCount,
failedCount,
experimentNamespace,
Expand Down Expand Up @@ -637,9 +640,7 @@ export function RunList({
<span className="text-gray-600">0</span>
)}
</td>
<td className="px-4 py-3 text-right tabular-nums text-gray-400">
{qualityCount}
</td>
<td className="px-4 py-3 text-right tabular-nums text-gray-400">{totalCount}</td>

{/* Pass rate pill */}
<td className="px-4 py-3">
Expand Down
Loading