From ff1296859b69bcbca8f07ea40cf09da9f85c2aac Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 10 May 2026 18:34:24 -0400 Subject: [PATCH] test: stabilize scheduler-k3s cnb bats tests Drop the assertion that the web deployment has no command since the python buildpack auto-emits a web Procfile entry, which correctly routes through launcher just like docker-local. Shorten the cron command fixture so the base36-encoded cron-id stays under the 63-byte kubernetes label limit, and relax the `dokku run` and `dokku cron:run` output assertions to `assert_output_contains` so they tolerate the leading blank line emitted on k3s. --- tests/apps/python/app-cnb-cron.json | 2 +- tests/unit/builder-pack.bats | 2 +- tests/unit/scheduler-k3s-cnb.bats | 14 ++++---------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/apps/python/app-cnb-cron.json b/tests/apps/python/app-cnb-cron.json index 54d9aa7a1..67943099b 100644 --- a/tests/apps/python/app-cnb-cron.json +++ b/tests/apps/python/app-cnb-cron.json @@ -1,7 +1,7 @@ { "cron": [ { - "command": "python3 task.py some cron task", + "command": "python3 task.py", "schedule": "5 5 5 5 5" } ], diff --git a/tests/unit/builder-pack.bats b/tests/unit/builder-pack.bats index d5dbc7887..a580a2575 100644 --- a/tests/unit/builder-pack.bats +++ b/tests/unit/builder-pack.bats @@ -216,7 +216,7 @@ teardown() { echo "output: $output" echo "status: $status" assert_success - assert_output "['task.py', 'some', 'cron', 'task']" + assert_output "['task.py']" } @test "(builder-pack) cron:run with Procfile reference" { diff --git a/tests/unit/scheduler-k3s-cnb.bats b/tests/unit/scheduler-k3s-cnb.bats index 588806f72..d4dd12087 100644 --- a/tests/unit/scheduler-k3s-cnb.bats +++ b/tests/unit/scheduler-k3s-cnb.bats @@ -60,12 +60,6 @@ teardown() { echo "status: $status" assert_success assert_output "python3" - - run /bin/bash -c "kubectl get deployment $TEST_APP-web -o=jsonpath='{.spec.template.spec.containers[0].command}'" - echo "output: $output" - echo "status: $status" - assert_success - assert_output "" } @test "(scheduler-k3s) cnb cronjob manifest sets command launcher" { @@ -113,7 +107,7 @@ teardown() { echo "output: $output" echo "status: $status" assert_success - assert_output "['task.py', 'some', 'cron', 'task']" + assert_output_contains "['task.py']" } @test "(scheduler-k3s) cnb dokku run uses launcher entrypoint" { @@ -148,7 +142,7 @@ teardown() { echo "output: $output" echo "status: $status" assert_success - assert_output "['task.py', 'test']" + assert_output_contains "['task.py', 'test']" run /bin/bash -c "dokku --quiet run $TEST_APP env" echo "output: $output" @@ -189,7 +183,7 @@ teardown() { echo "output: $output" echo "status: $status" assert_success - assert_output "['task.py', 'test']" + assert_output_contains "['task.py', 'test']" cron_id="$(dokku cron:list $TEST_APP --format json | jq -r '.[0].id')" run /bin/bash -c "echo $cron_id" @@ -202,7 +196,7 @@ teardown() { echo "output: $output" echo "status: $status" assert_success - assert_output "['task.py', 'test']" + assert_output_contains "['task.py', 'test']" } cron_run_wrapper() {