Update scheduling algorithm

This commit is contained in:
2026-07-23 14:02:14 -04:00
parent 5eebee70d8
commit 23ae3a2f3a
12 changed files with 555 additions and 231 deletions
+17 -3
View File
@@ -5,7 +5,17 @@ export default function FailedBanner({ rerunTests, onDecision }) {
const hours = Math.floor(totalMinutes / 60)
const mins = totalMinutes % 60
const timeStr = hours > 0 ? `${hours}h ${mins}m` : `${mins}m`
const testIds = rerunTests.map(t => t.test_id).join(', ')
// Group test IDs by device
const byDevice = rerunTests.reduce((acc, t) => {
const device = t.device ?? 'Unknown'
if (!acc[device]) acc[device] = []
acc[device].push(t.test_id)
return acc
}, {})
const deviceSummaries = Object.entries(byDevice)
.sort(([a], [b]) => a.localeCompare(b))
.map(([device, ids]) => `${device}: ${ids.join(', ')}`)
return (
<div className="flex items-start gap-4 px-6 py-3 bg-red-900/70 border-b border-red-700 text-red-100">
@@ -26,9 +36,13 @@ export default function FailedBanner({ rerunTests, onDecision }) {
<div className="flex-1 min-w-0">
<p className="text-sm font-medium">
<span className="font-semibold">{rerunTests.length} test{rerunTests.length !== 1 ? 's' : ''}</span>
{' '}require a rerun not completed in last overnight window:{' '}
<span className="font-mono text-red-200">{testIds}</span>
{' '}require a rerun not completed in last overnight window:
</p>
{deviceSummaries.map((summary) => (
<p key={summary} className="text-sm font-mono text-red-200 mt-0.5 truncate">
{summary}
</p>
))}
<p className="text-sm text-red-300 mt-0.5">
Estimated rerun time: <span className="font-semibold text-red-100">{timeStr}</span>
{' '} Schedule rerun during daytime today?