forked from toolshed/abra
test: moar integration tests [ci skip]
This commit is contained in:
98
tests/integration/app_volume.bats
Normal file
98
tests/integration/app_volume.bats
Normal file
@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
setup_file(){
|
||||
load "$PWD/tests/integration/helpers/common"
|
||||
_common_setup
|
||||
_add_server
|
||||
_new_app
|
||||
}
|
||||
|
||||
teardown_file(){
|
||||
_rm_app
|
||||
_rm_server
|
||||
}
|
||||
|
||||
setup(){
|
||||
load "$PWD/tests/integration/helpers/common"
|
||||
_common_setup
|
||||
}
|
||||
|
||||
@test "ls validate app argument" {
|
||||
run $ABRA app volume ls
|
||||
assert_failure
|
||||
assert_output --partial 'no app provided'
|
||||
|
||||
run $ABRA app volume ls DOESNTEXIST
|
||||
assert_failure
|
||||
assert_output --partial 'cannot find app'
|
||||
}
|
||||
|
||||
@test "list no volumes" {
|
||||
run $ABRA app volume ls "$TEST_APP_DOMAIN"
|
||||
assert_success
|
||||
assert_output --partial 'no volumes created'
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "list volumes" {
|
||||
_deploy_app
|
||||
|
||||
run $ABRA app volume ls "$TEST_APP_DOMAIN"
|
||||
assert_success
|
||||
assert_output --partial 'test-volume'
|
||||
|
||||
_undeploy_app
|
||||
}
|
||||
|
||||
@test "rm validate app argument" {
|
||||
run $ABRA app volume rm
|
||||
assert_failure
|
||||
assert_output --partial 'no app provided'
|
||||
|
||||
run $ABRA app volume rm DOESNTEXIST
|
||||
assert_failure
|
||||
assert_output --partial 'cannot find app'
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "rm error if deployed" {
|
||||
_deploy_app
|
||||
|
||||
run $ABRA app volume rm "$TEST_APP_DOMAIN" --force
|
||||
assert_failure
|
||||
assert_output --partial 'is still deployed'
|
||||
|
||||
_undeploy_app
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "remove volumes" {
|
||||
_deploy_app
|
||||
|
||||
_undeploy_app
|
||||
|
||||
# NOTE(d1): to let the stack come down before nuking volumes
|
||||
sleep 5
|
||||
|
||||
run $ABRA app volume rm "$TEST_APP_DOMAIN" --force
|
||||
assert_success
|
||||
assert_output --partial 'volumes removed successfully'
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "remove no volumes" {
|
||||
_deploy_app
|
||||
|
||||
_undeploy_app
|
||||
|
||||
# NOTE(d1): to let the stack come down before nuking volumes
|
||||
sleep 5
|
||||
|
||||
run $ABRA app volume rm "$TEST_APP_DOMAIN" --force
|
||||
assert_success
|
||||
assert_output --partial 'volumes removed successfully'
|
||||
|
||||
run $ABRA app volume rm "$TEST_APP_DOMAIN" --force
|
||||
assert_success
|
||||
assert_output --partial 'no volumes removed'
|
||||
}
|
Reference in New Issue
Block a user