Skip to content

Commit 41b7641

Browse files
committed
update
1 parent 2773978 commit 41b7641

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

.github/workflows/chat-perf.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ jobs:
368368
with:
369369
pattern: perf-results-*
370370
path: perf-results
371-
merge-multiple: true
372371

373372
- name: Download leak results
374373
if: inputs.skip_leak_check != true && needs.leak-check.result != 'skipped'
@@ -431,21 +430,25 @@ jobs:
431430
run: |
432431
mkdir -p collected
433432
434-
# Collect perf logs from all groups
435-
find perf-results -name 'perf-output.log' -exec cp {} collected/ \; 2>/dev/null || true
433+
# Collect perf logs from all groups (preserve group name to avoid overwrite)
434+
for f in perf-results/perf-results-*/perf-output.log; do
435+
GROUP=$(basename "$(dirname "$f")")
436+
cp "$f" "collected/perf-output-${GROUP}.log" 2>/dev/null || true
437+
done
436438
cp leak-results/leak-output.log collected/ 2>/dev/null || true
437439
438-
# Zip all .chat-simulation-data directories
440+
# Zip .chat-simulation-data from each group
439441
if [[ -d perf-results ]]; then
440-
find perf-results -type d -name '20*' | head -5 | while read -r RUN_DIR; do
441-
GROUP_NAME=$(basename "$(dirname "$RUN_DIR")")
442-
cd "$(dirname "$RUN_DIR")"
443-
zip -r "$OLDPWD/collected/chat-perf-${GROUP_NAME}.zip" \
444-
"$(basename "$RUN_DIR")"/ \
445-
ci-summary.md \
446-
baseline-*.json \
447-
2>/dev/null || true
448-
cd "$OLDPWD"
442+
for GROUP_DIR in perf-results/perf-results-*; do
443+
GROUP=$(basename "$GROUP_DIR")
444+
SIM_DIR="$GROUP_DIR/.chat-simulation-data"
445+
if [[ -d "$SIM_DIR" ]]; then
446+
cd "$SIM_DIR"
447+
zip -r "$OLDPWD/collected/chat-perf-${GROUP}.zip" \
448+
. \
449+
2>/dev/null || true
450+
cd "$OLDPWD"
451+
fi
449452
done
450453
fi
451454

scripts/chat-simulation/test-chat-perf-regression.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ function parseMetricThreshold(raw) {
132132
/**
133133
* Get the regression threshold for a specific metric.
134134
* Uses per-metric override from config if available, otherwise the global threshold.
135-
* @param {ReturnType<typeof parseArgs>} opts
135+
* @param {{ threshold: number, metricThresholds?: Record<string, number | string> }} opts
136136
* @param {string} metric
137137
* @returns {MetricThreshold}
138138
*/
139139
function getMetricThreshold(opts, metric) {
140-
const raw = opts.metricThresholds[metric];
140+
const raw = opts.metricThresholds?.[metric];
141141
if (raw !== undefined) {
142142
return parseMetricThreshold(raw);
143143
}
@@ -748,7 +748,7 @@ function formatCompareLink(base, test) {
748748
*
749749
* @param {Record<string, any>} jsonReport
750750
* @param {Record<string, any> | null} baseline
751-
* @param {{ threshold: number, metricThresholds: Record<string, number | string>, runs: number, baselineBuild?: string, build?: string }} opts
751+
* @param {{ threshold: number, metricThresholds?: Record<string, number | string>, runs: number, baselineBuild?: string, build?: string }} opts
752752
*/
753753
function generateCISummary(jsonReport, baseline, opts) {
754754
const baseLabel = opts.baselineBuild || 'baseline';
@@ -1354,7 +1354,7 @@ async function main() {
13541354
/**
13551355
* Print baseline comparison and exit with code 1 if regressions found.
13561356
* @param {Record<string, any>} jsonReport
1357-
* @param {{ baseline?: string, threshold: number, ci?: boolean, runs?: number, baselineBuild?: string, build?: string, resume?: string }} opts
1357+
* @param {{ baseline?: string, threshold: number, ci?: boolean, runs?: number, baselineBuild?: string, build?: string, resume?: string, metricThresholds?: Record<string, number | string> }} opts
13581358
*/
13591359
async function printComparison(jsonReport, opts) {
13601360
let regressionFound = false;

0 commit comments

Comments
 (0)