forked from toolshed/abra
test: less fragile integration suite [ci skip]
See coop-cloud/organising#584 See coop-cloud/organising#595
This commit is contained in:
@ -5,6 +5,7 @@ setup_file(){
|
||||
_common_setup
|
||||
_add_server
|
||||
|
||||
# NOTE(d1): create new app without secrets
|
||||
run $ABRA app new "$TEST_RECIPE" \
|
||||
--no-input \
|
||||
--server "$TEST_SERVER" \
|
||||
@ -19,18 +20,18 @@ teardown_file(){
|
||||
_reset_recipe
|
||||
}
|
||||
|
||||
teardown() {
|
||||
run $ABRA app secret rm "$TEST_APP_DOMAIN" --all
|
||||
_reset_app
|
||||
_reset_recipe
|
||||
_checkout_recipe
|
||||
}
|
||||
|
||||
setup(){
|
||||
load "$PWD/tests/integration/helpers/common"
|
||||
_common_setup
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_reset_recipe
|
||||
_reset_app
|
||||
|
||||
run $ABRA app secret rm "$TEST_APP_DOMAIN" --all --no-input
|
||||
}
|
||||
|
||||
@test "generate: validate arguments" {
|
||||
run $ABRA app secret generate
|
||||
assert_failure
|
||||
@ -61,29 +62,23 @@ setup(){
|
||||
assert_success
|
||||
assert_output --partial 'test_pass_one'
|
||||
assert_output --partial 'test_pass_two'
|
||||
refute_output --partial 'extra_pass'
|
||||
assert_output --partial 'false'
|
||||
refute_output --partial 'true'
|
||||
|
||||
run $ABRA app secret generate "$TEST_APP_DOMAIN" --all
|
||||
assert_success
|
||||
assert_output --partial 'test_pass_one'
|
||||
assert_output --partial 'test_pass_two'
|
||||
refute_output --partial 'extra_pass'
|
||||
|
||||
run $ABRA app secret ls "$TEST_APP_DOMAIN"
|
||||
assert_success
|
||||
assert_output --partial 'test_pass_one'
|
||||
assert_output --partial 'test_pass_two'
|
||||
refute_output --partial 'extra_pass'
|
||||
refute_output --partial 'false'
|
||||
assert_output --partial 'true'
|
||||
|
||||
run docker -c "$TEST_SERVER" secret ls
|
||||
assert_success
|
||||
assert_output --partial 'test_pass_one'
|
||||
assert_output --partial 'test_pass_two'
|
||||
refute_output --partial 'extra_pass'
|
||||
}
|
||||
|
||||
@test "generate: broken if missing version" {
|
||||
@ -150,11 +145,7 @@ setup(){
|
||||
|
||||
run $ABRA app secret generate "$TEST_APP_DOMAIN" --all --chaos
|
||||
assert_success
|
||||
assert_output --partial 'test_pass_one not enabled in recipe config'
|
||||
assert_output --partial 'test_pass_two'
|
||||
|
||||
run $ABRA app secret rm "$TEST_APP_DOMAIN" --all --chaos
|
||||
assert_success
|
||||
assert_output --partial 'test_pass_one not enabled'
|
||||
}
|
||||
|
||||
@test "generate: ensure secret name uses trimmed stack name" {
|
||||
@ -184,9 +175,6 @@ setup(){
|
||||
| jq -r ".[] | select(.name==\"test_pass_two\") | .value" | awk "{print length}"'
|
||||
assert_success
|
||||
assert_output --partial '10' # NOTE(d1): hardcoded # length=10 in recipe config
|
||||
|
||||
run $ABRA app secret rm "$TEST_APP_DOMAIN" --all
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "insert: validate arguments" {
|
||||
@ -228,11 +216,12 @@ setup(){
|
||||
|
||||
run bash -c "echo bar >> $ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||
|
||||
run $ABRA app secret insert --file "$TEST_APP_DOMAIN" test_pass_one v1 "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||
run $ABRA app secret insert \
|
||||
--file "$TEST_APP_DOMAIN" test_pass_one v1 "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||
assert_success
|
||||
assert_output --partial 'successfully stored on server'
|
||||
|
||||
run $ABRA app secret ls "$TEST_APP_DOMAIN"
|
||||
run $ABRA app secret ls "$TEST_APP_DOMAIN" --chaos
|
||||
assert_success
|
||||
assert_output --partial 'true'
|
||||
}
|
||||
|
Reference in New Issue
Block a user