From 3cb92d33eb03c91819324416048fdc7efa097814 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 21 Jun 2017 14:10:16 -0700 Subject: [PATCH] report and enforce coverage on integration tests (#4854) --- tests/boulder-integration.sh | 5 +++++ tests/integration/_common.sh | 38 ++++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/tests/boulder-integration.sh b/tests/boulder-integration.sh index 42a8cf499..cf49f664b 100755 --- a/tests/boulder-integration.sh +++ b/tests/boulder-integration.sh @@ -74,6 +74,9 @@ CheckHooks() { rm "$HOOK_TEST" } +# Cleanup coverage data +coverage erase + # test for regressions of #4719 get_num_tmp_files() { ls -1 /tmp | wc -l @@ -244,3 +247,5 @@ if ${CI:-false} || type nginx; then . ./certbot-nginx/tests/boulder-integration.sh fi + +coverage report --fail-under 52 -m diff --git a/tests/integration/_common.sh b/tests/integration/_common.sh index 8d4baff95..48d20eb3b 100755 --- a/tests/integration/_common.sh +++ b/tests/integration/_common.sh @@ -6,7 +6,8 @@ store_flags="--config-dir $root/conf --work-dir $root/work" store_flags="$store_flags --logs-dir $root/logs" tls_sni_01_port=5001 http_01_port=5002 -export root store_flags tls_sni_01_port http_01_port +sources="acme/,$(ls -dm certbot*/ | tr -d ' \n')" +export root store_flags tls_sni_01_port http_01_port sources certbot_test () { certbot_test_no_force_renew \ @@ -15,18 +16,25 @@ certbot_test () { } certbot_test_no_force_renew () { - certbot \ - --server "${SERVER:-http://localhost:4000/directory}" \ - --no-verify-ssl \ - --tls-sni-01-port $tls_sni_01_port \ - --http-01-port $http_01_port \ - --manual-public-ip-logging-ok \ - $store_flags \ - --non-interactive \ - --no-redirect \ - --agree-tos \ - --register-unsafely-without-email \ - --debug \ - -vv \ - "$@" + omit_patterns="*/*.egg-info/*,*/dns_common*,*/setup.py,*/test_*,*/tests/*" + omit_patterns="$omit_patterns,*_test.py,*_test_*," + omit_patterns="$omit_patterns,certbot-compatibility-test/*,certbot-dns*/" + coverage run \ + --append \ + --source $sources \ + --omit $omit_patterns \ + $(command -v certbot) \ + --server "${SERVER:-http://localhost:4000/directory}" \ + --no-verify-ssl \ + --tls-sni-01-port $tls_sni_01_port \ + --http-01-port $http_01_port \ + --manual-public-ip-logging-ok \ + $store_flags \ + --non-interactive \ + --no-redirect \ + --agree-tos \ + --register-unsafely-without-email \ + --debug \ + -vv \ + "$@" }