mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +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
@@ -38,7 +38,7 @@ import http from 'http';
|
||||
|
||||
const ARTIFACTS_DIR = 'artifacts';
|
||||
const LOG_FILE = path.join(ARTIFACTS_DIR, `smoke-${new Date().toISOString().split('T')[0].replace(/-/g, '')}.log`);
|
||||
const REPORT_FILE = path.join(ARTIFACTS_DIR, 'smoke-report.json');
|
||||
const REPORT_FILE = path.join(ARTIFACTS_DIR, `smoke-summary-${new Date().toISOString().replace(/[:.]/g, '-')}.json`);
|
||||
const UI_SCREENSHOT = path.join(ARTIFACTS_DIR, 'smoke-ui.png');
|
||||
|
||||
if (!fs.existsSync(ARTIFACTS_DIR)) {
|
||||
@@ -285,12 +285,16 @@ async function runSmokeTest() {
|
||||
|
||||
} catch (error) {
|
||||
log(`Smoke Test Failed: ${error.stack}`, 'ERROR');
|
||||
summary.status = "FAIL";
|
||||
summary.status = "failure";
|
||||
summary.error = error.message;
|
||||
exitCode = 1;
|
||||
} finally {
|
||||
// --- Write Report ---
|
||||
try {
|
||||
if (fs.existsSync(LOG_FILE)) {
|
||||
const logs = fs.readFileSync(LOG_FILE, 'utf8').split('\n').filter(Boolean);
|
||||
summary.logs = logs;
|
||||
}
|
||||
fs.writeFileSync(REPORT_FILE, JSON.stringify(summary, null, 2));
|
||||
log(`Summary written to ${REPORT_FILE}`);
|
||||
} catch (e) {
|
||||
|
||||
Reference in new issue
Block a user