From e891d7c8e86b344af705580c9049d59570bed6f3 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Mon, 22 Nov 2021 10:18:02 -0800 Subject: [PATCH] change(docker): allow run-pytests to collect coverage Additionally fix up the argument parsing to be a bit less flexible. Signed-off-by: Kevin Morris --- docker/scripts/run-pytests.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docker/scripts/run-pytests.sh b/docker/scripts/run-pytests.sh index 2eadee42..d8c093d5 100755 --- a/docker/scripts/run-pytests.sh +++ b/docker/scripts/run-pytests.sh @@ -1,5 +1,4 @@ #!/bin/bash -set -eou pipefail COVERAGE=1 PARAMS=() @@ -11,13 +10,13 @@ while [ $# -ne 0 ]; do COVERAGE=0 shift ;; - -*) - echo "usage: $0 [--no-coverage] targets ..." - exit 1 + clean) + rm -f .coverage + shift ;; *) - PARAMS+=("$key") - shift + echo "usage: $0 [--no-coverage] targets ..." + exit 1 ;; esac done @@ -30,7 +29,7 @@ pytest # By default, report coverage and move it into cache. if [ $COVERAGE -eq 1 ]; then - make -C test coverage + make -C test coverage || /bin/true # /data is mounted as a volume. Copy coverage into it. # Users can then sanitize the coverage locally in their