Files
dokku/tests/unit/scheduler-k3s-autoscaling-auth.bats
Jose Diaz-Gonzalez 5dbb2951bb feat: add scheduler-k3s annotations:report and labels:report
The scheduler-k3s plugin exposes `annotations:set` and `labels:set` but no matching report subcommands, so scripts could not inspect the configured state for idempotent management without reading the property files directly. The new `scheduler-k3s:annotations:report` and `scheduler-k3s:labels:report` surface the configured entries with stdout, JSON, single-flag query, and `--process-type` / `--resource-type` filtering, mirroring the recently added `scheduler-k3s:charts:report`. The literal `GlobalProcessType` value `--global` is rendered as `global` in report keys to avoid leading dashes. The `scheduler-k3s:autoscaling-auth:report` command is updated alongside to loop over every app when no app and no `--global` flag is provided, matching the convention used by `scheduler-k3s:report`.
2026-05-30 20:12:00 -04:00

31 lines
1.1 KiB
Bash

#!/usr/bin/env bats
load test_helper
setup() {
global_setup
dokku apps:create $TEST_APP >/dev/null 2>/dev/null || true
dokku apps:create ${TEST_APP}-2 >/dev/null 2>/dev/null || true
}
teardown() {
dokku scheduler-k3s:autoscaling-auth:set $TEST_APP datadog >/dev/null 2>/dev/null || true
dokku scheduler-k3s:autoscaling-auth:set ${TEST_APP}-2 datadog >/dev/null 2>/dev/null || true
dokku --force apps:destroy $TEST_APP >/dev/null 2>/dev/null || true
dokku --force apps:destroy ${TEST_APP}-2 >/dev/null 2>/dev/null || true
global_teardown
}
@test "(scheduler-k3s:autoscaling-auth:report) no-arg loops all apps" {
run /bin/bash -c "dokku scheduler-k3s:autoscaling-auth:set $TEST_APP datadog --metadata apiKey=secret-1"
assert_success
run /bin/bash -c "dokku scheduler-k3s:autoscaling-auth:set ${TEST_APP}-2 datadog --metadata apiKey=secret-2"
assert_success
run /bin/bash -c "dokku scheduler-k3s:autoscaling-auth:report"
assert_success
assert_output_contains "$TEST_APP scheduler-k3s information"
assert_output_contains "${TEST_APP}-2 scheduler-k3s information"
assert_output_contains "Datadog:" 2
}