From 14c67f36e635f303c270750315ec4d8977af5fdc Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 16 Apr 2026 08:06:51 +0000 Subject: [PATCH] fix: add bats coverage for --backend space-separated form (#825) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bin/disinto flag loop has separate cases for `--backend value` (space-separated) and `--backend=value`; a regression in either would silently route to the docker default path. Per the "stub-first dispatch" lesson, silent misrouting during a migration is the worst failure mode — covering both forms closes that gap. Also triggers a retry of the smoke-init pipeline step, which hit a known Forgejo branch-indexing flake on pipeline #913 (same flake cleared on retry for PR #829 pipelines #906 → #908); unrelated to the nomad-validate changes, which went all-green in #913. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/disinto-init-nomad.bats | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/disinto-init-nomad.bats b/tests/disinto-init-nomad.bats index e3d6428..16315dc 100644 --- a/tests/disinto-init-nomad.bats +++ b/tests/disinto-init-nomad.bats @@ -78,6 +78,19 @@ setup_file() { [[ "$output" == *"── Dry-run: intended actions ────"* ]] } +# ── Flag syntax: --flag=value vs --flag value ──────────────────────────────── + +# Both forms must work. The bin/disinto flag loop has separate cases for +# `--backend value` and `--backend=value`; a regression in either would +# silently route to the docker default, which is the worst failure mode +# for a mid-migration dispatcher ("loud-failing stub" lesson from S0.4). +@test "disinto init --backend nomad (space-separated) dispatches to nomad" { + run "$DISINTO_BIN" init placeholder/repo --backend nomad --dry-run + [ "$status" -eq 0 ] + [[ "$output" == *"nomad backend: default"* ]] + [[ "$output" == *"[dry-run] Step 1/9: install nomad + vault binaries"* ]] +} + # ── Flag validation ────────────────────────────────────────────────────────── @test "--backend=bogus is rejected with a clear error" {