From 7f9521d90c61b3b53c6f7081f04b5fff4e039dcd Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 12 Dec 2025 12:58:19 +0100 Subject: [PATCH 1/4] chore: Add test coverage reports --- .github/workflows/release.yaml | 8 ------- .github/workflows/run_code_checks.yaml | 6 +++-- .gitignore | 2 ++ Makefile | 31 +++++++++++++++++++++----- README.md | 3 +++ 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index acf286c69c..303d52c474 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -55,14 +55,6 @@ jobs: with: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - unit_tests: - name: Unit tests - uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main - secrets: - httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org'}} - with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - update_changelog: name: Update changelog needs: [release_metadata, lint_check, type_check, unit_tests] diff --git a/.github/workflows/run_code_checks.yaml b/.github/workflows/run_code_checks.yaml index b51da18ab9..1468d84e9c 100644 --- a/.github/workflows/run_code_checks.yaml +++ b/.github/workflows/run_code_checks.yaml @@ -31,12 +31,14 @@ jobs: unit_tests: name: Unit tests - uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main + uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python secrets: httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org'}} with: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - os: '["ubuntu-latest", "windows-latest", "macos-latest"]' + operating-systems: '["ubuntu-latest", "windows-latest", "macos-latest"]' + python-version-for-codecov: "3.14" + operating-system-for-codecov: "ubuntu-latest" docs_check: name: Docs check diff --git a/.gitignore b/.gitignore index 07cac056a7..74cb9fe9c0 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,8 @@ build/ # Coverage reports .coverage* htmlcov +coverage-unit.xml +coverage-integration.xml # IDE, editors .vscode diff --git a/Makefile b/Makefile index 6ca17970b0..e80207344e 100644 --- a/Makefile +++ b/Makefile @@ -30,15 +30,36 @@ type-check: uv run mypy unit-tests: - uv run pytest --numprocesses=1 -vv tests/unit -m "run_alone" - uv run pytest --numprocesses=auto -vv tests/unit -m "not run_alone" + uv run pytest \ + --numprocesses=1 \ + --verbose \ + -m "run_alone" \ + tests/unit + uv run pytest \ + --numprocesses=auto \ + --verbose \ + -m "not run_alone" \ + tests/unit unit-tests-cov: - uv run pytest --numprocesses=1 -vv --cov=src/crawlee tests/unit -m "run_alone" - uv run pytest --numprocesses=auto -vv --cov=src/crawlee --cov-append --cov-report=html tests/unit -m "not run_alone" + uv run pytest \ + --numprocesses=1 \ + --verbose \ + -m "run_alone" \ + --cov=src/crawlee \ + --cov-report=xml:coverage-unit.xml \ + tests/unit + uv run pytest \ + --numprocesses=auto \ + --verbose \ + -m "not run_alone" \ + --cov=src/crawlee \ + --cov-report=xml:coverage-unit.xml \ + --cov-append \ + tests/unit e2e-templates-tests $(args): - uv run pytest --numprocesses=$(E2E_TESTS_CONCURRENCY) -vv tests/e2e/project_template "$(args)" --timeout=600 + uv run pytest --numprocesses=$(E2E_TESTS_CONCURRENCY) --verbose tests/e2e/project_template "$(args)" --timeout=600 format: uv run ruff check --fix diff --git a/README.md b/README.md index caa3116ad7..7be8238040 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ PyPI - Downloads + + Code cov report + PyPI - Python Version From c4598a99c0310a963385c2902ce66758c3dbf91f Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 12 Dec 2025 13:29:01 +0100 Subject: [PATCH 2/4] Add actions lint check and add fixes --- .github/workflows/release.yaml | 2 +- .github/workflows/run_code_checks.yaml | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 303d52c474..71714cb375 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -57,7 +57,7 @@ jobs: update_changelog: name: Update changelog - needs: [release_metadata, lint_check, type_check, unit_tests] + needs: [release_metadata, lint_check, type_check] uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main with: version_number: ${{ needs.release_metadata.outputs.version_number }} diff --git a/.github/workflows/run_code_checks.yaml b/.github/workflows/run_code_checks.yaml index 1468d84e9c..7b45488308 100644 --- a/.github/workflows/run_code_checks.yaml +++ b/.github/workflows/run_code_checks.yaml @@ -17,6 +17,15 @@ on: workflow_dispatch: jobs: + actions_lint_check: + name: Actions lint check + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Run actionlint + uses: rhysd/actionlint@v1.7.9 + lint_check: name: Lint check uses: apify/workflows/.github/workflows/python_lint_check.yaml@main @@ -34,11 +43,12 @@ jobs: uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python secrets: httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org'}} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' operating-systems: '["ubuntu-latest", "windows-latest", "macos-latest"]' python-version-for-codecov: "3.14" - operating-system-for-codecov: "ubuntu-latest" + operating-system-for-codecov: ubuntu-latest docs_check: name: Docs check From e7d4e347ad23d5016aa9081d84d5dd45de7b78ef Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 12 Dec 2025 13:37:46 +0100 Subject: [PATCH 3/4] Add coverage badge token --- .github/workflows/run_code_checks.yaml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_code_checks.yaml b/.github/workflows/run_code_checks.yaml index 7b45488308..569b1fa348 100644 --- a/.github/workflows/run_code_checks.yaml +++ b/.github/workflows/run_code_checks.yaml @@ -42,7 +42,7 @@ jobs: name: Unit tests uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python secrets: - httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org'}} + httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org' }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' diff --git a/README.md b/README.md index 7be8238040..ec68827869 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ PyPI - Downloads - Code cov report + Code cov report PyPI - Python Version From 58d3b28e0c40a31cf8a60875dad9663a32aa13c6 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 12 Dec 2025 13:42:07 +0100 Subject: [PATCH 4/4] Switch to main branch --- .github/workflows/run_code_checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_code_checks.yaml b/.github/workflows/run_code_checks.yaml index 569b1fa348..96f5043a8d 100644 --- a/.github/workflows/run_code_checks.yaml +++ b/.github/workflows/run_code_checks.yaml @@ -40,7 +40,7 @@ jobs: unit_tests: name: Unit tests - uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python + uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main secrets: httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org' }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}