forked from octodns/octodns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coverage
executable file
·52 lines (44 loc) · 1.01 KB
/
coverage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
set -e
cd "$(dirname "$0")/.."
if [ -z "$VENV_NAME" ]; then
VENV_NAME="env"
fi
ACTIVATE="$VENV_NAME/bin/activate"
if [ ! -f "$ACTIVATE" ]; then
echo "$ACTIVATE does not exist, run ./script/bootstrap" >&2
exit 1
fi
. "$ACTIVATE"
# Just to be sure/safe
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export CLOUDFLARE_EMAIL=
export CLOUDFLARE_TOKEN=
export DNSIMPLE_ACCOUNT=
export DNSIMPLE_TOKEN=
export DYN_CUSTOMER=
export DYN_PASSWORD=
export DYN_USERNAME=
export GOOGLE_APPLICATION_CREDENTIALS=
export ARM_CLIENT_ID=
export ARM_CLIENT_SECRET=
export ARM_TENANT_ID=
export ARM_SUBSCRIPTION_ID=
SOURCE_DIR="octodns/"
# Don't allow disabling coverage
grep -r -I --line-number "# pragma: +no.*cover" $SOURCE_DIR && {
echo "Code coverage should not be disabled"
exit 1
}
export PYTHONPATH=.:$PYTHONPATH
pytest \
--disable-network \
--cov-reset \
--cov=$SOURCE_DIR \
--cov-fail-under=100 \
--cov-report=html \
--cov-report=xml \
--cov-report=term \
--cov-branch \
"$@"