Merge lp:~elopio/snapcraft/coverage into lp:~snappy-dev/snapcraft/core

Proposed by Leo Arias
Status: Merged
Approved by: Michael Terry
Approved revision: no longer in the source branch.
Merged at revision: 92
Proposed branch: lp:~elopio/snapcraft/coverage
Merge into: lp:~snappy-dev/snapcraft/core
Diff against target: 34 lines (+12/-1)
2 files modified
README.md (+5/-0)
runtests.sh (+7/-1)
To merge this branch: bzr merge lp:~elopio/snapcraft/coverage
Reviewer Review Type Date Requested Status
Michael Terry (community) Approve
Review via email: mp+265350@code.launchpad.net

Commit message

Add test coverage report.

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Nice! :)

Is there any way we could include the plainbox runs in the coverage report? The unit tests are only a part of the story, and so the coverage report would be misleading without the integration tests too.

review: Needs Information
lp:~elopio/snapcraft/coverage updated
91. By Michael Vogt

Fix setting of snapcraft.common.plugindir (thanks to cjwatson). by mvo approved by mterry

Revision history for this message
Leo Arias (elopio) wrote :

I haven't been able to run the plainbox tests on vivid yet. I get:

usage: manage.py [--help] [--version] [options]
manage.py: error: unrecognized arguments: -d /tmp/tmp.FrgNhrCr9x

I have the ppa mentioned on the README. I'll ask on IRC.

I'm not sure if we want a unified report of unit test + functional test coverage, or we want to reports. We have the same question for go, so we'll be talking about that. Anyway, we can add that in a following branch.

Revision history for this message
Leo Arias (elopio) wrote :

I found I was missing an update. But it seems python3-coverage can run only python files. We'll have to see how to make it work with plainbox.

Revision history for this message
Michael Terry (mterry) wrote :

OK, this is fine/harmless. I just don't want us to get caught up in chasing those numbers, since they aren't super useful without incorporating the integration tests.

review: Approve
lp:~elopio/snapcraft/coverage updated
92. By Leo Arias

Add test coverage report. by elopio approved by mterry

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2015-07-13 21:48:10 +0000
3+++ README.md 2015-07-21 02:05:48 +0000
4@@ -10,6 +10,11 @@
5
6 ./runtests.sh
7
8+- If you want to get a test coverage report, install python3-coverage before running the tests:
9+
10+ sudo apt-get install python3-coverage
11+
12+
13 - If you don't want to run the plainbox integration tests, you can skip them by setting SNAPCRAFT_TESTS_SKIP_PLAINBOX=1 in your environment.
14
15 - If you are on 15.04 or earlier, you will need to run:
16
17=== modified file 'runtests.sh'
18--- runtests.sh 2015-07-15 16:16:45 +0000
19+++ runtests.sh 2015-07-21 02:05:48 +0000
20@@ -27,7 +27,13 @@
21
22 pyflakes3 $SRC_PATHS
23
24-python3 -m unittest
25+if which python3-coverage >/dev/null 2>&1; then
26+ python3-coverage erase
27+ python3-coverage run --branch --source snapcraft -m unittest
28+ python3-coverage report
29+else
30+ python3 -m unittest
31+fi
32
33 if [ -z "$SNAPCRAFT_TESTS_SKIP_PLAINBOX" ]; then
34 (

Subscribers

People subscribed via source and target branches

to all changes: