feat: add WP5-06 and WP5-07 lineage evidence
Dada P0-A isolated Windows CI / validate-and-package (push) Failing after 1m49s
Dada P0-A isolated Windows CI / validate-and-package (push) Failing after 1m49s
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { execFileSync, spawnSync } from 'node:child_process';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const runId = process.env.DADA_TDD_RUN_ID ?? `wp5-07-green-${new Date().toISOString().replace(/[^0-9]/g, '')}`;
|
||||
const testId = 'TDD-WP5-07-PREVIEW-001-grant-lifecycle';
|
||||
const runDirectory = path.resolve('artifacts', 'tdd', runId, 'cases', testId);
|
||||
fs.mkdirSync(runDirectory, { recursive: true });
|
||||
const command = ['exec', 'vitest', 'run', 'tests/api/wp5-07-preview-grants.test.ts'];
|
||||
const executable = process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm';
|
||||
const result = spawnSync(executable, command, { encoding: 'utf8', shell: process.platform === 'win32' });
|
||||
const status = result.status === 0 ? 'passed' : 'failed';
|
||||
const evidence = {
|
||||
schema_version: '1.0', task_id: 'TASK-WP5-07', test_id: testId, run_id: runId,
|
||||
phase: 'green', status, command: 'pnpm exec vitest run tests/api/wp5-07-preview-grants.test.ts',
|
||||
commit: execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim(),
|
||||
exit_code: result.status ?? 1,
|
||||
redaction: 'stdout/stderr intentionally excluded',
|
||||
};
|
||||
fs.writeFileSync(path.join(runDirectory, 'evidence.json'), `${JSON.stringify(evidence, null, 2)}\n`);
|
||||
console.log(JSON.stringify(evidence));
|
||||
process.exitCode = status === 'passed' ? 0 : 1;
|
||||
Reference in New Issue
Block a user