Files
ComfyUI_frontend/.github/workflows/ci-tests-e2e-coverage.yaml
bymyself e36a5cd1fc feat: add V8 code coverage collection for Playwright E2E tests
Adds infrastructure to collect V8 JavaScript code coverage during Playwright
E2E test runs and generate lcov/html reports.

Architecture:
- Custom page fixture in ComfyPage.ts starts V8 JS coverage before each test
  and stops it after, fetching source text for network-loaded scripts
- @bgotink/playwright-coverage reporter (v0.3.2) processes V8 coverage data
  into Istanbul format, generating lcov and text-summary reports
- pnpm patch on the reporter fixes two issues:
  1. Adds filesystem fallback for sourcemap loading — when HTTP fetch fails
     in the worker thread, reads .map files from dist/ on disk
  2. Rewrites Vite sourcemap source paths from build-output-relative
     (../../src/foo.ts) to project-relative (src/foo.ts) so they aren't
     excluded by the library's path validation

CI workflow (ci-tests-e2e-coverage.yaml):
- Runs on PRs and pushes to main/core/*
- 60-minute timeout, 2 workers, chromium project
- Uploads coverage/playwright/ as artifact for downstream reporting

Results: 96.1% line coverage, 68.1% branch coverage, 60.9% function coverage
across 1,221 source files.
2026-04-07 13:24:58 -07:00

65 lines
1.5 KiB
YAML

name: 'CI: E2E Coverage'
on:
push:
branches: [main, core/*]
paths-ignore: ['**/*.md']
pull_request:
branches-ignore: [wip/*, draft/*, temp/*]
paths-ignore: ['**/*.md']
concurrency:
group: e2e-coverage-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
collect:
if: github.repository == 'Comfy-Org/ComfyUI_frontend'
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.16
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
packages: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup frontend
uses: ./.github/actions/setup-frontend
with:
include_build_step: true
- name: Start ComfyUI server
uses: ./.github/actions/start-comfyui-server
- name: Run Playwright tests with coverage
id: tests
continue-on-error: true
run: >
COLLECT_COVERAGE=true
pnpm exec playwright test
--project=chromium
--workers=2
env:
PLAYWRIGHT_BLOB_OUTPUT_DIR: ./blob-report
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v6
with:
name: e2e-coverage
path: coverage/playwright/
retention-days: 30
if-no-files-found: warn