feat: add privacy-preserving telemetry and error aggregation

- Update smoke-test.mjs to output structured summary with logs
- Update telemetry-aggregator.mjs to collect from unit, smoke, and load tests
- Update run-unit-tests.mjs to log output to artifacts/test_unit.log
- Ensure PII sanitization in telemetry reports
This commit is contained in:
google-labs-jules[bot] committed 2026-01-26 06:48:14 +00:00
1 parent 87c494c1f3
commit edbd66df52
3 files changed
+92 -6

No files matched your search

+16 -1
View File
@@ -1,5 +1,6 @@
import { spawn } from "node:child_process";
import { readdir, readFile } from "node:fs/promises";
import fs from "node:fs";
import { fileURLToPath } from "node:url";
import path from "node:path";
@@ -101,14 +102,28 @@ async function run() {
return;
}
const logFile = path.join(rootDir, "artifacts", "test_unit.log");
if (!fs.existsSync(path.dirname(logFile))) {
fs.mkdirSync(path.dirname(logFile), { recursive: true });
}
const logStream = fs.createWriteStream(logFile);
for (const testFile of selectedTests) {
const relativePath = path.relative(rootDir, testFile);
console.log(`\n→ Running ${relativePath}`);
logStream.write(`\n→ Running ${relativePath}\n`);
await new Promise((resolve, reject) => {
const child = spawn(process.execPath, ["--import", setupImport.href, testFile], {
stdio: "inherit",
stdio: ["inherit", "pipe", "pipe"],
});
child.stdout.pipe(process.stdout, { end: false });
child.stdout.pipe(logStream, { end: false });
child.stderr.pipe(process.stderr, { end: false });
child.stderr.pipe(logStream, { end: false });
let finished = false;
let timeoutId = null;