-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathcodecov.yml
More file actions
212 lines (188 loc) · 8.41 KB
/
codecov.yml
File metadata and controls
212 lines (188 loc) · 8.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
---
# ==============================================================================
# Codecov Configuration
# ==============================================================================
#
# This file configures Codecov integration for Tux.
# It defines coverage requirements, status checks, reporting behavior, and
# file exclusions for comprehensive test coverage tracking.
#
# All tests (unit, integration, and end-to-end) run together and generate
# a unified coverage report that is uploaded to Codecov for analysis.
#
# Documentation: https://docs.codecov.com/docs/codecov-yaml
# Validation: https://api.codecov.io/validate
# ==============================================================================
# ==============================================================================
# Codecov Behavior Settings
# ==============================================================================
codecov:
# Wait for all CI status checks to pass before posting Codecov status.
# This ensures coverage reports are only posted after successful CI runs.
require_ci_to_pass: true
# Disable coverage report expiration. Reports will be processed regardless
# of age, allowing for delayed uploads or manual processing scenarios.
# yamllint disable-line rule:truthy
max_report_age: false
# Enable Codecov's default path fixes for common CI environments.
# These automatically normalize file paths from various CI systems.
disable_default_path_fixes: false
# ==============================================================================
# Coverage Configuration
# ==============================================================================
coverage:
# Number of decimal places to display in coverage percentages.
precision: 2
# Rounding direction for coverage calculations.
# Options: 'down', 'up', 'nearest'
round: down
# Coverage percentage range for UI color coding.
# Format: start...end (three dots)
# - Red background: below start percentage
# - Yellow background: between start and end percentages
# - Green background: at or above end percentage
range: 75...100
# ============================================================================
# Status Check Configuration
# ============================================================================
status:
# --------------------------------------------------------------------------
# Project Coverage Status
# --------------------------------------------------------------------------
# Enforces overall project coverage requirements across all code.
# This status check blocks pull requests that do not meet coverage thresholds.
project:
default:
# Minimum coverage percentage required for the entire project.
# Status check will fail if coverage falls below this threshold.
target: 80%
# Permitted coverage drop before status check fails.
# Allows minor fluctuations while maintaining quality standards.
threshold: 1%
# Status check is blocking (not informational only).
# Pull requests cannot be merged if this check fails.
informational: true
# Behavior when no coverage report is uploaded.
# 'failure' ensures coverage reports are always required.
if_not_found: failure
# Behavior when CI fails.
# 'error' ensures status only passes when CI succeeds.
if_ci_failed: error
# --------------------------------------------------------------------------
# Patch Coverage Status
# --------------------------------------------------------------------------
# Enforces coverage requirements for new and modified code in pull requests.
# This ensures that all changes are properly tested before merging.
patch:
default:
# Minimum coverage percentage required for new/changed code.
# Higher threshold than project coverage to maintain quality.
target: 80%
# Permitted coverage drop for new code.
# More lenient than project coverage to account for refactoring.
threshold: 5%
# Status check is blocking (not informational only).
informational: false
# Only enforce patch coverage on pull requests, not on direct commits.
only_pulls: true
# Behavior when no coverage report is uploaded.
if_not_found: failure
# Behavior when CI fails.
if_ci_failed: error
# ==============================================================================
# Parser Configuration
# ==============================================================================
# Controls how Codecov parses coverage reports from various tools.
parsers:
# V1 parser configuration for Python coverage reports.
# Handles XML coverage reports generated by coverage.py via pytest-cov.
v1:
# Include files with zero coverage in the coverage report.
# This provides complete visibility into all source files.
include_full_missed_files: true
# ==============================================================================
# Pull Request Comment Configuration
# ==============================================================================
# Controls the format and behavior of Codecov comments on pull requests.
comment:
# Comment layout components, displayed in order:
# - condensed_header: Summary header with key metrics
# - diff: Coverage changes for modified lines
# - condensed_files: List of files with coverage changes
# - condensed_footer: Footer with links and metadata
layout: condensed_header, diff, condensed_files, condensed_footer
# Comment posting behavior.
# 'default' posts comments on all pull requests with coverage data.
behavior: default
# Post comments even when coverage does not change.
# Set to 'true' to only comment when coverage changes occur.
require_changes: false
# Do not require base commit coverage report to post comment.
require_base: false
# Require head commit coverage report to post comment.
require_head: true
# Display project-wide coverage in addition to patch coverage.
hide_project_coverage: false
# Number of builds to wait before posting comment.
# Set to 1 to post immediately after first build completes.
after_n_builds: 1
# ==============================================================================
# GitHub Integration
# ==============================================================================
# Enhanced integration with GitHub's pull request interface.
github_checks:
# Enable GitHub Check Run annotations.
# Displays line-by-line coverage information directly in PR file diffs.
# Annotations show which lines are covered or uncovered by tests.
annotations: true
# ==============================================================================
# Path Normalization
# ==============================================================================
# Normalizes file paths in coverage reports to match repository structure.
#
# Coverage.py is configured with relative_files=true in pyproject.toml,
# but CI environments may still generate absolute paths. These path fixes
# ensure Codecov can correctly map coverage data to repository files.
#
# Pattern format: "source_pattern::target_path/"
# - Uses regex patterns for matching
# - Normalizes absolute CI paths to relative repository paths
fixes:
# Normalize any absolute path containing src/tux/ to relative src/tux/
# Examples of transformations:
# /home/runner/work/tux/tux/src/tux/core/app.py => src/tux/core/app.py
# /tmp/workspace/src/tux/database/models.py => src/tux/database/models.py
# Note: Quoted to match Codecov documentation style
- .*/src/tux/::src/tux/
# ==============================================================================
# File Exclusion
# ==============================================================================
# Files and directories to exclude from coverage reporting.
#
# These patterns prevent non-source files, test files, and generated artifacts
# from being included in coverage calculations. This ensures coverage metrics
# reflect only the actual source code being tested.
ignore:
# Test files and development artifacts
- tests/
- conftest.py
- .pytest_cache/
- .ruff_cache/
- htmlcov/
# Build and environment files
- .venv/
- typings/
- __pycache__/
# Project management and documentation files
- docs/
- scripts/
- assets/
- logs/
- '*.md'
- '*.toml'
- '*.lock'
- '*.nix'
- flake.*
- shell.nix
# Generated files and build artifacts
- prisma/