-
Notifications
You must be signed in to change notification settings - Fork 672
ci(perf): preserve main-branch baselines #15466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import { readFileSync } from 'node:fs' | ||
|
|
||
| import { describe, expect, it } from 'vitest' | ||
|
|
||
| import config from '../playwright.config' | ||
|
|
||
| const workflowPath = '.github/workflows/ci-perf-report.yaml' | ||
| const performanceSpecPath = 'browser_tests/tests/performance.spec.ts' | ||
|
|
||
| function workflowStep(name: string): string { | ||
| const lines = readFileSync(workflowPath, 'utf8').split(/\r?\n/) | ||
| const heading = `- name: ${name}` | ||
| const startIndex = lines.findIndex((line) => line.trimEnd().endsWith(heading)) | ||
| expect(startIndex, `missing workflow step ${name}`).toBeGreaterThanOrEqual(0) | ||
|
|
||
| const indent = lines[startIndex].length - lines[startIndex].trimStart().length | ||
| const nextStep = new RegExp(`^\\s{${indent}}- `) | ||
| const endIndex = lines | ||
| .slice(startIndex + 1) | ||
| .findIndex((line) => nextStep.test(line)) | ||
| return lines | ||
| .slice(startIndex, endIndex === -1 ? undefined : startIndex + 1 + endIndex) | ||
| .join('\n') | ||
| } | ||
|
|
||
| describe('performance baseline reporting', () => { | ||
| it('quarantines the flaky subgraph transition without excluding other perf tests', () => { | ||
| const project = config.projects?.find( | ||
| (entry) => entry.name === 'performance' | ||
| ) | ||
| const spec = readFileSync(performanceSpecPath, 'utf8') | ||
|
|
||
| expect(project?.grep?.source).toContain('@perf') | ||
| expect(project?.grepInvert?.source).toContain('@perf-quarantine') | ||
|
Comment on lines
+33
to
+34
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect the declared Playwright version and any installed declarations.
fd -HI '^(package\.json|pnpm-lock\.yaml|test\.d\.ts)$' . | while IFS= read -r file; do
if rg -q '"`@playwright/test`"|grepInvert|grep:' "$file"; then
echo "== $file =="
rg -n -C 2 '"`@playwright/test`"|grepInvert|grep:' "$file"
fi
doneRepository: Comfy-Org/ComfyUI_frontend Length of output: 5389 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== scripts/perfReporting.test.ts =="
cat -n scripts/perfReporting.test.ts
echo "== related performance-report tests and configuration =="
rg -n -C 3 "perfReporting|`@perf`|`@perf-quarantine`|grepInvert|grep:" \
scripts package.json pnpm-workspace.yaml playwright.config.* .github 2>/dev/null || true
echo "== relevant guidance =="
for file in .agents/checks/test-quality.md docs/testing/README.md docs/guidance/vitest.md docs/testing/vitest-patterns.md docs/guidance/typescript.md; do
if [ -f "$file" ]; then
echo "--- $file"
cat "$file"
fi
doneRepository: Comfy-Org/ComfyUI_frontend Length of output: 26690 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== playwright.config.ts =="
cat -n playwright.config.ts | sed -n '1,120p'
echo "== package scripts and TypeScript configuration =="
python3 - <<'PY'
import json
from pathlib import Path
for name in ("package.json", "tsconfig.json", "tsconfig.app.json", "tsconfig.node.json"):
p = Path(name)
if p.exists():
print(f"--- {name}")
print(p.read_text())
PY
echo "== Playwright defineConfig declarations =="
rg -n -A 35 -B 8 "function defineConfig|const defineConfig|defineConfig<" \
node_modules/.pnpm/playwright@*/node_modules/playwright/types/test.d.ts \
node_modules/.pnpm/@playwright+test@*/node_modules/@playwright/test/index.d.ts 2>/dev/null | head -n 240Repository: Comfy-Org/ComfyUI_frontend Length of output: 26210 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== scripts TypeScript project =="
if [ -f scripts/tsconfig.json ]; then
cat scripts/tsconfig.json
fi
echo "== Playwright project and filter type declarations =="
rg -n -A 12 -B 8 \
"interface.*Project|type.*Project|projects\\??:|grep\\??: RegExp|grepInvert\\??: RegExp" \
node_modules/.pnpm/playwright@1.61.1/node_modules/playwright/types/test.d.ts | head -n 260
echo "== references to the performance reporting test =="
rg -n -C 3 "perfReporting\.test|typecheck:scripts|scripts/tsconfig" \
.github package.json scripts vitest.config.ts 2>/dev/null || trueRepository: Comfy-Org/ComfyUI_frontend Length of output: 11073 Normalize Playwright types 🤖 Prompt for AI AgentsSources: Coding guidelines, Path instructions |
||
| expect(spec).toContain("{ tag: ['@vue-nodes', '@perf-quarantine'] }") | ||
| }) | ||
|
|
||
| it('persists completed main-branch measurements instead of requiring every test to pass', () => { | ||
| const runStep = workflowStep('Run performance tests') | ||
| const saveStep = workflowStep('Save perf baseline to perf-data branch') | ||
|
|
||
| expect(runStep).toContain('continue-on-error: true') | ||
| expect(saveStep).not.toContain('continue-on-error: true') | ||
| expect(saveStep).not.toContain("steps.perf.outcome == 'success'") | ||
| expect(saveStep).toContain('!cancelled()') | ||
| expect(saveStep).toContain('test -s test-results/perf-metrics.json') | ||
| expect(saveStep).toContain('report.measurements?.length ?? 0') | ||
| expect(saveStep).toContain( | ||
| 'refusing to skip the main-branch baseline update' | ||
| ) | ||
| }) | ||
|
Comment on lines
+38
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift Test workflow outcomes instead of command text. These assertions only check for YAML fragments. They do not verify that a failed benchmark with completed metrics saves a baseline, that cancellation skips the save, or that missing and empty reports fail the job. Extract the report-validation decision into a testable command or helper. Test valid measurements, partial benchmark failure, cancellation, missing reports, and empty measurements. As per path instructions, “Performance-report tests should verify observable behavior rather than implementation details or mock calls” and must cover those cases. 🤖 Prompt for AI AgentsSource: Path instructions |
||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Require
measurementsto be an array before saving the baseline.The current check accepts any value with a non-zero
length. For example, a string or{ "length": 1 }passes and is copied intoperf-data. Validate the report schema before treating it as completed measurements.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents