abra/tests/integration/app_cmd.bats

202 lines
4.9 KiB
Plaintext
Raw Normal View History

2023-09-07 16:50:25 +00:00
#!/usr/bin/env bash
setup_file(){
load "$PWD/tests/integration/helpers/common"
_common_setup
_add_server
_new_app
}
teardown_file(){
_rm_app
_rm_server
2023-09-25 08:52:27 +00:00
_reset_recipe
2023-09-07 16:50:25 +00:00
}
setup(){
load "$PWD/tests/integration/helpers/common"
_common_setup
}
teardown(){
# https://github.com/bats-core/bats-core/issues/383#issuecomment-738628888
if [[ -z "${BATS_TEST_COMPLETED}" ]]; then
_undeploy_app
fi
}
2023-11-13 09:31:52 +00:00
# bats test_tags=slow
@test "autocomplete" {
run $ABRA app cmd --generate-bash-completion
assert_success
assert_output "$TEST_APP_DOMAIN"
run $ABRA app cmd "$TEST_APP_DOMAIN" --generate-bash-completion
assert_success
assert_output "app"
run $ABRA app cmd "$TEST_APP_DOMAIN" app --generate-bash-completion
assert_success
assert_output "test_cmd
test_cmd_arg
test_cmd_args
test_cmd_export"
}
2023-09-07 16:50:25 +00:00
@test "validate app argument" {
run $ABRA app cmd
assert_failure
assert_output --partial 'no app provided'
run $ABRA app cmd DOESNTEXIST
assert_failure
assert_output --partial 'cannot find app'
}
@test "retrieve recipe if missing" {
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
assert_success
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
2023-09-07 16:50:25 +00:00
assert_success
assert_output --partial 'baz'
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
}
@test "bail if unstaged changes and no --chaos" {
run bash -c "echo foo >> $ABRA_DIR/recipes/$TEST_RECIPE/foo"
assert_success
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
assert_failure
assert_output --partial 'locally unstaged changes'
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
}
@test "do not bail if unstaged changes and --chaos" {
run bash -c "echo foo >> $ABRA_DIR/recipes/$TEST_RECIPE/foo"
assert_success
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local --chaos "$TEST_APP_DOMAIN" test_cmd
assert_success
assert_output --partial 'baz'
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
}
@test "ensure recipe up to date if no --offline" {
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" reset --hard HEAD~3
assert_success
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
assert_output --regexp 'behind .* 3 commits'
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
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
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
assert_output --partial "up to date"
_reset_recipe "$TEST_RECIPE"
}
@test "ensure recipe not up to date if --offline" {
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" reset --hard HEAD~3
assert_success
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
assert_output --regexp 'behind .* 3 commits'
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
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
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
assert_output --regexp 'behind .* 3 commits'
_reset_recipe "$TEST_RECIPE"
}
2023-09-07 16:50:25 +00:00
@test "error if missing arguments without passing --local" {
run $ABRA app cmd "$TEST_APP_DOMAIN"
assert_failure
assert_output --partial 'missing arguments'
}
@test "error if missing arguments when passing --local" {
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local "$TEST_APP_DOMAIN"
2023-09-07 16:50:25 +00:00
assert_failure
assert_output --partial 'missing arguments'
}
@test "cannot use --local and --user at same time" {
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local --user root "$TEST_APP_DOMAIN" test_cmd
2023-09-07 16:50:25 +00:00
assert_failure
assert_output --partial 'cannot use --local & --user together'
}
@test "error if missing abra.sh" {
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh"
assert_success
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local --chaos "$TEST_APP_DOMAIN" test_cmd
2023-09-07 16:50:25 +00:00
assert_failure
assert_output --partial "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh does not exist"
_checkout_recipe
2023-09-07 16:50:25 +00:00
}
@test "error if missing command" {
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local "$TEST_APP_DOMAIN" doesnt_exist
2023-09-07 16:50:25 +00:00
assert_failure
assert_output --partial "doesn't have a doesnt_exist function"
}
@test "run --local command" {
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
2023-09-07 16:50:25 +00:00
assert_success
assert_output --partial 'baz'
}
@test "run command with single arg" {
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd_arg -- bing
2023-09-07 16:50:25 +00:00
assert_success
assert_output --partial 'bing'
}
@test "run command with several args" {
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 by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [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 by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/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](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [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: https://git.coopcloud.tech/coop-cloud/abra/pulls/403 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2024-03-11 13:27:21 +00:00
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd_args -- bong bang
2023-09-07 16:50:25 +00:00
assert_success
assert_output --partial 'bong bang'
}
# bats test_tags=slow
@test "run command on service" {
_deploy_app
run $ABRA app cmd "$TEST_APP_DOMAIN" app test_cmd
assert_success
assert_output --partial 'baz'
_undeploy_app
}
# bats test_tags=slow
@test "error if missing service" {
_deploy_app
run $ABRA app cmd "$TEST_APP_DOMAIN" doesnt_exist test_cmd
assert_failure
assert_output --partial 'no service doesnt_exist'
_undeploy_app
}