Skip to content

Commit 5cd5f6d

Browse files
committed
feat(tests): keep test instances with SKIP_CLEANUP=true
1 parent 32d848f commit 5cd5f6d

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

tests/bin/test-integration-ec2.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY?}
2121
pip install awscli boto docopt
2222

2323
function cleanup_ec2 {
24-
log_phase "Cleaning up"
25-
aws cloudformation delete-stack --stack-name $STACK_NAME
26-
python $DEIS_ROOT/contrib/ec2/route53-wildcard.py delete $DEIS_TEST_DOMAIN $ELB_DNS_NAME
24+
if [ "$SKIP_CLEANUP" != true ]; then
25+
log_phase "Cleaning up"
26+
aws cloudformation delete-stack --stack-name $STACK_NAME
27+
python $DEIS_ROOT/contrib/ec2/route53-wildcard.py delete $DEIS_TEST_DOMAIN $ELB_DNS_NAME
28+
fi
2729
}
2830

2931
# setup callbacks on process exit and error

tests/bin/test-setup.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ ssh-add $DEIS_TEST_SSH_KEY
8787

8888
# wipe out all vagrants & deis virtualboxen
8989
function cleanup {
90-
log_phase "Cleaning up"
91-
set +e
92-
${GOPATH}/src/github.com/deis/deis/tests/bin/destroy-all-vagrants.sh
93-
VBoxManage list vms | grep deis | sed -n -e 's/^.* {\(.*\)}/\1/p' | xargs -L1 -I {} VBoxManage unregistervm {} --delete
94-
vagrant global-status --prune
95-
docker rm -f -v `docker ps | grep deis- | awk '{print $1}'` 2>/dev/null
96-
log_phase "Test run complete"
90+
if [ "$SKIP_CLEANUP" != true ]; then
91+
log_phase "Cleaning up"
92+
set +e
93+
${GOPATH}/src/github.com/deis/deis/tests/bin/destroy-all-vagrants.sh
94+
VBoxManage list vms | grep deis | sed -n -e 's/^.* {\(.*\)}/\1/p' | xargs -L1 -I {} VBoxManage unregistervm {} --delete
95+
vagrant global-status --prune
96+
docker rm -f -v `docker ps | grep deis- | awk '{print $1}'` 2>/dev/null
97+
log_phase "Test run complete"
98+
fi
9799
}
98100

99101
function dump_logs {

0 commit comments

Comments
 (0)