Skip to content

Commit ff36201

Browse files
committed
chore: Add test coverage reports
1 parent c451d97 commit ff36201

File tree

6 files changed

+51
-26
lines changed

6 files changed

+51
-26
lines changed

.github/workflows/pre_release.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,27 @@ jobs:
4646

4747
unit_tests:
4848
name: Unit tests
49-
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
49+
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python
50+
secrets: inherit
5051
with:
5152
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
53+
operating-systems: '["ubuntu-latest", "windows-latest"]'
54+
python-version-for-codecov: "3.14"
55+
operating-system-for-codecov: "ubuntu-latest"
5256

5357
async_docstrings:
5458
name: Async dostrings check
5559
uses: ./.github/workflows/_async_docstrings_check.yaml
5660

5761
integration_tests:
5862
name: Integration tests
59-
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
63+
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@add-code-cov-to-python
6064
secrets: inherit
6165
with:
62-
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
66+
python-versions: '["3.10", "3.14"]'
67+
operating-systems: '["ubuntu-latest"]'
68+
python-version-for-codecov: "3.14"
69+
operating-system-for-codecov: "ubuntu-latest"
6370

6471
update_changelog:
6572
name: Update changelog

.github/workflows/release.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,10 @@ 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-
with:
62-
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
63-
6458
async_docstrings:
6559
name: Async dostrings check
6660
uses: ./.github/workflows/_async_docstrings_check.yaml
6761

68-
integration_tests:
69-
name: Integration tests
70-
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
71-
secrets: inherit
72-
with:
73-
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
74-
7562
update_changelog:
7663
name: Update changelog
7764
needs: [release_metadata, lint_check, type_check, unit_tests, integration_tests]

.github/workflows/run_code_checks.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ jobs:
2626

2727
unit_tests:
2828
name: Unit tests
29-
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
29+
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python
30+
secrets: inherit
3031
with:
3132
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
33+
operating-systems: '["ubuntu-latest", "windows-latest"]'
34+
python-version-for-codecov: "3.14"
35+
operating-system-for-codecov: "ubuntu-latest"
3236

3337
async_docstrings:
3438
name: Async dostrings check
@@ -41,7 +45,10 @@ jobs:
4145
integration_tests:
4246
name: Integration tests
4347
needs: [lint_check, type_check, unit_tests]
44-
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
45-
with:
46-
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
48+
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@add-code-cov-to-python
4749
secrets: inherit
50+
with:
51+
python-versions: '["3.10", "3.14"]'
52+
operating-systems: '["ubuntu-latest"]'
53+
python-version-for-codecov: "3.14"
54+
operating-system-for-codecov: "ubuntu-latest"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ build/
2424
# Coverage reports
2525
.coverage*
2626
htmlcov
27+
coverage-unit.xml
28+
coverage-integration.xml
2729

2830
# IDE, editors
2931
.vscode

Makefile

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov \
2-
integration-tests format check-async-docstrings check-code fix-async-docstrings \
3-
build-api-reference build-docs run-docs
1+
.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov integration-tests \
2+
integration-tests-cov format check-async-docstrings check-code fix-async-docstrings build-api-reference \
3+
build-docs run-docs
44

55
# This is default for local testing, but GitHub workflows override it to a higher value in CI
66
INTEGRATION_TESTS_CONCURRENCY = 1
@@ -27,13 +27,32 @@ type-check:
2727
uv run mypy
2828

2929
unit-tests:
30-
uv run pytest --numprocesses=auto --verbose --cov=src/apify_client tests/unit
30+
uv run pytest \
31+
--numprocesses=auto \
32+
--verbose \
33+
tests/unit
3134

3235
unit-tests-cov:
33-
uv run pytest --numprocesses=auto --verbose --cov=src/apify_client --cov-report=html tests/unit
36+
uv run pytest \
37+
--numprocesses=auto \
38+
--verbose \
39+
--cov=src/apify_client \
40+
--cov-report=xml:coverage-unit.xml \
41+
tests/unit
3442

3543
integration-tests:
36-
uv run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) --verbose tests/integration
44+
uv run pytest \
45+
--numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) \
46+
--verbose \
47+
tests/integration
48+
49+
integration-tests-cov:
50+
uv run pytest \
51+
--numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) \
52+
--verbose \
53+
--cov=src/apify_client \
54+
--cov-report=xml:coverage-integration.xml \
55+
tests/integration
3756

3857
format:
3958
uv run ruff check --fix

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<a href="https://pypi.org/project/apify-client/" rel="nofollow">
88
<img src="https://img.shields.io/pypi/dm/apify-client" alt="PyPI - Downloads" style="max-width: 100%;">
99
</a>
10+
<a href="https://codecov.io/gh/apify/apify-client-python" >
11+
<img src="https://codecov.io/gh/apify/apify-client-python/graph/badge.svg?token=TODO" alt="Code cov report" style="max-width: 100%;"/>
12+
</a>
1013
<a href="https://pypi.org/project/apify-client/" rel="nofollow">
1114
<img src="https://img.shields.io/pypi/pyversions/apify-client" alt="PyPI - Python version" style="max-width: 100%;">
1215
</a>

0 commit comments

Comments
 (0)