File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [run]
2+ branch = true
3+ source = codeflash
4+ omit =
5+ codeflash/version.py
6+
7+ [report]
8+ sort = cover
9+ show_missing = true
10+ fail_under = 58
11+ exclude_lines =
12+ pragma: no cover
13+ if TYPE_CHECKING:
14+ if __name__ == .__main__.:
15+
16+ [html]
17+ directory = htmlcov
Original file line number Diff line number Diff line change @@ -202,6 +202,44 @@ jobs:
202202 - name : Unit tests
203203 run : uv run pytest tests/
204204
205+ # ---------------------------------------------------------------------------
206+ # Coverage — single run on ubuntu/py3.13 to enforce the coverage floor.
207+ # ---------------------------------------------------------------------------
208+ coverage :
209+ needs : determine-changes
210+ if : needs.determine-changes.outputs.unit_tests == 'true'
211+ runs-on : ubuntu-latest
212+ env :
213+ PYTHONIOENCODING : utf-8
214+ steps :
215+ - uses : actions/checkout@v6
216+ with :
217+ fetch-depth : 1
218+ token : ${{ secrets.GITHUB_TOKEN }}
219+
220+ - name : Install uv
221+ uses : astral-sh/setup-uv@v8.0.0
222+ with :
223+ python-version : " 3.13"
224+ enable-cache : true
225+
226+ - name : Install dependencies
227+ run : uv sync
228+
229+ - name : Run tests with coverage
230+ run : uv run pytest tests/ --ignore=tests/test_tracer.py --cov=codeflash --cov-report=xml:coverage.xml --cov-report=term-missing --cov-config=.coveragerc
231+
232+ - name : Check coverage floor
233+ run : uv run coverage report --fail-under=58
234+
235+ - name : Upload coverage report
236+ if : always()
237+ uses : actions/upload-artifact@v4
238+ with :
239+ name : coverage-report
240+ path : coverage.xml
241+ retention-days : 30
242+
205243 # ---------------------------------------------------------------------------
206244 # Mypy type checking
207245 # ---------------------------------------------------------------------------
@@ -559,6 +597,7 @@ jobs:
559597 needs :
560598 - check-linked-issue
561599 - unit-tests
600+ - coverage
562601 - type-check
563602 - prek
564603 - e2e-python
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ dev = [
8989 " prek>=0.2.25" ,
9090 " ty>=0.0.14" ,
9191 " uv>=0.9.29" ,
92+ " pytest-cov>=7.1.0" ,
9293]
9394tests = [
9495 " black>=25.9.0" ,
You can’t perform that action at this time.
0 commit comments