fix: align ps/cron :report --global keys with plugin convention
The `ps` and `cron` plugins emitted `:report --format json` keys that skipped the `<plugin>-` prefix or `-global-` infix used by every other plugin, forcing external consumers to special-case those names. Rename the affected report flags so they match the `<plugin>-global-<property>` and `<plugin>-computed-<property>` convention introduced in 0.38.0, and add the previously missing `computed-` siblings to both the per-app and `--global` reports so the shape lines up with caddy, haproxy, and traefik.
This commit is contained in:
@@ -120,6 +120,30 @@ teardown() {
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r 'has(\"cron-global-maintenance\")'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r 'has(\"cron-computed-maintenance\")'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r 'has(\"cron-global-mailfrom\")'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r 'has(\"cron-computed-mailfrom\")'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r 'has(\"cron-global-mailto\")'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r 'has(\"cron-computed-mailto\")'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
@@ -133,23 +157,31 @@ teardown() {
|
||||
assert_success
|
||||
assert_output_not_contains "unknown flag"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-mailto\"'"
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-global-mailto\"'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "admin@example.com"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-computed-mailto\"'"
|
||||
assert_success
|
||||
assert_output "admin@example.com"
|
||||
|
||||
run /bin/bash -c "dokku cron:set --global mailto"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output_not_contains "unknown flag"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-mailto\"'"
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-global-mailto\"'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-computed-mailto\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
}
|
||||
|
||||
@test "(cron:set) --global mailfrom" {
|
||||
@@ -159,17 +191,29 @@ teardown() {
|
||||
assert_success
|
||||
assert_output_not_contains "unknown flag"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-mailfrom\"'"
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-global-mailfrom\"'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "dokku@example.com"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-computed-mailfrom\"'"
|
||||
assert_success
|
||||
assert_output "dokku@example.com"
|
||||
|
||||
run /bin/bash -c "dokku cron:set --global mailfrom"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output_not_contains "unknown flag"
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-global-mailfrom\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku cron:report --global --format json | jq -r '.\"cron-computed-mailfrom\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
}
|
||||
|
||||
@test "(cron:set) --global maintenance" {
|
||||
|
||||
Reference in New Issue
Block a user