Avoid cross-job artifacts; combine coverage with --cov-append.
PR Title Check / check-title (pull_request) Successful in 4s
Test Python Package / unit-tests (pull_request) Successful in 10s
Code Quality Pipeline / code-quality (pull_request) Successful in 24s
Test Python Package / integration-tests (pull_request) Successful in 20s
Test Python Package / coverage-report (pull_request) Successful in 24s
PR Title Check / check-title (pull_request) Successful in 4s
Test Python Package / unit-tests (pull_request) Successful in 10s
Code Quality Pipeline / code-quality (pull_request) Successful in 24s
Test Python Package / integration-tests (pull_request) Successful in 20s
Test Python Package / coverage-report (pull_request) Successful in 24s
Gitea artifact download is unreliable with v3 actions, so the report job re-runs both suites on one runner after parallel test gates pass. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
co-authored by
Cursor
parent
5d33ec6091
commit
0315a33a3b
+12
-37
@@ -27,17 +27,7 @@ jobs:
|
|||||||
run: uv sync --all-extras
|
run: uv sync --all-extras
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: |
|
run: uv run pytest tests/unit/ -m "not integration" -v
|
||||||
uv run pytest tests/unit/ -m "not integration" \
|
|
||||||
--cov=python_repositories \
|
|
||||||
--cov-report=
|
|
||||||
|
|
||||||
- name: Upload unit coverage
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: coverage-unit
|
|
||||||
path: .coverage
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
integration-tests:
|
integration-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -62,17 +52,7 @@ jobs:
|
|||||||
run: docker info
|
run: docker info
|
||||||
|
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
run: |
|
run: uv run pytest -m integration -v
|
||||||
uv run pytest -m integration \
|
|
||||||
--cov=python_repositories \
|
|
||||||
--cov-report=
|
|
||||||
|
|
||||||
- name: Upload integration coverage
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: coverage-integration
|
|
||||||
path: .coverage
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
coverage-report:
|
coverage-report:
|
||||||
needs: [unit-tests, integration-tests]
|
needs: [unit-tests, integration-tests]
|
||||||
@@ -95,22 +75,17 @@ jobs:
|
|||||||
UV_LINK_MODE: copy
|
UV_LINK_MODE: copy
|
||||||
run: uv sync --all-extras
|
run: uv sync --all-extras
|
||||||
|
|
||||||
- name: Download unit coverage
|
# Gitea Actions lacks cross-job artifact download APIs; re-run tests here
|
||||||
uses: actions/download-artifact@v3
|
# with --cov-append on one runner for an accurate combined report.
|
||||||
with:
|
- name: Run tests with combined coverage
|
||||||
name: coverage-unit
|
|
||||||
path: coverage-unit
|
|
||||||
|
|
||||||
- name: Download integration coverage
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: coverage-integration
|
|
||||||
path: coverage-integration
|
|
||||||
|
|
||||||
- name: Combine coverage report
|
|
||||||
run: |
|
run: |
|
||||||
uv run coverage combine coverage-unit/.coverage coverage-integration/.coverage
|
uv run pytest tests/unit/ -m "not integration" \
|
||||||
uv run coverage report -m --include='python_repositories/*' > coverage.txt
|
--cov=python_repositories \
|
||||||
|
--cov-report=
|
||||||
|
uv run pytest -m integration \
|
||||||
|
--cov=python_repositories \
|
||||||
|
--cov-append \
|
||||||
|
--cov-report=term-missing > coverage.txt
|
||||||
cat coverage.txt
|
cat coverage.txt
|
||||||
|
|
||||||
- name: Post coverage summary to PR
|
- name: Post coverage summary to PR
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ uv run pytest -v # full suite (requires Doc
|
|||||||
|
|
||||||
Integration tests are marked with `@pytest.mark.integration` and require Docker (testcontainers). Run unit tests alone for quick local feedback.
|
Integration tests are marked with `@pytest.mark.integration` and require Docker (testcontainers). Run unit tests alone for quick local feedback.
|
||||||
|
|
||||||
CI runs unit and integration tests in parallel, then merges coverage into a single report (see [`.gitea/workflows/test.yml`](.gitea/workflows/test.yml)).
|
CI runs unit and integration tests in parallel for fast feedback; a follow-up job re-runs both suites with `--cov-append` to produce a combined coverage report (Gitea Actions does not support cross-job artifact download yet).
|
||||||
|
|
||||||
`pre-commit` is included in the dev dependency group. `uv sync` installs the CLI, but git does not run hooks until you install them with `pre-commit install` (one time per clone). After that, commits run the checks defined in [`.pre-commit-config.yaml`](.pre-commit-config.yaml) (ruff, mypy, pyupgrade, prettier, and general file hygiene).
|
`pre-commit` is included in the dev dependency group. `uv sync` installs the CLI, but git does not run hooks until you install them with `pre-commit install` (one time per clone). After that, commits run the checks defined in [`.pre-commit-config.yaml`](.pre-commit-config.yaml) (ruff, mypy, pyupgrade, prettier, and general file hygiene).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user