add test for ps:restore with undeployed app. refs #2171

This commit is contained in:
Michael Hobbs committed 2016-05-10 09:30:55 -07:00
1 parent 99030a110c
commit 7de160b64d
2 files changed
+44 -10

No files matched your search

+42 -10
View File
@@ -8,18 +8,19 @@ setup() {
teardown() { teardown() {
destroy_app destroy_app
destroy_app 0 "$MYAPP" || true
} }
# @test "(ps) herokuish" { @test "(ps) herokuish" {
# # CI support: 'Ah. I just spoke with our Docker expert -- # CI support: 'Ah. I just spoke with our Docker expert --
# # looks like docker exec is built to work with docker-under-libcontainer, # looks like docker exec is built to work with docker-under-libcontainer,
# # but we're using docker-under-lxc. I don't have an estimated time for the fix, sorry # but we're using docker-under-lxc. I don't have an estimated time for the fix, sorry
# skip "circleci does not support docker exec at the moment." skip "circleci does not support docker exec at the moment."
# run bash -c "dokku ps $TEST_APP | grep -q \"node web.js\"" run bash -c "dokku ps $TEST_APP | grep -q \"node web.js\""
# echo "output: "$output echo "output: "$output
# echo "status: "$status echo "status: "$status
# assert_success assert_success
# } }
@test "(ps) herokuish" { @test "(ps) herokuish" {
deploy_app deploy_app
@@ -123,3 +124,34 @@ teardown() {
assert_success assert_success
done done
} }
@test "(ps:restore) herokuish" {
MYAPP="manual-randomtestapp-1"
create_app "$MYAPP"
deploy_app
run bash -c "dokku ps:stop $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku apps"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku ps:restore"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku ls"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku --quiet ls | grep $TEST_APP | grep -q running"
echo "output: "$output
echo "status: "$status
assert_success
}
+2
View File
@@ -113,11 +113,13 @@ assert_exit_status() {
# dokku functions # dokku functions
create_app() { create_app() {
local APP="$1"; local TEST_APP=${APP:=$TEST_APP}
dokku apps:create "$TEST_APP" dokku apps:create "$TEST_APP"
} }
destroy_app() { destroy_app() {
local RC="$1"; local RC=${RC:=0} local RC="$1"; local RC=${RC:=0}
local APP="$2"; local TEST_APP=${APP:=$TEST_APP}
dokku --force apps:destroy "$TEST_APP" dokku --force apps:destroy "$TEST_APP"
return "$RC" return "$RC"
} }