mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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 <kevr@0cost.org>
This commit is contained in:
parent
34747359ba
commit
e891d7c8e8
1 changed files with 6 additions and 7 deletions
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eou pipefail
|
|
||||||
|
|
||||||
COVERAGE=1
|
COVERAGE=1
|
||||||
PARAMS=()
|
PARAMS=()
|
||||||
|
@ -11,13 +10,13 @@ while [ $# -ne 0 ]; do
|
||||||
COVERAGE=0
|
COVERAGE=0
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-*)
|
clean)
|
||||||
echo "usage: $0 [--no-coverage] targets ..."
|
rm -f .coverage
|
||||||
exit 1
|
shift
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
PARAMS+=("$key")
|
echo "usage: $0 [--no-coverage] targets ..."
|
||||||
shift
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
@ -30,7 +29,7 @@ pytest
|
||||||
|
|
||||||
# By default, report coverage and move it into cache.
|
# By default, report coverage and move it into cache.
|
||||||
if [ $COVERAGE -eq 1 ]; then
|
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.
|
# /data is mounted as a volume. Copy coverage into it.
|
||||||
# Users can then sanitize the coverage locally in their
|
# Users can then sanitize the coverage locally in their
|
||||||
|
|
Loading…
Add table
Reference in a new issue