fix(tests): use blue_started_at for Waiting column (updated_at doesn't exist)
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
updated_at column does not exist in the tests table — it was always undefined, so formatElapsed() always returned '—'. Replace with blue_started_at (set when Red Team submits to Blue Team), which correctly shows how long a test has been waiting for Blue Team evaluation. Also fixed the waiting_time sort to use the same field.
This commit is contained in:
@@ -231,13 +231,14 @@ export default function TestsPage() {
|
||||
const aIsBlue = a.state === "blue_evaluating";
|
||||
const bIsBlue = b.state === "blue_evaluating";
|
||||
if (aIsBlue && bIsBlue) {
|
||||
av = a.updated_at || "";
|
||||
bv = b.updated_at || "";
|
||||
// Older blue_started_at = waited longer = sort first in asc
|
||||
av = (a as any).blue_started_at || a.created_at || "";
|
||||
bv = (b as any).blue_started_at || b.created_at || "";
|
||||
} else {
|
||||
if (aIsBlue && !bIsBlue) return sortDir === "asc" ? -1 : 1;
|
||||
if (!aIsBlue && bIsBlue) return sortDir === "asc" ? 1 : -1;
|
||||
av = a.updated_at || "";
|
||||
bv = b.updated_at || "";
|
||||
av = (a as any).blue_started_at || a.created_at || "";
|
||||
bv = (b as any).blue_started_at || b.created_at || "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -579,11 +580,11 @@ export default function TestsPage() {
|
||||
<td className="py-3 px-4 text-gray-400 text-xs">
|
||||
{test.platform || "-"}
|
||||
</td>
|
||||
{/* Waiting time — meaningful for blue_evaluating */}
|
||||
{/* Waiting time — how long since Red submitted to Blue */}
|
||||
<td className="py-3 px-4 text-xs whitespace-nowrap">
|
||||
{test.state === "blue_evaluating" ? (
|
||||
<span className="font-mono text-indigo-400">
|
||||
{formatElapsed(test.updated_at)}
|
||||
{formatElapsed(test.blue_started_at)}
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-gray-700">—</span>
|
||||
|
||||
Reference in New Issue
Block a user