Compare commits

..

1 Commits

Author SHA1 Message Date
f5c39d8f1a test: check app list doesn't explode if missing .env
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
See #560
2025-08-12 22:15:51 +02:00
2 changed files with 27 additions and 2 deletions

View File

@ -73,8 +73,7 @@ func Run(version, commit string) {
Aliases: []string{"m"},
Short: "Generate manpage",
Example: ` # generate the man pages into /usr/local/share/man/man1
abra_path=$(which abra) # pass abra absolute path to sudo below
sudo $abra_path man
sudo abra man
sudo mandb
# read the man pages

View File

@ -8,6 +8,10 @@ setup_file(){
}
teardown_file(){
if [[ ! -f "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" ]]; then
_new_app
fi
_undeploy_app
_rm_app
_rm_server
@ -19,6 +23,10 @@ setup(){
}
teardown(){
if [[ ! -f "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" ]]; then
_new_app
fi
_reset_recipe
_undeploy_app
}
@ -137,3 +145,21 @@ teardown(){
assert_success
assert_not_exists "$ABRA_DIR/servers/foo.com"
}
# bats test_tags=slow
@test "list does not fail if missing .env" {
_deploy_app
run $ABRA app ls --status
assert_success
run rm -rf "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
assert_success
assert_not_exists "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
output=$("$ABRA" app ls --server "$TEST_SERVER" --status --machine)
run diff \
<(jq -S "." <(echo "$output")) \
<(jq -S "." <(echo '{}'))
assert_success
}