Skip to content

Commit

Permalink
chore: Setup code climate test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rai200890 committed Nov 20, 2018
1 parent d280bae commit 44f8629
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,30 @@ jobs:
build:
docker:
- image: circleci/python:3.6.1
environment:
CC_TEST_REPORTER_ID: 9f8a5da723397006023534dc6c5e32fc95d38bf7a92ae0e43530dba2a726722e
steps:
- checkout
- run:
command: |
sudo apt install python-pip
sudo pip install -U pip pipenv
- run:
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run:
command: |
pipenv --python python3.6
pipenv install --dev
pipenv install --dev
- run:
command: |
pipenv run pytest
./cc-test-reporter format-coverage coverage/coverage.xml -t coverage.py
./cc-test-reporter upload-coverage
- run:
command: |
./cc-test-reporter before-build
- run:
command: |
pipenv run pytest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
coverage/
htmlcov/
.tox/
.coverage
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![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)
[![PyPI version](https://badge.fury.io/py/google-cloud-logger.svg)](https://badge.fury.io/py/google-cloud-logger)
[![Maintainability](https://api.codeclimate.com/v1/badges/e988f26e1590a6591d96/maintainability)](https://codeclimate.com/github/rai200890/python_google_cloud_logger/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/e988f26e1590a6591d96/test_coverage)](https://codeclimate.com/github/rai200890/python_google_cloud_logger/test_coverage)

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

Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
addopts = -v -s --cov=google_cloud_logger --cov-report html --cov-report term
addopts = -v -s --cov=google_cloud_logger --cov-report html:coverage --cov-report term --cov-report=xml:coverage/coverage.xml

0 comments on commit 44f8629

Please sign in to comment.