Skip to content

tests/k8s-deployment-control is defunct: broken against the current CLI and not run by CI #216

Description

@dboreham

tests/k8s-deployment-control/run-test.sh cannot run against the current CLI, and no CI workflow runs it, so the rot went unnoticed. It nominally covers k8s scheduling behaviour — node affinities, tolerations, and asserting the pod lands on the expected node — which nothing else in the suite covers today.

What is broken

Every stack invocation in it uses a CLI shape that no longer exists:

line script uses current CLI
70 stack fetch repositories --stack test only stack fetch repo
71 stack build containers --stack test still valid
79 stack --stack test deploy --deploy-to k8s-kind init --output ... no global --stack, no init subcommand under deploy, no --deploy-to on deploy; it is now stack init --stack ... --deploy-to ...
88 stack --stack test deploy --spec-file ... --deployment-dir ... no global --stack

It also waits on a string the product never prints:

if [[ "$ps_output" == *"Running containers:"* ]]; then

ps_operation (src/stack/deploy/deploy.py) prints id: <id>, name: <name>, ports: ..., so wait_for_pods_started can only ever spin for its full 50 × 5s and then fail. The other tests match id:.

Why it went unnoticed

There is no .github/workflows/ job that runs this test. Every other bash suite has one (test-deploy, test-deploy-k8s, test-database, test-backup, test-skill, test-static-content, test-webapp, test).

Suggested resolution

The scheduling assertions are worth keeping, but a standalone unrunnable test is worse than none — it reads as coverage that does not exist. Options, roughly in order of preference:

  1. Fold the affinity/toleration cases into tests/k8s-deploy/run-deploy-test.sh (which did not exist in its current form when this test was written) as an extra phase, so they run in the existing K8S Deploy Test job. Note that test's kind cluster is single-node, so the multi-node kind-config.yml this test writes would need to go somewhere the k8s test can opt into.
  2. Port it to the current CLI and give it its own workflow.
  3. Delete it, and open a separate issue for the missing scheduling coverage.

Context

Found while consolidating duplicated code out of the bash test scripts into tests/lib/common.sh. That refactor deliberately skipped this file rather than polish a script that cannot run — the shared wait_for_containers_started helper matches id:, which would have masked the breakage by making the wait loop pass while the rest of the script still failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions