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:
@ -19,13 +19,12 @@ setup() {
|
||||
}
|
||||
|
||||
teardown(){
|
||||
# https://github.com/bats-core/bats-core/issues/383#issuecomment-738628888
|
||||
if [[ -z "${BATS_TEST_COMPLETED}" ]]; then
|
||||
_undeploy_app
|
||||
fi
|
||||
_undeploy_app
|
||||
}
|
||||
|
||||
@test "retrieve recipe if missing" {
|
||||
skip "https://git.coopcloud.tech/coop-cloud/organising/issues/583"
|
||||
|
||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
|
||||
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
@ -39,6 +38,8 @@ teardown(){
|
||||
}
|
||||
|
||||
@test "bail if unstaged changes and no --chaos" {
|
||||
skip "https://git.coopcloud.tech/coop-cloud/organising/issues/583"
|
||||
|
||||
run bash -c "echo foo >> $ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||
assert_success
|
||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||
@ -59,6 +60,8 @@ teardown(){
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "do not bail if unstaged changes and --chaos" {
|
||||
skip "https://git.coopcloud.tech/coop-cloud/organising/issues/583"
|
||||
|
||||
run bash -c 'echo "unstaged changes" >> "$ABRA_DIR/recipes/$TEST_RECIPE/foo"'
|
||||
assert_success
|
||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||
@ -81,6 +84,8 @@ teardown(){
|
||||
}
|
||||
|
||||
@test "ensure recipe up to date if no --offline" {
|
||||
skip "https://git.coopcloud.tech/coop-cloud/organising/issues/583"
|
||||
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" reset --hard HEAD~3
|
||||
assert_success
|
||||
|
||||
@ -98,6 +103,8 @@ teardown(){
|
||||
}
|
||||
|
||||
@test "ensure recipe not up to date if --offline" {
|
||||
skip "https://git.coopcloud.tech/coop-cloud/organising/issues/583"
|
||||
|
||||
latestCommit="$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" rev-parse --short HEAD)"
|
||||
refute [ -z "$latestCommit" ];
|
||||
|
||||
@ -124,6 +131,8 @@ teardown(){
|
||||
}
|
||||
|
||||
@test "detect backup labels" {
|
||||
skip "https://git.coopcloud.tech/coop-cloud/organising/issues/583"
|
||||
|
||||
run $ABRA app backup "$TEST_APP_DOMAIN" --debug
|
||||
assert_failure
|
||||
assert_output --partial 'no containers matching'
|
||||
@ -134,6 +143,8 @@ teardown(){
|
||||
}
|
||||
|
||||
@test "error if backups not enabled" {
|
||||
skip "https://git.coopcloud.tech/coop-cloud/organising/issues/583"
|
||||
|
||||
run sed -i '/backupbot.backup=true/d' "$ABRA_DIR/recipes/$TEST_RECIPE/compose.yml"
|
||||
assert_success
|
||||
|
||||
@ -145,6 +156,8 @@ teardown(){
|
||||
}
|
||||
|
||||
@test "error if backup paths not configured" {
|
||||
skip "https://git.coopcloud.tech/coop-cloud/organising/issues/583"
|
||||
|
||||
run sed -i '/backupbot.backup.path=.*/d' "$ABRA_DIR/recipes/$TEST_RECIPE/compose.yml"
|
||||
assert_success
|
||||
|
||||
@ -157,6 +170,8 @@ teardown(){
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "backup single service" {
|
||||
skip "https://git.coopcloud.tech/coop-cloud/organising/issues/583"
|
||||
|
||||
_deploy_app
|
||||
|
||||
run $ABRA app backup "$TEST_APP_DOMAIN" app
|
||||
|
Reference in New Issue
Block a user