-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·62 lines (50 loc) · 1.66 KB
/
test.sh
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
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
set -o errexit
start() { echo travis_fold':'start:$1; echo $1; }
end() { echo travis_fold':'end:$1; }
die() { set +v; echo "$*" 1>&2 ; sleep 1; exit 1; }
# Race condition truncates logs on Travis: "sleep" might help.
# https://github.com/travis-ci/travis-ci/issues/6018
start preflight
docker info
docker info | grep 'Operating System' \
|| die 'Make sure Docker is running'
if which kubectl; then
kubectl cluster-info
kubectl get pods
[ -z "`kubectl get pods`" ] \
|| die 'Kill pods before running tests: "kubectl delete pods --all"' # Can take a while...
fi
# Running locally, Kubernetes housekeeping containers are inside the VM.
# On Travis, there is no VM, so Docker will see Kubernetes containers.
# For now, "grep -v kube" seems to exclude them all,
# and "tail" excludes the header.
docker ps -a
[ -z "`docker ps -a | grep -v kube | tail -n +2`" ] \
|| die 'Kill containers before running tests: "docker ps -qa | xargs docker stop | xargs docker rm"'
end preflight
start doctest
python doctest_runner.py --$TARGET
end doctest
#start coverage
#echo; echo 'Tests:'
#COVERAGE_FILE=.coverage.test coverage report
#echo; echo 'Doctests:'
#COVERAGE_FILE=.coverage.doctest coverage report
#echo; echo 'Union:'
#coverage combine
#coverage report --fail-under 100
#end coverage
start docker
docker system df
# TODO: Make assertions about the disk usage we would expect to see.
end docker
start format
flake8 --exclude build . || die "Run 'autopep8 --in-place -r .'"
end format
start isort
isort --recursive . --verbose --check-only || die "See ERRORs: Run 'isort --recursive .'"
end isort
start wheel
python setup.py sdist bdist_wheel
end wheel