mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 10:22:25 +00:00
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:
1 parent
87c494c1f3
commit
edbd66df52
3 files changed
+92
-6
No files matched your search
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user