Skip to content

Commit c3b262a

Browse files
mboersmaGabriel Monroy
authored andcommitted
feat(tests): add end-to-end acceptance test script for vagrant
1 parent 2220271 commit c3b262a

4 files changed

Lines changed: 48 additions & 3 deletions

File tree

database/tests/database_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ func TestDatabase(t *testing.T) {
1818
dockercli.RunDeisDataTest(t, "--name", "deis-database-data",
1919
"-v", "/var/lib/postgresql", "deis/base", "true")
2020
host, port := utils.HostAddress(), utils.RandomPort()
21-
fmt.Printf("--- Run deis/router:%s at %s:%s\n", tag, host, port)
22-
name := "deis-router-" + tag
21+
fmt.Printf("--- Run deis/database:%s at %s:%s\n", tag, host, port)
22+
name := "deis-database-" + tag
2323
defer cli.CmdRm("-f", name)
2424
go func() {
2525
_ = cli.CmdRm("-f", name)

tests/bin/destroy-all-vagrants.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ VMS=$(vagrant global-status | grep deis | awk '{ print $5 }')
88
for dir in $VMS; do
99
cd $dir && vagrant destroy --force
1010
done
11-
rm -rf $HOME/VirtualBox\ VMs/deis*
11+
12+
# optional commands to remove all VirtualBox vms, since sometimes they are orphaned
13+
#VBoxManage list vms | sed -n -e 's/^.* {\(.*\)}/\1/p' | xargs -L1 -i VBoxManage unregistervm {} --delete
14+
#rm -rf $HOME/VirtualBox\ VMs/deis*

tests/bin/setup-node.sh

100644100755
File mode changed.

tests/bin/test-acceptance.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
#
3+
# Preps a test environment and runs `make test-integration` with single-node vagrant.
4+
5+
echo Testing ${DEIS_TEST_APP?}...
6+
THIS_DIR=$(cd $(dirname $0); pwd) # absolute path
7+
8+
cd ${GOPATH?}/src/github.com/deis/deis
9+
echo HOST_IPADDR=${HOST_IPADDR?}
10+
echo DEISCTL_TUNNEL=${DEISCTL_TUNNEL?}
11+
12+
# Environment reset and configuration
13+
rm -rf ~/.deis
14+
ssh-add -D || eval $(ssh-agent) && ssh-add -D
15+
ssh-add ~/.vagrant.d/insecure_private_key
16+
ssh-add ~/.ssh/deis
17+
$THIS_DIR/halt-all-vagrants.sh
18+
vagrant destroy --force
19+
rm -rf tests/example-*
20+
21+
set -e
22+
23+
make build
24+
make test-components
25+
26+
if ! [[ -x deisctl ]]; then
27+
curl -sSL http://deis.io/deisctl/install.sh | sudo sh
28+
fi
29+
30+
if [[ -z "$DEIS_REGISTRY" ]]; then
31+
docker ps | grep -q registry && curl -s http://$HOST_IPADDR:5000 2>&1 >/dev/null
32+
[[ $? -eq 0 ]] || make dev-registry
33+
export DEIS_REGISTRY=$HOST_IPADDR:5000
34+
fi
35+
36+
vagrant up --provider virtualbox
37+
make push
38+
deisctl install platform
39+
deisctl start platform
40+
make test-integration
41+
deisctl uninstall platform
42+
vagrant halt

0 commit comments

Comments
 (0)