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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user