From e116148c49483f26313a3ff934e29ebb6626ee53 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 20 Sep 2023 14:15:43 +0200 Subject: [PATCH] test: ensure catalogue --chaos works [ci skip] Closes https://git.coopcloud.tech/coop-cloud/organising/issues/462. --- tests/integration/catalogue.bats | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/integration/catalogue.bats b/tests/integration/catalogue.bats index be5e8d579..369567b44 100644 --- a/tests/integration/catalogue.bats +++ b/tests/integration/catalogue.bats @@ -11,6 +11,32 @@ setup(){ assert_success } +@test "error if unstaged changes" { + run bash -c "echo foo >> $ABRA_DIR/catalogue/foo" + assert_success + assert_exists "$ABRA_DIR/catalogue/foo" + + run $ABRA catalogue generate + assert_failure + assert_output --partial 'locally unstaged changes' + + run rm -rf "$ABRA_DIR/catalogue/foo" + assert_not_exists "$ABRA_DIR/catalogue/foo" +} + +# bats test_tags=slow +@test "no error if unstaged and --chaos" { + run bash -c "echo foo >> $ABRA_DIR/catalogue/foo" + assert_success + assert_exists "$ABRA_DIR/catalogue/foo" + + run $ABRA catalogue generate gitea --chaos + assert_success + + run rm -rf "$ABRA_DIR/catalogue/foo" + assert_not_exists "$ABRA_DIR/catalogue/foo" +} + # bats test_tags=slow @test "generate only specific recipe" { run $ABRA catalogue generate gitea