← Back to team overview

netplan-developers team mailing list archive

[Merge] netplan:cyphermox/coverage into netplan:master

 

Mathieu Trudel-Lapierre has proposed merging netplan:cyphermox/coverage into netplan:master.

Requested reviews:
  Martin Pitt (pitti)

For more details, see:
https://code.launchpad.net/~netplan-developers/netplan/+git/netplan/+merge/312682

Do magic with coverage.
-- 
Your team Developers of netplan is subscribed to branch netplan:master.
diff --git a/Makefile b/Makefile
index ba3d3f5..26e05c0 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,7 @@ coverage:
 	@if grep headerCovTableEntryHi test-coverage/index.html | grep -qv '100.*%'; then \
 	    echo "FAIL: Test coverage not 100%!" >&2; exit 1; \
 	fi
-	python3-coverage report --include=src/netplan --show-missing
+	python3-coverage report --include=src/netplan --show-missing --fail-under=100
 
 install: default
 	mkdir -p $(DESTDIR)/usr/sbin $(DESTDIR)/lib/netplan $(DESTDIR)/$(SYSTEMD_GENERATOR_DIR)
diff --git a/src/netplan b/src/netplan
index e90720f..900f227 100755
--- a/src/netplan
+++ b/src/netplan
@@ -238,7 +238,8 @@ def command_generate():
     if args.root_dir:
         argv += ['--root-dir', args.root_dir]
     logging.debug('command generate: running %s', argv)
-    os.execv(argv[0], argv)
+    # FIXME: os.execv(argv[0], argv) would be better but fails coverage
+    sys.exit(subprocess.call(argv))
 
 
 def command_apply():  # pragma: nocover (covered in autopkgtest)

Follow ups