-
Notifications
You must be signed in to change notification settings - Fork 51
/
run_tests
executable file
·76 lines (55 loc) · 1.61 KB
/
run_tests
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
set -euo pipefail
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
source "vendor.bash/github.com/reconquest/import.bash/import.bash"
import:use "github.com/reconquest/hastur.bash"
import:use "github.com/reconquest/containers.bash"
import:use "github.com/reconquest/progress.bash"
import:use "github.com/reconquest/test-runner.bash"
import:use "github.com/reconquest/tests.sh"
import:use "github.com/reconquest/go-test.bash"
import:use "github.com/reconquest/ssh-test.bash"
import:include tests/build.sh
import:include tests/orgalorg.sh
import:include tests/deps.sh
:deps:check
test-runner:set-custom-opts \
--keep-containers \
--keep-images \
--containers-count:
test-runner:handle-custom-opt() {
case "$1" in
--keep-containers)
containers:keep-containers
hastur:keep-images
;;
--keep-images)
hastur:keep-images
;;
--containers-count)
containers:set-count "$2"
;;
esac
}
progress:spinner:new _progress_spinner
test-runner:progress() {
if [ "${1:-}" = "stop" ]; then
printf " ok."
else
progress:spinner:spin "$_progress_spinner" > /dev/null
fi
}
:init() {
go-test:set-output-dir "$(readlink -f .)"
go-test:build orgalorg
hastur:init openssh,pam,util-linux,tar,iproute2,sudo,sed,procps-ng,systemd
}
:cleanup() {
containers:wipe
hastur:destroy-root
progress:spinner:stop "$_progress_spinner"
go-test:merge-coverage
}
:init 2> >(progress:spinner:spin "$_progress_spinner" > /dev/null)
trap :cleanup EXIT
test-runner:run "${@}"