forked from projectatomic/atomic-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ci-test.sh
executable file
·58 lines (43 loc) · 1.2 KB
/
.ci-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
#!/bin/bash
# Pretend like we're Travis so that scripts behave accordingly.
export TRAVIS=true
# NB: set to true to test assets, false otherwise
export TEST_ASSETS=false
echo "GOPATH = $GOPATH"
echo "PATH = $PATH"
go version
go env
cd $GOPATH/src/github.com/projectatomic/atomic-enterprise
# overall job status
failed=false
# run the passed command and capture output in a log
log_eval() {
echo "RUNNING: $@" | tee -a $HOME/log
eval $@ &>> $HOME/log
if [ $? == 0 ]; then
res=PASSED
else
res=FAILED
failed=true
fi
echo "$res: $@" | tee -a $HOME/log
}
# installs
log_eval ./hack/verify-jsonformat.sh
log_eval ./hack/install-etcd.sh
log_eval ./hack/install-std-race.sh
log_eval ./hack/install-tools.sh
log_eval ./hack/build-go.sh
log_eval ./hack/install-assets.sh
# tests
# NB: because of the eval in log_eval(), we want to escape the quotes so that
# they don't reduce to nothing, which will cause that argument to be skipped
# when passed to test-go.sh as $(WHAT) (see the Makefile).
# XXX: using make check, instead of make check-test for now.
log_eval \
PATH=./_output/etcd/bin:$PATH \
make check WHAT="\'\'" TESTFLAGS="-p=4"
log_eval ./hack/test-assets.sh
if [ "$failed" = true ]; then
exit 1
fi