test: fixups for the change-pocalypse #433

Merged
decentral1se merged 1 commits from int-fixes into main 2024-07-09 07:42:41 +00:00
10 changed files with 22 additions and 23 deletions

View File

@ -103,7 +103,7 @@ teardown(){
run $ABRA app check "$TEST_APP_DOMAIN" --chaos run $ABRA app check "$TEST_APP_DOMAIN" --chaos
assert_failure assert_failure
assert_output --partial '.env.sample does not exist?' assert_output --partial 'unable to discover .env.sample'
} }
@test "error if missing env var" { @test "error if missing env var" {

View File

@ -53,10 +53,13 @@ teardown(){
# bats test_tags=slow # bats test_tags=slow
@test "show ps report with chaos deploy" { @test "show ps report with chaos deploy" {
run $ABRA app deploy "$TEST_APP_DOMAIN" \ run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input --chaos
--no-input --no-converge-checks --chaos
assert_success assert_success
headHash=$(_get_head_hash)
run $ABRA app ps "$TEST_APP_DOMAIN"
assert_success
assert_output --partial "$latestRelease" assert_output --partial "$latestRelease"
assert_output --partial 'true' # is a chaos deploy assert_output --partial "${headHash:0:8}" # is a chaos deploy
} }

View File

@ -86,7 +86,7 @@ teardown(){
run $ABRA app rollback "$TEST_APP_DOMAIN" --no-input --no-converge-checks run $ABRA app rollback "$TEST_APP_DOMAIN" --no-input --no-converge-checks
assert_success assert_success
assert_output --partial "you're on oldest" assert_output --partial "no available downgrades"
} }
# bats test_tags=slow # bats test_tags=slow

View File

@ -39,8 +39,11 @@ teardown(){
# bats test_tags=slow # bats test_tags=slow
@test "undeploy app" { @test "undeploy app" {
_deploy_app run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input
_undeploy_app assert_success
run $ABRA app undeploy "$TEST_APP_DOMAIN" --no-input
assert_success
# NOTE(d1): ensure not chaos undeploy # NOTE(d1): ensure not chaos undeploy
assert_output --partial 'false' assert_output --partial 'false'

View File

@ -49,7 +49,7 @@ teardown(){
run $ABRA app upgrade "$TEST_APP_DOMAIN" --no-input --no-converge-checks run $ABRA app upgrade "$TEST_APP_DOMAIN" --no-input --no-converge-checks
assert_success assert_success
assert_output --partial "you're on latest" assert_output --partial "no available upgrades"
} }
# bats test_tags=slow # bats test_tags=slow

View File

@ -40,12 +40,3 @@ setup(){
assert_not_exists "$ABRA_DIR/catalogue" assert_not_exists "$ABRA_DIR/catalogue"
} }
@test "catalogue recipe is a git repository" {
run $ABRA recipe fetch "$TEST_RECIPE"
assert_success
assert_output --partial 'local recipe catalogue is missing'
assert_exists "$ABRA_DIR/catalogue"
assert_exists "$ABRA_DIR/catalogue/.git"
}

View File

@ -29,7 +29,7 @@ teardown() {
run $ABRA recipe release DOESNTEXIST --no-input run $ABRA recipe release DOESNTEXIST --no-input
assert_failure assert_failure
assert_output --partial 'unable to validate recipe' assert_output --partial 'unable to clone DOESNTEXIST'
} }
@test "release patch bump" { @test "release patch bump" {

View File

@ -28,7 +28,7 @@ teardown(){
run $ABRA recipe sync DOESNTEXIST --no-input run $ABRA recipe sync DOESNTEXIST --no-input
assert_failure assert_failure
assert_output --partial 'unable to validate recipe' assert_output --partial 'unable to clone DOESNTEXIST'
} }
@test "allow unstaged changes" { @test "allow unstaged changes" {

View File

@ -28,7 +28,7 @@ teardown(){
run $ABRA recipe upgrade DOESNTEXIST --no-input run $ABRA recipe upgrade DOESNTEXIST --no-input
assert_failure assert_failure
assert_output --partial 'unable to validate recipe' assert_output --partial 'unable to clone DOESNTEXIST'
} }
@test "retrieve recipe if missing" { @test "retrieve recipe if missing" {

View File

@ -11,10 +11,12 @@ setup() {
assert_output --partial '2.3.2+1.20.3-rootless' assert_output --partial '2.3.2+1.20.3-rootless'
} }
@test "error if not present in catalogue" { @test "local tags used if no catalogue entry" {
latestRelease=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -l | tail -n 1)
run $ABRA recipe versions "$TEST_RECIPE" run $ABRA recipe versions "$TEST_RECIPE"
assert_failure assert_success
assert_output --partial "is not published on the catalogue" assert_output --partial "$latestRelease"
} }
@test "versions listed in correct order" { @test "versions listed in correct order" {