-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest-acceptance.sh
More file actions
executable file
·123 lines (93 loc) · 2.36 KB
/
test-acceptance.sh
File metadata and controls
executable file
·123 lines (93 loc) · 2.36 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
#
# Preps a test environment and runs `make test-integration`
# against artifacts produced from the current source tree
#
# fail on any command exiting non-zero
set -eo pipefail
# absolute path to current directory
export THIS_DIR=$(cd $(dirname $0); pwd)
# setup the test environment
source $THIS_DIR/test-setup.sh
# setup callbacks on process exit and error
trap cleanup EXIT
trap dump_logs ERR
echo
echo "Running test-acceptance..."
echo
# test building documentation
make -C docs/ test
echo
echo "Building from current source tree..."
echo
# build all docker images and client binaries
make build
# use the built client binaries
export PATH=$DEIS_ROOT/deisctl:$DEIS_ROOT/client/dist:$PATH
echo
echo "Running unit and functional tests..."
echo
make test-components
echo
echo "Provisioning 3-node CoreOS..."
echo
export DEIS_NUM_INSTANCES=3
git checkout $DEIS_ROOT/contrib/coreos/user-data
make discovery-url
vagrant up --provider virtualbox
echo
echo "Waiting for etcd/fleet..."
until deisctl list >/dev/null 2>&1; do
sleep 1
done
echo
echo "Provisioning Deis on old release..."
echo
function set_release {
deisctl config $1 set image=deis/$1:$2
}
set_release logger ${OLD_TAG}
set_release cache ${OLD_TAG}
set_release router ${OLD_TAG}
set_release database ${OLD_TAG}
set_release controller ${OLD_TAG}
set_release registry ${OLD_TAG}
deisctl install platform
deisctl scale router=3
deisctl start router@1 router@2 router@3
time deisctl start platform
echo
echo "Running smoke tests..."
echo
time make test-smoke
echo
echo "Publishing new release..."
echo
time make release
echo
echo "Updating channel with new release..."
echo
updateservicectl channel update --app-id=${APP_ID} --channel=${CHANNEL} --version=${BUILD_TAG} --publish=true
echo
echo "Waiting for upgrade to complete..."
echo
deisctl config platform channel=${CHANNEL} autoupdate=true
function wait_for_update {
set -x
vagrant ssh $1 -c "journalctl -n 500 -u deis-updater.service -f" &
pid_$1=$!
vagrant ssh $1 -c "/bin/sh -c \"while [[ \"\$(cat /etc/deis-version)\" != \"${BUILD_TAG}\" ]]; do echo waiting for update to complete...; sleep 5; done\""
kill $pid_$1
set +x
}
wait_for_update deis-1 &
update1=$!
wait_for_update deis-2 &
update2=$!
wait_for_update deis-3 &
update3=$!
wait update1 update2 update3
echo
echo "Running end-to-end integration test..."
echo
time make test-integration