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(tools): code coverage reporting for bot & web_api #443

Merged
merged 9 commits into from
Jun 19, 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
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
name: run tests
working_directory: bot
command: ./s/test
- run:
name: upload code coverage
working_directory: bot
command: ./s/upload-code-cov

bot_lint:
docker:
Expand Down Expand Up @@ -169,6 +173,10 @@ jobs:
name: run tests
working_directory: web_api
command: ./s/test
- run:
name: upload code coverage
working_directory: web_api
command: ./s/upload-code-cov

web_api_lint:
docker:
Expand Down
6 changes: 6 additions & 0 deletions bot/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
omit =
.venv/*
venv/*
env/*
.env/*
28 changes: 25 additions & 3 deletions bot/poetry.lock

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

1 change: 1 addition & 0 deletions bot/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pylint = "^2.3"
flake8 = "^3.7"
flake8-pie = "^0.2.1"
isort = "^4.3"
pytest-cov = "^2.10"

[tool.poetry.plugins."pytest11"]
"pytest_plugin" = "pytest_plugin.plugin"
Expand Down
10 changes: 7 additions & 3 deletions bot/s/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
set -eux
set -ex

# test code
poetry run pytest "$@"

if [ "$CI" ]; then
poetry run pytest --cov=. --cov-report xml "$@"
else
poetry run pytest "$@"
fi
5 changes: 5 additions & 0 deletions bot/s/upload-code-cov
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -ex

bash <(curl -s https://codecov.io/bash)
13 changes: 13 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
codecov:
require_ci_to_pass: false

comment: false

coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
6 changes: 6 additions & 0 deletions web_api/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
omit =
.venv/*
venv/*
env/*
.env/*
24 changes: 23 additions & 1 deletion web_api/poetry.lock

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

1 change: 1 addition & 0 deletions web_api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ typing_extensions = "^3.7"
pytest-env = "^0.6.2"
pytest-mock = "^2.0"
ipdb = "^0.12.3"
pytest-cov = "^2.10"

[build-system]
requires = ["poetry>=0.12"]
Expand Down
Loading