bug: fix frontend code coverage scoring (#9209)
fix frontend code coverage scoring
This commit is contained in:
parent
da4208dcc9
commit
ed4acabc0c
2 changed files with 19 additions and 22 deletions
22
codecov.yml
22
codecov.yml
|
|
@ -12,11 +12,6 @@ coverage:
|
||||||
|
|
||||||
status:
|
status:
|
||||||
project:
|
project:
|
||||||
# Overall project coverage target
|
|
||||||
default:
|
|
||||||
target: 60%
|
|
||||||
threshold: 3%
|
|
||||||
|
|
||||||
# Backend coverage strategy: Aspirational target for progress tracking
|
# Backend coverage strategy: Aspirational target for progress tracking
|
||||||
# Current coverage: ~33%, Target: 55% (intentionally higher than current)
|
# Current coverage: ~33%, Target: 55% (intentionally higher than current)
|
||||||
# This creates visual progress indicators (red->yellow->green) without blocking PRs
|
# This creates visual progress indicators (red->yellow->green) without blocking PRs
|
||||||
|
|
@ -31,21 +26,22 @@ coverage:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
# Frontend coverage: Realistic target based on current state
|
# Frontend coverage: Realistic target based on current state
|
||||||
# Current coverage: ~70%, maintains existing high standards
|
# Current coverage: ~1.5%, Target: 10% (achievable improvement goal)
|
||||||
frontend:
|
frontend:
|
||||||
target: 70%
|
target: 10%
|
||||||
# Threshold: Allowable drop in coverage before failing the check
|
# Threshold: Allowable drop in coverage before failing the check
|
||||||
# 2% = coverage can drop from 70% to 68% without failing status
|
# 1% = coverage can drop from 1.5% to 0.5% without failing status
|
||||||
# Stricter threshold to maintain established quality standards
|
# Small threshold appropriate for very low baseline coverage
|
||||||
threshold: 2%
|
threshold: 1%
|
||||||
flags:
|
flags:
|
||||||
- frontend
|
- frontend
|
||||||
|
|
||||||
# New code coverage requirements - encourages well-tested new features
|
# New code coverage requirements - realistic target for current state
|
||||||
|
# Encourages testing new features without blocking development
|
||||||
patch:
|
patch:
|
||||||
default:
|
default:
|
||||||
target: 70%
|
target: 40%
|
||||||
threshold: 3%
|
threshold: 5%
|
||||||
|
|
||||||
# PR comment configuration - what information to show in coverage reports
|
# PR comment configuration - what information to show in coverage reports
|
||||||
comment:
|
comment:
|
||||||
|
|
|
||||||
|
|
@ -19,18 +19,19 @@ module.exports = {
|
||||||
transformIgnorePatterns: ["node_modules/(?!(.*\\.mjs$|@testing-library))"],
|
transformIgnorePatterns: ["node_modules/(?!(.*\\.mjs$|@testing-library))"],
|
||||||
|
|
||||||
// Coverage configuration
|
// Coverage configuration
|
||||||
collectCoverage: process.env.CI === "true",
|
collectCoverage: true,
|
||||||
|
collectCoverageFrom: [
|
||||||
|
"src/**/*.{ts,tsx}",
|
||||||
|
"!src/**/*.{test,spec}.{ts,tsx}",
|
||||||
|
"!src/**/tests/**",
|
||||||
|
"!src/**/__tests__/**",
|
||||||
|
"!src/setupTests.ts",
|
||||||
|
"!src/vite-env.d.ts",
|
||||||
|
"!src/**/*.d.ts",
|
||||||
|
],
|
||||||
coverageDirectory: "coverage",
|
coverageDirectory: "coverage",
|
||||||
coverageReporters: ["text", "lcov", "html", "json-summary"],
|
coverageReporters: ["text", "lcov", "html", "json-summary"],
|
||||||
coveragePathIgnorePatterns: ["/node_modules/", "/tests/"],
|
coveragePathIgnorePatterns: ["/node_modules/", "/tests/"],
|
||||||
coverageThreshold: {
|
|
||||||
global: {
|
|
||||||
branches: 50,
|
|
||||||
functions: 50,
|
|
||||||
lines: 50,
|
|
||||||
statements: 50,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// CI-specific configuration
|
// CI-specific configuration
|
||||||
...(process.env.CI === "true" && {
|
...(process.env.CI === "true" && {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue