Skip to content

Commit 7f9521d

Browse files
committed
chore: Add test coverage reports
1 parent 8ec1a9f commit 7f9521d

File tree

5 files changed

+35
-15
lines changed

5 files changed

+35
-15
lines changed

.github/workflows/release.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ jobs:
5555
with:
5656
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
5757

58-
unit_tests:
59-
name: Unit tests
60-
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
61-
secrets:
62-
httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org'}}
63-
with:
64-
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
65-
6658
update_changelog:
6759
name: Update changelog
6860
needs: [release_metadata, lint_check, type_check, unit_tests]

.github/workflows/run_code_checks.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ jobs:
3131

3232
unit_tests:
3333
name: Unit tests
34-
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
34+
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python
3535
secrets:
3636
httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org'}}
3737
with:
3838
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
39-
os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
39+
operating-systems: '["ubuntu-latest", "windows-latest", "macos-latest"]'
40+
python-version-for-codecov: "3.14"
41+
operating-system-for-codecov: "ubuntu-latest"
4042

4143
docs_check:
4244
name: Docs check

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ build/
2727
# Coverage reports
2828
.coverage*
2929
htmlcov
30+
coverage-unit.xml
31+
coverage-integration.xml
3032

3133
# IDE, editors
3234
.vscode

Makefile

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,36 @@ type-check:
3030
uv run mypy
3131

3232
unit-tests:
33-
uv run pytest --numprocesses=1 -vv tests/unit -m "run_alone"
34-
uv run pytest --numprocesses=auto -vv tests/unit -m "not run_alone"
33+
uv run pytest \
34+
--numprocesses=1 \
35+
--verbose \
36+
-m "run_alone" \
37+
tests/unit
38+
uv run pytest \
39+
--numprocesses=auto \
40+
--verbose \
41+
-m "not run_alone" \
42+
tests/unit
3543

3644
unit-tests-cov:
37-
uv run pytest --numprocesses=1 -vv --cov=src/crawlee tests/unit -m "run_alone"
38-
uv run pytest --numprocesses=auto -vv --cov=src/crawlee --cov-append --cov-report=html tests/unit -m "not run_alone"
45+
uv run pytest \
46+
--numprocesses=1 \
47+
--verbose \
48+
-m "run_alone" \
49+
--cov=src/crawlee \
50+
--cov-report=xml:coverage-unit.xml \
51+
tests/unit
52+
uv run pytest \
53+
--numprocesses=auto \
54+
--verbose \
55+
-m "not run_alone" \
56+
--cov=src/crawlee \
57+
--cov-report=xml:coverage-unit.xml \
58+
--cov-append \
59+
tests/unit
3960

4061
e2e-templates-tests $(args):
41-
uv run pytest --numprocesses=$(E2E_TESTS_CONCURRENCY) -vv tests/e2e/project_template "$(args)" --timeout=600
62+
uv run pytest --numprocesses=$(E2E_TESTS_CONCURRENCY) --verbose tests/e2e/project_template "$(args)" --timeout=600
4263

4364
format:
4465
uv run ruff check --fix

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
<a href="https://pypi.org/project/crawlee/" rel="nofollow">
2121
<img src="https://img.shields.io/pypi/dm/crawlee" alt="PyPI - Downloads" style="max-width: 100%;">
2222
</a>
23+
<a href="https://codecov.io/gh/apify/crawlee-python" >
24+
<img src="https://codecov.io/gh/apify/crawlee-python/graph/badge.svg?token=TODO" alt="Code cov report" style="max-width: 100%;"/>
25+
</a>
2326
<a href="https://pypi.org/project/crawlee/" rel="nofollow">
2427
<img src="https://img.shields.io/pypi/pyversions/crawlee" alt="PyPI - Python Version" style="max-width: 100%;">
2528
</a>

0 commit comments

Comments
 (0)