Commit 91e21741 authored by Felix Freiberger's avatar Felix Freiberger
Browse files

Added (internal) stats about TestTickAudit results.

parent c58bb0af
Pipeline #23492 passed with stages
in 1 minute and 44 seconds
......@@ -60,6 +60,21 @@ const LeaderboardPage: React.FC<{}> = () => {
const notavailableTd = <td className="td-center"></td>;
const groupUp = <T,>(values: T[]): { value: T, count: number }[] => Array.from(new Set(values)).map((value) => ({ value, count: values.filter((v) => v === value).length })).sort((a, b) => b.count - a.count);
const tickAuditStats = data && data.testResults ? (
groupUp(Object.keys(data.testResults).map((projectName) => {
if (!data.testResults) throw new Error("👻");
const testResult = data.testResults[projectName];
if (testResult.error) return null;
const auditResult = testResult.result.tests["com.pseuco.np20.tests.secret.TestTickAudit"];
if (!auditResult) return null;
const auditCase = auditResult.cases["testTickFormulaRadius3Time3"];
if (!auditCase.failure) return "OK";
return auditCase.failure.message;
}).filter((e) => e))
) : null;
return (
<Container className="leaderboard-page pad-top">
{ fetchError === null ? null : <Alert variant="warning">Failed to fetch data.</Alert> }
......@@ -398,6 +413,25 @@ const LeaderboardPage: React.FC<{}> = () => {
</div> }
{ data && data.private ? <div>
<h1>Private Data</h1>
<details>
<summary>TestTickAudit statistics (based on <code>testTickFormulaRadius3Time3</code>)</summary>
<Table striped hover variant="dark">
<thead>
<tr>
<th>#</th>
<th>Status</th>
</tr>
</thead>
{ tickAuditStats ? tickAuditStats.map(({ value, count }, i) => <tr key={i}>
<td>
{ count }
</td>
<td>
<code>{ value }</code>
</td>
</tr>) : <span>not available</span> }
</Table>
</details>
<details>
<summary>Complete JSON report</summary>
<pre>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment