Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test coverage tooling #7

Merged
merged 6 commits into from
Sep 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ jobs:
- name: Run pre-commit hooks
run: pre-commit run --all-files
- name: Run unit tests
run: pytest
run: pytest --cov-report=xml
- name: Upload test coverage report to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
flags: unittests
- name: Build Python package and publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
run: poetry publish --build -u __token__ -p ${{ secrets.PYPI_TOKEN }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ jobs:
- name: Install dependencies
run: poetry install --no-interaction -E fastapi
- name: Run unit tests
run: pytest
run: pytest --cov-report=xml
- name: Upload test coverage report to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
flags: unittests
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ _Docker images to power your Python APIs and help you ship faster. With support

[![PyPI](https://img.shields.io/pypi/v/inboard?color=success)](https://pypi.org/project/inboard/)
[![GitHub Container Registry](https://img.shields.io/badge/github%20container%20registry-inboard-success)](https://github.com/users/br3ndonland/packages/container/inboard/29204)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

[![builds](https://github.com/br3ndonland/inboard/workflows/builds/badge.svg)](https://github.com/br3ndonland/inboard/actions)
[![hooks](https://github.com/br3ndonland/inboard/workflows/hooks/badge.svg)](https://github.com/br3ndonland/inboard/actions)
[![tests](https://github.com/br3ndonland/inboard/workflows/tests/badge.svg)](https://github.com/br3ndonland/inboard/actions)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![codecov](https://codecov.io/gh/br3ndonland/inboard/branch/develop/graph/badge.svg)](https://codecov.io/gh/br3ndonland/inboard)

Brendon Smith ([br3ndonland](https://github.com/br3ndonland/))

Expand Down
68 changes: 67 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ isort = "^5.5"
mypy = "0.782"
pre-commit = "^2.7"
pytest = "^6"
pytest-cov = "^2.10"
pytest-mock = "^3.3"

[tool.poetry.extras]
fastapi = ["fastapi"]
starlette = ["starlette"]

[tool.pytest.ini_options]
addopts = "-q"
addopts = "--cov=inboard -q"
minversion = "6.0"
testpaths = ["tests"]

Expand Down