debug: log outputFolder + JSON files to docker logs; fix walker to use stat

- runner.js: console.log outputFolder, sitespeed INFO lines, and
  find output after test so everything appears in docker logs
- parser.js: switch walker from withFileTypes to stat (more reliable
  on Docker volumes); log every directory visited

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-07 11:05:05 +02:00
parent 59c2403f43
commit 19923f4369
2 changed files with 41 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
import { readdir, readFile } from 'fs/promises';
import { readdir, readFile, stat } from 'fs/promises';
import { join } from 'path';
/**
@@ -11,19 +11,22 @@ async function findPageSummaries(outputFolder) {
const errors = [];
async function walk(dir) {
let entries;
let names;
try {
entries = await readdir(dir, { withFileTypes: true });
names = await readdir(dir);
} catch (err) {
errors.push(`readdir failed on ${dir}: ${err.message}`);
errors.push(`readdir(${dir}): ${err.message}`);
return;
}
for (const e of entries) {
const full = join(dir, e.name);
if (e.isDirectory()) {
console.log(`[parser] walk ${dir} → [${names.join(', ')}]`);
for (const name of names) {
const full = join(dir, name);
let s;
try { s = await stat(full); } catch { continue; }
if (s.isDirectory()) {
await walk(full);
} else if (e.name.endsWith('.pageSummary.json')) {
const plugin = e.name.replace('.pageSummary.json', '');
} else if (name.endsWith('.pageSummary.json')) {
const plugin = name.replace('.pageSummary.json', '');
if (!summaries[plugin]) summaries[plugin] = [];
summaries[plugin].push(full);
console.log(`[parser] found: ${full}`);