Skip to content

Commit

Permalink
Add code coverage reporting (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
PGijsbers authored Oct 7, 2024
1 parent d93bdb9 commit 66e6d6a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ jobs:
docker compose up -d --wait python-api php-api
- run: docker container ls && docker image ls
- run: docker exec python-api python -m pip freeze
- run: docker exec python-api python -m pytest -xv -m "php_api"
- run: docker exec python-api coverage run -m pytest -xv -m "php_api"
- run: docker exec python-api coverage xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
python:
runs-on: ubuntu-latest
steps:
Expand All @@ -39,4 +44,9 @@ jobs:
- run: docker compose up -d --wait database python-api
- run: docker container ls && docker image ls
- run: docker exec python-api python -m pip freeze
- run: docker exec python-api python -m pytest -xv -m "not php_api"
- run: docker exec python-api coverage run -m pytest -xv -m "not php_api"
- run: docker exec python-api coverage xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies = [

[project.optional-dependencies]
dev = [
"coverage",
"pre-commit",
"pytest",
"pytest-mock",
Expand All @@ -40,8 +41,11 @@ docs = [
"Homepage" = "https://github.com/openml/server-api"
"Bug Tracker" = "https://github.com/openml/server-api/issues"

[tool.bandit.assert_used]
skips = ["./tests/*"]
[tool.coverage.run]
branch=true

[tool.coverage.report]
show_missing=true

[tool.ruff]
line-length = 100
Expand Down

0 comments on commit 66e6d6a

Please sign in to comment.