Compare commits

...

4 Commits

Author SHA1 Message Date
huang47
3f8cf13ea3 test: drop unused coverage summary reporter 2026-06-29 15:50:59 -07:00
huang47
1ec51d9081 test: broaden critical coverage gate scope 2026-06-29 15:49:23 -07:00
huang47
9b9fe247df test: remove unrelated website e2e guard 2026-06-29 15:22:14 -07:00
huang47
9a401ccc23 test: add critical unit coverage gate
Add a COVERAGE_CRITICAL gate that measures coverage over a curated
allow-list of critical files and wire it into the unit CI job. Thresholds
are locked to the current main baseline (statements 58 / branches 47 /
functions 54 / lines 58); later PRs ratchet them upward as tests land.
2026-06-28 13:40:45 -07:00
3 changed files with 26 additions and 2 deletions

View File

@@ -55,3 +55,6 @@ jobs:
flags: unit
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Enforce critical coverage gate
run: pnpm test:coverage:critical

View File

@@ -53,6 +53,7 @@
"test:browser:coverage": "cross-env COLLECT_COVERAGE=true pnpm test:browser",
"test:browser:local": "cross-env PLAYWRIGHT_LOCAL=1 PLAYWRIGHT_TEST_URL=http://localhost:5173 pnpm test:browser",
"test:coverage": "vitest run --coverage",
"test:coverage:critical": "cross-env COVERAGE_CRITICAL=true vitest run --coverage",
"test:unit": "vitest run",
"typecheck": "vue-tsc --noEmit",
"typecheck:browser": "vue-tsc --project browser_tests/tsconfig.json",

View File

@@ -29,6 +29,23 @@ const VITE_REMOTE_DEV = process.env.VITE_REMOTE_DEV === 'true'
const DISABLE_TEMPLATES_PROXY = process.env.DISABLE_TEMPLATES_PROXY === 'true'
const GENERATE_SOURCEMAP = process.env.GENERATE_SOURCEMAP !== 'false'
const IS_STORYBOOK = process.env.npm_lifecycle_event === 'storybook'
const COVERAGE_CRITICAL = process.env.COVERAGE_CRITICAL === 'true'
const CRITICAL_COVERAGE_INCLUDE = [
'src/base/**/*.{ts,vue}',
'src/composables/**/*.{ts,vue}',
'src/scripts/**/*.{ts,vue}',
'src/stores/**/*.{ts,vue}',
'src/utils/**/*.{ts,vue}',
'src/workbench/extensions/manager/composables/**/*.{ts,vue}'
]
const CRITICAL_COVERAGE_THRESHOLDS = {
statements: 66,
branches: 56,
functions: 64,
lines: 68
}
// Open Graph / Twitter Meta Tags Constants
const VITE_OG_URL = 'https://cloud.comfy.org'
@@ -668,7 +685,9 @@ export default defineConfig({
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
include: ['src/**/*.{ts,vue}'],
include: COVERAGE_CRITICAL
? CRITICAL_COVERAGE_INCLUDE
: ['src/**/*.{ts,vue}'],
exclude: [
'src/**/*.test.ts',
'src/**/*.spec.ts',
@@ -677,7 +696,8 @@ export default defineConfig({
'src/locales/**',
'src/lib/litegraph/**',
'src/assets/**'
]
],
...(COVERAGE_CRITICAL ? { thresholds: CRITICAL_COVERAGE_THRESHOLDS } : {})
},
exclude: [
'**/node_modules/**',