Skip to content

CI generate code coverage report on CircleCI #12

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

Merged
merged 1 commit into from
Sep 12, 2019
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
9 changes: 6 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ commands:
- restore_cache:
name: Restoring Pip Cache
keys:
- &cache-key pip-cache-<< parameters.python-version >>-{{ checksum "requirements.txt" }}-{{ checksum "test-requirements.txt" }}
- pip-cache-<< parameters.python-version >>-
- &cache-key pip-cache-v2-<< parameters.python-version >>-{{ checksum "requirements.txt" }}-{{ checksum "test-requirements.txt" }}
- pip-cache-v2-<< parameters.python-version >>-
- run:
name: "Running tests"
command: |
Expand All @@ -37,7 +37,7 @@ commands:
name: Saving Pip Cache
key: *cache-key
paths:
- ${PWD}/.cache
- ./cache
when: always
jobs:
tests-python-3:
Expand All @@ -48,6 +48,9 @@ jobs:
python-version: *default-python-version
- store_test_results:
path: test-reports
- run:
name: "Collecting coverage reports"
command: bash <(curl -s https://codecov.io/bash) -f ./coverage.xml || echo "Codecov did not collect coverage reports"

workflows:
version: 2
Expand Down
4 changes: 4 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignore:
- "influxdb2/domain/*.py"
- "influxdb2/service/*.py"
- "influxdb2_test/*.py"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@

### CI
1. [#11](https://github.com/bonitoo-io/influxdb-client-python/pull/11): Switch CI to CircleCI
1. [#12](https://github.com/bonitoo-io/influxdb-client-python/pull/12): CI generate code coverage report on CircleCI
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# influxdb-client-python

[![CircleCI](https://circleci.com/gh/bonitoo-io/influxdb-client-python.svg?style=svg)](https://circleci.com/gh/bonitoo-io/influxdb-client-python)
[![codecov](https://codecov.io/gh/bonitoo-io/influxdb-client-python/branch/master/graph/badge.svg)](https://codecov.io/gh/bonitoo-io/influxdb-client-python)

InfluxDB 2.0 python client library. TODO...

Expand Down
3 changes: 2 additions & 1 deletion scripts/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set -e
python --version
pip install -r requirements.txt
pip install -r test-requirements.txt
pip install pytest pytest-cov

#
# Prepare for test results
Expand All @@ -17,5 +18,5 @@ mkdir test-reports || true
#
# Test
#
pytest influxdb2_test --junitxml=test-reports/junit.xml
pytest influxdb2_test --junitxml=test-reports/junit.xml --cov=./ --cov-report xml:coverage.xml