Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
branch = true
source = codeflash
omit =
codeflash/version.py

[report]
sort = cover
show_missing = true
fail_under = 58
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
if __name__ == .__main__.:

[html]
directory = htmlcov
39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,44 @@ jobs:
- name: Unit tests
run: uv run pytest tests/

# ---------------------------------------------------------------------------
# Coverage — single run on ubuntu/py3.13 to enforce the coverage floor.
# ---------------------------------------------------------------------------
coverage:
needs: determine-changes
if: needs.determine-changes.outputs.unit_tests == 'true'
runs-on: ubuntu-latest
env:
PYTHONIOENCODING: utf-8
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
with:
python-version: "3.13"
enable-cache: true

- name: Install dependencies
run: uv sync

- name: Run tests with coverage
run: uv run pytest tests/ --ignore=tests/test_tracer.py --cov=codeflash --cov-report=xml:coverage.xml --cov-report=term-missing --cov-config=.coveragerc

- name: Check coverage floor
run: uv run coverage report --fail-under=58

- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml
retention-days: 30

# ---------------------------------------------------------------------------
# Mypy type checking
# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -507,6 +545,7 @@ jobs:
if: always()
needs:
- unit-tests
- coverage
- type-check
- prek
- e2e-python
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ dev = [
"prek>=0.2.25",
"ty>=0.0.14",
"uv>=0.9.29",
"pytest-cov>=7.1.0",
]
tests = [
"black>=25.9.0",
Expand Down
28 changes: 28 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading