test: backfill raw/global/computed report triplet coverage across plugins
The bats coverage for plugin :report keys has been uneven since the raw/global/computed split landed in PR #8640. This commit adds a single combined triplet test per settable property across app-json, builder, builder-dockerfile, builder-herokuish, builder-lambda, builder-nixpacks, builder-pack, builder-railpack, buildpacks, cron (maintenance), git (keep-git-dir, rev-env-var, source-image), logs (vector-sink, vector-global-image, vector-global-networks), network (attach-post-create, attach-post-deploy, initial-network), proxy (per-app type), ps (stop-timeout-seconds), registry (image-repo, push-on-release, push-extra-tags), storage (build/deploy/run mounts), and adds a new tests/unit/scheduler.bats and tests/unit/nginx-vhosts_properties.bats. Brings ps `procfile-path` and `stop-timeout-seconds` global getters in line with the #8640 convention (raw global, default resolved in computed). Documents the read-only and internal properties that surface in `:report` (or are written by Dokku) but cannot be managed by `:set` in a new `## Internal properties` section appended to each affected plugin's docs page.
This commit is contained in:
97
tests/unit/scheduler.bats
Normal file
97
tests/unit/scheduler.bats
Normal file
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
global_setup
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
dokku scheduler:set --global selected >/dev/null 2>&1 || true
|
||||
destroy_app
|
||||
global_teardown
|
||||
}
|
||||
|
||||
@test "(scheduler) scheduler:help" {
|
||||
run /bin/bash -c "dokku scheduler"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "Manage schedulers"
|
||||
help_output="$output"
|
||||
|
||||
run /bin/bash -c "dokku scheduler:help"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "Manage schedulers"
|
||||
assert_output "$help_output"
|
||||
}
|
||||
|
||||
@test "(scheduler:report) selected raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku scheduler:set --global selected"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-selected\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-global-selected\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-computed-selected\"'"
|
||||
assert_success
|
||||
assert_output "docker-local"
|
||||
|
||||
run /bin/bash -c "dokku scheduler:set --global selected null"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-global-selected\"'"
|
||||
assert_success
|
||||
assert_output "null"
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-computed-selected\"'"
|
||||
assert_success
|
||||
assert_output "null"
|
||||
|
||||
run /bin/bash -c "dokku scheduler:set $TEST_APP selected docker-local"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-selected\"'"
|
||||
assert_success
|
||||
assert_output "docker-local"
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-global-selected\"'"
|
||||
assert_success
|
||||
assert_output "null"
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-computed-selected\"'"
|
||||
assert_success
|
||||
assert_output "docker-local"
|
||||
|
||||
run /bin/bash -c "dokku scheduler:set $TEST_APP selected"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku scheduler:set --global selected"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(scheduler:report) --global --format json" {
|
||||
run /bin/bash -c "dokku scheduler:set --global selected"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report --global --format json | jq -e ."
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report --global --format json | jq -r '.\"scheduler-global-selected\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report --global --format json | jq -r '.\"scheduler-computed-selected\"'"
|
||||
assert_success
|
||||
assert_output "docker-local"
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report --global --format json | jq -r 'has(\"scheduler-selected\")'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
}
|
||||
Reference in New Issue
Block a user