forked from toolshed/abra
fix-integration-tests (!403)
In preparation for the new abra release, let's fix all integration tests After merging, this needs to be cherry-picked into the release-0-9 branch. - [x] app_backup.bats (skip this one) - [x] app_check.bats (fixed bybd21014fed
) - [x] app_cmd.bats (partially fixed in08232b74f6
), has known regression coop-cloud/organising#581 - [x] app_config.bats (no changes needed) - [x] app_cp.bats (no changes needed) - [x] app_deploy.bats - [x] app_errors.bats (no changes needed) - [x] app_list.bats (no changes needed) - [x] app_logs.bats (no changes needed) - [x] app_new.bats (no changes needed) - [x] app_ps.bats (no changes needed) - [x] app_remove.bats (fixed by [2f29fbeb2e](coop-cloud/abra#403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](coop-cloud/abra#403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by6e99b74c24
) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed bybd069d32f6
) - [x] app_services.bats (no changes needed) - [x] app_undeploy.bats (no changes needed) - [x] app_upgrade.bats (no changes needed) - [x] app_version.bats (partially fixed byad323ad2bd
) - [x] app_volume.bats (fixed by [03c3823770](coop-cloud/abra#403/commits/03c38237707ae795b723180eb07a7edc84a8de35)) - [x] autocomplete.bats (no changes needed) - [x] catalogue.bats (no changes needed) - [x] dirs.bats (no changes needed) - [x] install.bats (failes, but is expected) - [x] recipe_diff.bats (no changes needed) - [x] recipe_fetch.bats (no changes needed) - [x] recipe_lint.bats (fixed by [b6b0808066](coop-cloud/abra#403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](coop-cloud/abra#403/commits/0aac464ded6b43afb3ec37ade2f64d6191b9838f)) - [x] recipe_release.bats (no changes needed) - [x] recipe_reset.bats (no changes needed) - [x] recipe_sync.bats (no changes needed) - [x] recipe_upgrade.bats (fixed by [ab86904cf4](coop-cloud/abra#403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by81897bf4da
) - [x] server_add.bats - [x] server_list.bats - [x] server_prune.bats (no changes needed) - [x] server_remove.bats - [x] upgrade.bats - [x] version.bats (no changes needed) Co-authored-by: decentral1se <cellarspoon@riseup.net> Reviewed-on: coop-cloud/abra#403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
This commit is contained in:
@ -58,7 +58,7 @@ test_cmd_export"
|
||||
assert_success
|
||||
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local
|
||||
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
|
||||
assert_success
|
||||
assert_output --partial 'baz'
|
||||
|
||||
@ -70,7 +70,7 @@ test_cmd_export"
|
||||
assert_success
|
||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local
|
||||
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
|
||||
assert_failure
|
||||
assert_output --partial 'locally unstaged changes'
|
||||
|
||||
@ -83,7 +83,7 @@ test_cmd_export"
|
||||
assert_success
|
||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --chaos
|
||||
run $ABRA app cmd --local --chaos "$TEST_APP_DOMAIN" test_cmd
|
||||
assert_success
|
||||
assert_output --partial 'baz'
|
||||
|
||||
@ -96,14 +96,14 @@ test_cmd_export"
|
||||
assert_success
|
||||
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||
assert_output --partial 'behind 3'
|
||||
assert_output --regexp 'behind .* 3 commits'
|
||||
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local
|
||||
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
|
||||
refute_output --partial 'behind 3'
|
||||
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 'behind 3'
|
||||
assert_output --regexp 'behind .* 3 commits'
|
||||
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --offline
|
||||
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 'behind 3'
|
||||
assert_output --regexp 'behind .* 3 commits'
|
||||
|
||||
_reset_recipe "$TEST_RECIPE"
|
||||
}
|
||||
@ -132,13 +132,13 @@ test_cmd_export"
|
||||
}
|
||||
|
||||
@test "error if missing arguments when passing --local" {
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" --local
|
||||
run $ABRA app cmd --local "$TEST_APP_DOMAIN"
|
||||
assert_failure
|
||||
assert_output --partial 'missing arguments'
|
||||
}
|
||||
|
||||
@test "cannot use --local and --user at same time" {
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --user root
|
||||
run $ABRA app cmd --local --user root "$TEST_APP_DOMAIN" test_cmd
|
||||
assert_failure
|
||||
assert_output --partial 'cannot use --local & --user together'
|
||||
}
|
||||
@ -147,7 +147,7 @@ test_cmd_export"
|
||||
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh"
|
||||
assert_success
|
||||
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --chaos
|
||||
run $ABRA app cmd --local --chaos "$TEST_APP_DOMAIN" test_cmd
|
||||
assert_failure
|
||||
assert_output --partial "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh does not exist"
|
||||
|
||||
@ -155,25 +155,25 @@ test_cmd_export"
|
||||
}
|
||||
|
||||
@test "error if missing command" {
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" doesnt_exist --local
|
||||
run $ABRA app cmd --local "$TEST_APP_DOMAIN" doesnt_exist
|
||||
assert_failure
|
||||
assert_output --partial "doesn't have a doesnt_exist function"
|
||||
}
|
||||
|
||||
@test "run --local command" {
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local
|
||||
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
|
||||
assert_success
|
||||
assert_output --partial 'baz'
|
||||
}
|
||||
|
||||
@test "run command with single arg" {
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd_arg --local -- bing
|
||||
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd_arg -- bing
|
||||
assert_success
|
||||
assert_output --partial 'bing'
|
||||
}
|
||||
|
||||
@test "run command with several args" {
|
||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd_args --local -- bong bang
|
||||
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd_args -- bong bang
|
||||
assert_success
|
||||
assert_output --partial 'bong bang'
|
||||
}
|
||||
|
Reference in New Issue
Block a user