summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Goins <paul.goins@canonical.com>2019-03-01 11:49:29 +0100
committerPaul Goins <paul.goins@canonical.com>2019-03-01 14:40:08 +0100
commit3dd814ef1332ff26bc38908137acb9dbebb93f32 (patch)
tree72eb160b0f6757cb34deb0567efc165c022cc9f0
parent15a4e6c8ee377be75f4c40b64ab246775dace5b5 (diff)
downloadcharm-interface-dashboard-plugin-3dd814ef1332ff26bc38908137acb9dbebb93f32.zip
charm-interface-dashboard-plugin-3dd814ef1332ff26bc38908137acb9dbebb93f32.tar.gz
charm-interface-dashboard-plugin-3dd814ef1332ff26bc38908137acb9dbebb93f32.tar.bz2
Added tox environment for gathering coverage
This technique was borrowed from the tox "cover" environment in openstack/nova's tox.ini. This leverages the fact that stestr lets you override the python executable via the PYTHON environment variable. Doing this allows us to easily generate coverage for our unit tests. An important caveat is that this does not provide any coverage for tests via zaza, amulet, etc. It is purely focused on the unit tests. Note that this replaces the previous .coveragerc; coverage configuration is instead pulled from tox.ini. Change-Id: I78170741219749d8bfb5eb7eb247877814fb9824
-rw-r--r--.zuul.yaml1
-rw-r--r--tox.ini27
2 files changed, 28 insertions, 0 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index 7051aee..dc27661 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,3 +1,4 @@
- project:
templates:
- python35-charm-jobs
+ - openstack-cover-jobs
diff --git a/tox.ini b/tox.ini
index bf2661b..1ea1523 100644
--- a/tox.ini
+++ b/tox.ini
@@ -30,6 +30,33 @@ basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = flake8 {posargs}
+[testenv:cover]
+# Technique based heavily upon
+# https://github.com/openstack/nova/blob/master/tox.ini
+basepython = python3
+deps = -r{toxinidir}/test-requirements.txt
+setenv =
+ {[testenv]setenv}
+ PYTHON=coverage run
+commands =
+ coverage erase
+ ostestr {posargs}
+ coverage combine
+ coverage html -d cover
+ coverage xml -o cover/coverage.xml
+ coverage report
+
+[coverage:run]
+branch = True
+concurrency = multiprocessing
+parallel = True
+source =
+ .
+omit =
+ .tox/*
+ */charmhelpers/*
+ unit_tests/*
+
[testenv:venv]
commands = {posargs}

This mirror site include all the OpenStack related repositories under: openstack, openstack-dev and openstack-infra.

NOTE: All repositories are updated every one hour.

Usage

For Git Clone
 git clone http://git.trystack.cn/openstack/nova.git 
For DevStack

Add GIT_BASE, NOVNC_REPO and SPICE_REPO variables to local.conf file.

[[local|localrc]]

# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git