Benchmark: HTML-webbiraportit tuloksista

Standalone HTML-tiedosto joka sisältää:
- Yhteenvetokortit (keskiarvo, paras malli, nopein, testit)
- Mallikohtainen taulukko palkkikaavioilla
- Yksittäiset tulokset sortattavassa taulussa
- Dark mode, ei ulkoisia dependencyjä
This commit is contained in:
2026-04-14 08:27:01 +03:00
parent 02e3701d77
commit 868d116961
2 changed files with 178 additions and 2 deletions

View File

@@ -542,9 +542,18 @@ async function main() {
console.log(row);
}
// Tallenna JSON
// Tallenna JSON + HTML-raportti
writeFileSync(`${OUTPUT_DIR}/results.json`, JSON.stringify(results, null, 2));
console.log(`\nJSON: ${OUTPUT_DIR}/results.json`);
const templatePath = join(__dirname, 'report-template.html');
if (existsSync(templatePath)) {
const html = readFileSync(templatePath, 'utf-8').replace(
'/*DATA_PLACEHOLDER*/[]',
JSON.stringify(results)
);
writeFileSync(`${OUTPUT_DIR}/report.html`, html);
console.log(`\nRaportti: ${OUTPUT_DIR}/report.html`);
}
console.log(`JSON: ${OUTPUT_DIR}/results.json`);
// Yhteenveto
const passed = results.filter(r => !r.error && r.testsPassed === r.testsTotal && r.testsTotal > 0);