abra/tests/integration/app_logs.bats

47 lines
899 B
Plaintext
Raw Permalink 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(){
2023-09-25 09:20:56 +00:00
_rm_app
2023-09-07 16:50:25 +00:00
_rm_server
}
setup(){
load "$PWD/tests/integration/helpers/common"
_common_setup
}
@test "validate app argument" {
run $ABRA app logs
assert_failure
assert_output --partial 'no app provided'
run $ABRA app logs DOESNTEXIST
assert_failure
assert_output --partial 'cannot find app'
}
@test "error if not deployed" {
run $ABRA app logs "$TEST_APP_DOMAIN"
assert_failure
assert_output --partial 'is not deployed'
}
2023-09-27 07:19:57 +00:00
@test "retrieve recipe if missing" {
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
assert_success
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
run $ABRA app logs "$TEST_APP_DOMAIN"
assert_failure
assert_output --partial 'is not deployed'
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
}