Merge ~powersj/cloud-init:coverage into cloud-init:master

Proposed by Joshua Powers
Status: Merged
Merged at revision: c12f4dd835077e3aa39e9056c25f136ff6a6655b
Proposed branch: ~powersj/cloud-init:coverage
Merge into: cloud-init:master
Diff against target: 35 lines (+5/-0)
3 files modified
.gitignore (+1/-0)
test-requirements.txt (+1/-0)
tox.ini (+3/-0)
Reviewer Review Type Date Requested Status
Scott Moser Needs Information
Review via email: mp+308975@code.launchpad.net

Description of the change

Adds in coverage collections to cloud-init tox-based unit tests.

To post a comment you must log in.
Revision history for this message
Joshua Powers (powersj) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

do we think we need to do coverage on every thing ?
Can we maybe only run it on the py3 tox enviornment? it is somewhat significantly slower than without coverage.

that would seem enough to me.

review: Needs Information
Revision history for this message
Joshua Powers (powersj) wrote :

That last commit broke things so this is not safe to merge right now...

My intent was to replicate what we do for curtin [1] and simplestreams [2], which runs it on both py3 and py2.7. If we want to change to just py3 that is fine as it does save some time. Let me get a working commit.

[1] https://jenkins.ubuntu.com/server/job/curtin-ci/nodes=amd64/270/console
[2] https://jenkins.ubuntu.com/server/job/simplestreams-ci/nodes=amd64/26/console

Revision history for this message
Joshua Powers (powersj) wrote :

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index 77eb9c7..865cac1 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -4,3 +4,4 @@ dist
6 *.pyc
7 __pycache__
8 .tox
9+.coverage
10diff --git a/test-requirements.txt b/test-requirements.txt
11index 6bf3894..0e7fc8f 100644
12--- a/test-requirements.txt
13+++ b/test-requirements.txt
14@@ -3,6 +3,7 @@ httpretty>=0.7.1
15 mock
16 nose
17 unittest2
18+coverage
19
20 # Only needed if you want to know the test times
21 # nose-timer
22diff --git a/tox.ini b/tox.ini
23index 277858e..08318a9 100644
24--- a/tox.ini
25+++ b/tox.ini
26@@ -19,6 +19,9 @@ setenv =
27
28 [testenv:py3]
29 basepython = python3
30+commands = {envpython} -m nose \
31+ {posargs:--with-coverage --cover-erase \
32+ --cover-branches --cover-package=cloudinit --cover-inclusive}
33
34 [testenv:py26]
35 commands = nosetests {posargs:tests}

Subscribers

People subscribed via source and target branches