fix: ensure all report subcommands exit 0 when there is no app
Closes #7454
This commit is contained in:
@@ -4,17 +4,18 @@ load test_helper
|
||||
|
||||
setup() {
|
||||
global_setup
|
||||
deploy_app
|
||||
rm -f /tmp/fake-docker-bin
|
||||
}
|
||||
|
||||
teardown() {
|
||||
rm -f /tmp/fake-docker-bin
|
||||
destroy_app
|
||||
destroy_app || true
|
||||
global_teardown
|
||||
}
|
||||
|
||||
@test "(report) report" {
|
||||
deploy_app
|
||||
|
||||
run /bin/bash -c "dokku report"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
@@ -57,6 +58,8 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "(report) custom docker bin" {
|
||||
deploy_app
|
||||
|
||||
export DOCKER_BIN="docker"
|
||||
run /bin/bash -c "dokku report"
|
||||
echo "output: $output"
|
||||
@@ -85,3 +88,52 @@ teardown() {
|
||||
|
||||
unset DOCKER_BIN
|
||||
}
|
||||
|
||||
@test "(report) exit 0 when no apps exist" {
|
||||
run /bin/bash -c "dokku report"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
plugins=(
|
||||
app-json
|
||||
apps
|
||||
builder
|
||||
builder-dockerfile
|
||||
builder-herokuish
|
||||
builder-lambda
|
||||
builder-nixpacks
|
||||
builder-pack
|
||||
buildpacks
|
||||
caddy
|
||||
certs
|
||||
checks
|
||||
cron
|
||||
docker-options
|
||||
domains
|
||||
git
|
||||
haproxy
|
||||
logs
|
||||
network
|
||||
nginx
|
||||
openresty
|
||||
ports
|
||||
proxy
|
||||
ps
|
||||
registry
|
||||
resource
|
||||
scheduler
|
||||
scheduler-docker-local
|
||||
scheduler-k3s
|
||||
storage
|
||||
traefik
|
||||
)
|
||||
|
||||
for plugin in "${plugins[@]}"; do
|
||||
run /bin/bash -c "dokku $plugin:report 2>&1"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output_contains "You haven't deployed any applications yet"
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user