Skip to content

Commit 2558388

Browse files
authored
feat: code coverage tracking (#154)
1 parent 89f5ed4 commit 2558388

File tree

5 files changed

+553
-461
lines changed

5 files changed

+553
-461
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ jobs:
3131
ZENDRIVER_TEST_NO_SANDBOX: "true"
3232
shell: bash
3333
run: ./scripts/test.sh
34+
- name: Upload coverage to Codecov
35+
uses: codecov/codecov-action@v5
36+
env:
37+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore:
2+
- "zendriver/cdp" # automatically generated code

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dev-dependencies = [
3636
"mkdocstrings[python]>=0.26.2",
3737
"mypy>=1.12.0",
3838
"pytest-asyncio>=0.24.0",
39+
"pytest-cov>=6.1.1",
3940
"pytest>=8.3.3",
4041
"pyyaml>=6.0.2",
4142
"ruff>=0.7.4",

scripts/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44

55
command=( "$@" )
66
if [ "${#command[@]}" -eq 0 ]; then
7-
command=( "pytest" )
7+
command=( "pytest --cov=zendriver --cov-report=xml" )
88
fi
99

1010
chrome_executable=$(uv run python -c "from zendriver.core.config import find_chrome_executable;print(find_chrome_executable())")
@@ -14,4 +14,4 @@ chrome_version=$(uv run python -c "import os, subprocess, sys; path = r'$chrome_
1414
echo "Chrome version: $chrome_version"
1515

1616
set -x
17-
uv run "${command[@]}"
17+
uv run ${command[@]}

0 commit comments

Comments
 (0)