Skip to content

Commit 824d605

Browse files
committed
feat: store results per path prefix to avoid teams overwriting each other
1 parent e8efc29 commit 824d605

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/qa-run.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
cp tools/qa/results/latest.json /tmp/qa-results.json
9393
git checkout -- tools/qa/results/latest.json
9494
git pull --rebase origin ${{ github.ref_name }}
95-
cp /tmp/qa-results.json tools/qa/results/latest.json
96-
git add tools/qa/results/latest.json
95+
cp /tmp/qa-results.json "tools/qa/results${{ inputs.path_prefix }}/latest.json"
96+
git add tools/qa/results/
9797
git diff --staged --quiet || git commit -m "chore: update qa results [skip ci]"
9898
git push origin ${{ github.ref_name }}

tools/qa/summarize.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ try {
3232
} catch {
3333
summary.status = 'error';
3434
summary.error = 'Test run did not produce results';
35-
mkdirSync('results', { recursive: true });
36-
writeFileSync('results/latest.json', JSON.stringify(summary, null, 2));
37-
console.log('Summary written to results/latest.json (no test-results.json found)');
35+
const errDir = `results${summary.path_prefix}`;
36+
mkdirSync(errDir, { recursive: true });
37+
writeFileSync(`${errDir}/latest.json`, JSON.stringify(summary, null, 2));
38+
console.log(`Summary written to ${errDir}/latest.json (no test-results.json found)`);
3839
process.exit(0);
3940
}
4041

@@ -71,6 +72,7 @@ for (const suite of raw.suites || []) {
7172
}
7273
}
7374

74-
mkdirSync('results', { recursive: true });
75-
writeFileSync('results/latest.json', JSON.stringify(summary, null, 2));
76-
console.log('Summary written to results/latest.json');
75+
const outDir = `results${summary.path_prefix}`;
76+
mkdirSync(outDir, { recursive: true });
77+
writeFileSync(`${outDir}/latest.json`, JSON.stringify(summary, null, 2));
78+
console.log(`Summary written to ${outDir}/latest.json`);

0 commit comments

Comments
 (0)