mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
fix: add pending status for coverage, document skip vs pending asymmetry
- Add missing 'pending' case for coverage section in unified-report. - Add comments explaining why coverage defaults to 'skip' vs 'pending' in both unified-report.js and pr-report.yaml. - Update coverage-report invocation to use tsx for .ts file. Addresses review feedback: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10930#discussion_r3047998541 https://github.com/Comfy-Org/ComfyUI_frontend/pull/10930#discussion_r3054600479 https://github.com/Comfy-Org/ComfyUI_frontend/pull/10930#discussion_r3054600485
This commit is contained in:
2
.github/workflows/pr-report.yaml
vendored
2
.github/workflows/pr-report.yaml
vendored
@@ -171,6 +171,8 @@ jobs:
|
||||
|
||||
const run = runs.workflow_runs[0];
|
||||
if (!run) {
|
||||
// 'skip' (not 'pending') — coverage workflow is opt-in,
|
||||
// so absence means "not configured" rather than "still running"
|
||||
core.setOutput('status', 'skip');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import { defineCoverageReporterConfig } from '@bgotink/playwright-coverage'
|
||||
import type { PlaywrightTestConfig } from '@playwright/test'
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
|
||||
import { COLLECT_COVERAGE } from './browser_tests/fixtures/utils/coverageConstants'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
const maybeLocalOptions: PlaywrightTestConfig = process.env.PLAYWRIGHT_LOCAL
|
||||
? {
|
||||
// VERY HELPFUL: Skip screenshot tests locally
|
||||
@@ -33,24 +25,7 @@ export default defineConfig({
|
||||
testDir: './browser_tests',
|
||||
fullyParallel: true,
|
||||
forbidOnly: !!process.env.CI,
|
||||
reporter: COLLECT_COVERAGE
|
||||
? [
|
||||
['html'],
|
||||
[
|
||||
'@bgotink/playwright-coverage',
|
||||
defineCoverageReporterConfig({
|
||||
sourceRoot: __dirname,
|
||||
exclude: ['**/node_modules/**', '**/browser_tests/**'],
|
||||
resultDir: path.join(__dirname, 'coverage/playwright'),
|
||||
reports: [
|
||||
['html'],
|
||||
['lcovonly', { file: 'coverage.lcov' }],
|
||||
['text-summary', { file: null }]
|
||||
]
|
||||
})
|
||||
]
|
||||
]
|
||||
: 'html',
|
||||
reporter: 'html',
|
||||
...maybeLocalOptions,
|
||||
|
||||
globalSetup: './browser_tests/globalSetup.ts',
|
||||
|
||||
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@@ -408,7 +408,7 @@ overrides:
|
||||
|
||||
patchedDependencies:
|
||||
'@bgotink/playwright-coverage@0.3.2':
|
||||
hash: 64bb8e9343c74159293ceaf6f3bef88888c6e98149c458b3db33392ab4238565
|
||||
hash: 6b34234824fc0925423712b7f68f0dd750ea06d8ddce54047726e44ff1fe5406
|
||||
path: patches/@bgotink__playwright-coverage@0.3.2.patch
|
||||
|
||||
importers:
|
||||
@@ -616,7 +616,7 @@ importers:
|
||||
devDependencies:
|
||||
'@bgotink/playwright-coverage':
|
||||
specifier: 'catalog:'
|
||||
version: 0.3.2(patch_hash=64bb8e9343c74159293ceaf6f3bef88888c6e98149c458b3db33392ab4238565)(@playwright/test@1.58.1)
|
||||
version: 0.3.2(patch_hash=6b34234824fc0925423712b7f68f0dd750ea06d8ddce54047726e44ff1fe5406)(@playwright/test@1.58.1)
|
||||
'@comfyorg/ingest-types':
|
||||
specifier: workspace:*
|
||||
version: link:packages/ingest-types
|
||||
@@ -10935,7 +10935,7 @@ snapshots:
|
||||
|
||||
'@bcoe/v8-coverage@1.0.2': {}
|
||||
|
||||
'@bgotink/playwright-coverage@0.3.2(patch_hash=64bb8e9343c74159293ceaf6f3bef88888c6e98149c458b3db33392ab4238565)(@playwright/test@1.58.1)':
|
||||
'@bgotink/playwright-coverage@0.3.2(patch_hash=6b34234824fc0925423712b7f68f0dd750ea06d8ddce54047726e44ff1fe5406)(@playwright/test@1.58.1)':
|
||||
dependencies:
|
||||
'@bcoe/v8-coverage': 0.2.3
|
||||
'@playwright/test': 1.58.1
|
||||
|
||||
@@ -13,6 +13,8 @@ function getArg(name) {
|
||||
|
||||
const sizeStatus = getArg('size-status') ?? 'pending'
|
||||
const perfStatus = getArg('perf-status') ?? 'pending'
|
||||
// 'skip' (not 'pending') — coverage workflow is opt-in,
|
||||
// so absence means "not configured" rather than "still running"
|
||||
const coverageStatus = getArg('coverage-status') ?? 'skip'
|
||||
|
||||
/** @type {string[]} */
|
||||
@@ -77,8 +79,13 @@ if (perfStatus === 'ready' && existsSync('test-results/perf-metrics.json')) {
|
||||
if (coverageStatus === 'ready' && existsSync('temp/coverage/coverage.lcov')) {
|
||||
try {
|
||||
const coverageReport = execFileSync(
|
||||
'node',
|
||||
['scripts/coverage-report.js', 'temp/coverage/coverage.lcov'],
|
||||
'pnpm',
|
||||
[
|
||||
'exec',
|
||||
'tsx',
|
||||
'scripts/coverage-report.ts',
|
||||
'temp/coverage/coverage.lcov'
|
||||
],
|
||||
{ encoding: 'utf-8' }
|
||||
).trimEnd()
|
||||
lines.push('')
|
||||
@@ -96,6 +103,11 @@ if (coverageStatus === 'ready' && existsSync('temp/coverage/coverage.lcov')) {
|
||||
lines.push('## 🔬 E2E Coverage')
|
||||
lines.push('')
|
||||
lines.push('> ⚠️ Coverage collection failed. Check the CI workflow logs.')
|
||||
} else if (coverageStatus === 'pending') {
|
||||
lines.push('')
|
||||
lines.push('## 🔬 E2E Coverage')
|
||||
lines.push('')
|
||||
lines.push('> ⏳ Coverage collection in progress…')
|
||||
}
|
||||
// coverageStatus === 'skip' (default) — don't show section at all
|
||||
|
||||
|
||||
Reference in New Issue
Block a user