Skip to content

Commit 44f8629

Browse files
committed
chore: Setup code climate test coverage
1 parent d280bae commit 44f8629

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

.circleci/config.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,30 @@ jobs:
33
build:
44
docker:
55
- image: circleci/python:3.6.1
6+
environment:
7+
CC_TEST_REPORTER_ID: 9f8a5da723397006023534dc6c5e32fc95d38bf7a92ae0e43530dba2a726722e
68
steps:
79
- checkout
810
- run:
911
command: |
1012
sudo apt install python-pip
1113
sudo pip install -U pip pipenv
14+
- run:
15+
command: |
16+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
17+
chmod +x ./cc-test-reporter
1218
- run:
1319
command: |
1420
pipenv --python python3.6
15-
pipenv install --dev
21+
pipenv install --dev
22+
- run:
23+
command: |
24+
pipenv run pytest
25+
./cc-test-reporter format-coverage coverage/coverage.xml -t coverage.py
26+
./cc-test-reporter upload-coverage
27+
- run:
28+
command: |
29+
./cc-test-reporter before-build
1630
- run:
1731
command: |
1832
pipenv run pytest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pip-log.txt
3636
pip-delete-this-directory.txt
3737

3838
# Unit test / coverage reports
39+
coverage/
3940
htmlcov/
4041
.tox/
4142
.coverage

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![CircleCI](https://circleci.com/gh/rai200890/python_google_cloud_logger.svg?style=svg&circle-token=cdb4c95268aa18f240f607082833c94a700f96e9)](https://circleci.com/gh/rai200890/python_google_cloud_logger)
44
[![PyPI version](https://badge.fury.io/py/google-cloud-logger.svg)](https://badge.fury.io/py/google-cloud-logger)
55
[![Maintainability](https://api.codeclimate.com/v1/badges/e988f26e1590a6591d96/maintainability)](https://codeclimate.com/github/rai200890/python_google_cloud_logger/maintainability)
6+
[![Test Coverage](https://api.codeclimate.com/v1/badges/e988f26e1590a6591d96/test_coverage)](https://codeclimate.com/github/rai200890/python_google_cloud_logger/test_coverage)
67

78
Python log formatter for Google Cloud according to [v2 specification](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) using [python-json-logger](https://github.com/madzak/python-json-logger) formatter
89

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[pytest]
2-
addopts = -v -s --cov=google_cloud_logger --cov-report html --cov-report term
2+
addopts = -v -s --cov=google_cloud_logger --cov-report html:coverage --cov-report term --cov-report=xml:coverage/coverage.xml

0 commit comments

Comments
 (0)