Merge netplan:cyphermox/coverage into netplan:master

Proposed by Mathieu Trudel-Lapierre on 2016-12-07
Status: Merged
Approved by: Martin Pitt on 2016-12-07
Approved revision: 1e99a7fff687a2227aca65bf8035042f1ae5d97b
Merged at revision: 1e99a7fff687a2227aca65bf8035042f1ae5d97b
Proposed branch: netplan:cyphermox/coverage
Merge into: netplan:master
Diff against target: 27 lines (+3/-2)
2 files modified
Makefile (+1/-1)
src/netplan (+2/-1)
Reviewer Review Type Date Requested Status
Martin Pitt 2016-12-07 Approve on 2016-12-07
Review via email: mp+312682@code.launchpad.net

Description of the Change

Do magic with coverage.

To post a comment you must log in.
Martin Pitt (pitti) wrote :

LGTM, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index ba3d3f5..26e05c0 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -37,7 +37,7 @@ coverage:
6 @if grep headerCovTableEntryHi test-coverage/index.html | grep -qv '100.*%'; then \
7 echo "FAIL: Test coverage not 100%!" >&2; exit 1; \
8 fi
9- python3-coverage report --include=src/netplan --show-missing
10+ python3-coverage report --include=src/netplan --show-missing --fail-under=100
11
12 install: default
13 mkdir -p $(DESTDIR)/usr/sbin $(DESTDIR)/lib/netplan $(DESTDIR)/$(SYSTEMD_GENERATOR_DIR)
14diff --git a/src/netplan b/src/netplan
15index e90720f..900f227 100755
16--- a/src/netplan
17+++ b/src/netplan
18@@ -238,7 +238,8 @@ def command_generate():
19 if args.root_dir:
20 argv += ['--root-dir', args.root_dir]
21 logging.debug('command generate: running %s', argv)
22- os.execv(argv[0], argv)
23+ # FIXME: os.execv(argv[0], argv) would be better but fails coverage
24+ sys.exit(subprocess.call(argv))
25
26
27 def command_apply(): # pragma: nocover (covered in autopkgtest)

Subscribers

People subscribed via source and target branches

to all changes: