From a760280564daefe100251f2000cb69407708557d Mon Sep 17 00:00:00 2001 From: p4u1 Date: Mon, 4 Mar 2024 16:31:11 +0100 Subject: [PATCH] changes git message asserts --- tests/integration/app_check.bats | 4 ++-- tests/integration/app_cmd.bats | 8 ++++---- tests/integration/app_new.bats | 10 +++++----- tests/integration/app_restore.bats | 8 ++++---- tests/integration/app_rollback.bats | 8 ++++---- tests/integration/recipe_lint.bats | 8 ++++---- tests/integration/recipe_upgrade.bats | 4 ++-- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/integration/app_check.bats b/tests/integration/app_check.bats index e286a5ed..e296e3cb 100644 --- a/tests/integration/app_check.bats +++ b/tests/integration/app_check.bats @@ -70,13 +70,13 @@ setup(){ assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA app check "$TEST_APP_DOMAIN" assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - refute_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' _reset_recipe } diff --git a/tests/integration/app_cmd.bats b/tests/integration/app_cmd.bats index 648d7cc3..fd5e6695 100644 --- a/tests/integration/app_cmd.bats +++ b/tests/integration/app_cmd.bats @@ -96,14 +96,14 @@ test_cmd_export" assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd assert_success assert_output --partial 'baz' run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is up to date with 'origin/main'" + assert_output --partial "up to date" _reset_recipe "$TEST_RECIPE" } @@ -113,14 +113,14 @@ test_cmd_export" assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA app cmd --local --offline "$TEST_APP_DOMAIN" test_cmd assert_success assert_output --partial 'baz' run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' _reset_recipe "$TEST_RECIPE" } diff --git a/tests/integration/app_new.bats b/tests/integration/app_new.bats index 885e02cd..457ee152 100644 --- a/tests/integration/app_new.bats +++ b/tests/integration/app_new.bats @@ -45,7 +45,7 @@ teardown(){ assert_exists "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is up to date with 'origin/main'." + assert_output --partial "up to date" } @test "create new app with version" { @@ -121,7 +121,7 @@ teardown(){ assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits, and can be fast-forwarded." + assert_output --regexp 'behind .* 3 commits' run $ABRA app new "$TEST_RECIPE" \ --no-input \ @@ -131,7 +131,7 @@ teardown(){ assert_exists "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is up to date with 'origin/main'." + assert_output --partial "up to date" _reset_recipe } @@ -141,7 +141,7 @@ teardown(){ assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits, and can be fast-forwarded." + assert_output --regexp 'behind .* 3 commits' # NOTE(d1): need to use --chaos to force same commit run $ABRA app new "$TEST_RECIPE" \ @@ -154,7 +154,7 @@ teardown(){ assert_exists "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits, and can be fast-forwarded." + assert_output --regexp 'behind .* 3 commits' _reset_recipe } diff --git a/tests/integration/app_restore.bats b/tests/integration/app_restore.bats index eed588c0..f2cf52e8 100644 --- a/tests/integration/app_restore.bats +++ b/tests/integration/app_restore.bats @@ -109,13 +109,13 @@ teardown(){ assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA app restore "$TEST_APP_DOMAIN" app assert_failure run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is up to date with 'origin/main'" + assert_output --partial "up to date" } @test "ensure recipe not up to date if --offline" { @@ -126,13 +126,13 @@ teardown(){ assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA app restore "$TEST_APP_DOMAIN" app --offline assert_failure run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" checkout "$latestCommit" assert_success diff --git a/tests/integration/app_rollback.bats b/tests/integration/app_rollback.bats index d8c2b9ed..093692ed 100644 --- a/tests/integration/app_rollback.bats +++ b/tests/integration/app_rollback.bats @@ -50,13 +50,13 @@ teardown(){ assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA app rollback "$TEST_APP_DOMAIN" --no-input --no-converge-checks assert_failure run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is up to date with 'origin/main'" + assert_output --partial "up to date" } @test "ensure recipe not up to date if --offline" { @@ -67,14 +67,14 @@ teardown(){ assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA app rollback "$TEST_APP_DOMAIN" \ --no-input --no-converge-checks --offline assert_failure run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" checkout "$latestCommit" assert_success diff --git a/tests/integration/recipe_lint.bats b/tests/integration/recipe_lint.bats index 1f1ba5c1..401ab8fd 100644 --- a/tests/integration/recipe_lint.bats +++ b/tests/integration/recipe_lint.bats @@ -66,13 +66,13 @@ setup() { assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA recipe lint "$TEST_RECIPE" assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - refute_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' _reset_recipe } @@ -82,13 +82,13 @@ setup() { assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA recipe lint "$TEST_RECIPE" --offline assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' _reset_recipe } diff --git a/tests/integration/recipe_upgrade.bats b/tests/integration/recipe_upgrade.bats index b1d2020f..a36efe26 100644 --- a/tests/integration/recipe_upgrade.bats +++ b/tests/integration/recipe_upgrade.bats @@ -61,14 +61,14 @@ setup(){ assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' run $ABRA recipe upgrade "$TEST_RECIPE" --no-input assert_success assert_output --partial 'can upgrade service: app' run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - refute_output --partial "Your branch is behind 'origin/main' by 3 commits" + assert_output --regexp 'behind .* 3 commits' _reset_recipe }