test: less fragile integration suite [ci skip]

See coop-cloud/organising#584
See coop-cloud/organising#595
This commit is contained in:
2024-06-22 16:40:07 +02:00
parent a9ce2106c6
commit 2014cd6622
39 changed files with 249 additions and 425 deletions

View File

@ -16,6 +16,11 @@ setup(){
_common_setup
}
teardown(){
_reset_recipe
_reset_tags
}
@test "validate recipe argument" {
run $ABRA recipe sync --no-input
assert_failure
@ -40,8 +45,6 @@ setup(){
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
assert_success
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
_checkout_recipe
}
@test "detect unstaged label changes" {
@ -54,12 +57,11 @@ setup(){
run $ABRA recipe sync "$TEST_RECIPE" --patch
assert_success
assert_output --partial 'is already set, nothing to do?'
_checkout_recipe
}
# NOTE(d1): relies on only 3 versions being published for the $TEST_RECIPE.
@test "sync patch label bump" {
_ensure_latest_version "0.3.0+1.21.0"
run $ABRA recipe upgrade "$TEST_RECIPE" --no-input --patch
assert_success
@ -72,12 +74,12 @@ setup(){
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" diff
assert_success
assert_output --partial 'coop-cloud.${STACK_NAME}.version=0.2.1+1.21.6'
_checkout_recipe
assert_output --regexp 'coop-cloud\.\$\{STACK_NAME\}\.version=0\.3\.1\+1\.2.*'
}
@test "sync minor label bump" {
_ensure_latest_version "0.3.0+1.21.0"
run $ABRA recipe upgrade "$TEST_RECIPE" --no-input --minor
assert_success
@ -90,9 +92,7 @@ setup(){
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" diff
assert_success
assert_output --regexp 'coop-cloud\.\$\{STACK_NAME\}\.version=0\.2\.0\+1\.2.*'
_checkout_recipe
assert_output --regexp 'coop-cloud\.\$\{STACK_NAME\}\.version=0\.4\.0\+1\.2.*'
}
@test "error if --no-input and no initial version" {
@ -102,8 +102,6 @@ setup(){
assert_failure
assert_output --partial 'unable to continue'
assert_output --partial 'initial version'
_reset_tags
}
@test "output label sync only once" {
@ -118,6 +116,4 @@ setup(){
assert_success
assert_line --index 0 --partial 'synced label'
refute_line --index 1 --partial 'synced label'
_checkout_recipe
}