Skip to content

Commit

Permalink
Add coverage data via coveralls
Browse files Browse the repository at this point in the history
Problem:
- Coverage data needs to be measurable and visible.

Solution:
- Configured GitHub to work with coveralls.
- Added coveralls token to travis. Coverage data is synced to coveralls at merge build to prevent ENV vars from being accessed by fork PRs.
  See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions for details.
- Confirmed tox ini invocations included earlier via template functioned as expected.
- Added build status and coverage badges to README.md

Tests:
- Manually checked that data was available at:
- [f5devcentral coveralls](https://coveralls.io/github/f5devcentral)
  • Loading branch information
recursivelycurious committed May 17, 2017
1 parent 868dc71 commit 2f9f3bd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[run]
omit =
# unit tests
*/test/*
*/testcommon.py

# setup etc.
setup.py
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ install:
script:
- tox -e style
- tox -e unit
# For security, travis CI not provide env vars on fork PRs.
# So we only run coverage when the env var is present at merge.
# https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
- if [ "$COVERALLS_REPO_TOKEN" != "" ]; then tox -e coverage; fi
before_deploy: PKG_VERSION=$(python -c "import f5; print(f5_cccl.__version__)")
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# f5-cccl
[![Build Status](https://travis-ci.org/michaeldayreads/f5-cccl.svg?branch=master)](https://travis-ci.org/michaeldayreads/f5-cccl) [![Coverage Status](https://coveralls.io/repos/github/f5devcentral/f5-cccl/badge.svg?branch=master)](https://coveralls.io/github/f5devcentral/f5-cccl?branch=master)

# Introduction

This project implements a Common Controller Core Library for orchestration an F5 BIG-IP (r) for use within other libraries that need to read, diff and apply configurations to a BIG-IP (r).
Expand Down
1 change: 1 addition & 0 deletions requirements.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ q
PyYAML==3.12
simplejson
jsonschema
python-coveralls==2.7.0
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
envlist =
unit
style
coveralls
coverage
docs

[testenv]
basepython =
unit: python
style: python
coveralls: python
coverage: python
docs: python
passenv = COVERALLS_REPO_TOKEN
deps =
-rrequirements.test.txt

commands =
# Misc tests
unit: py.test --cov=f5_cccl/
style: flake8 {posargs:.}
style: pylint f5_cccl/
unit: py.test f5_cccl/
coveralls: coveralls
coverage: coveralls
docs: bash ./devtools/bin/build-docs.sh
usedevelop = true

Expand Down

0 comments on commit 2f9f3bd

Please sign in to comment.