Skip to content

test: repair broken-at-birth bats suites (test_ujust mock brew, powerwash bctl) - #1106

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
arch/derive-test-catalog
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
arch/derive-test-catalog

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Refactor-enabling test repair

Files claimed: tests/test_ujust.bats (setup() mock brew), tests/test_shared_just.bats (two powerwash tests). Cluster: issue common#1105 (test-catalog drift gate).

common#1105 measured the test catalog restated 3x (workflow / Justfile / disk) with 12 of 33 bats suites never executed in CI. Two of those ungated suites are red on main today — broken at birth, invisible because nothing runs them:

  • tests/test_ujust.bats: setup() mock brew exited 1 on any subcommand outside install/shellenv. Recipes grew brew bundle calls in fix: add Bluespeed setup recipe #1023 (2026-09-08); the mock was never updated, so all four install-ai-tools tests and the bluespeed present-case test fail. Fix: mock accepts bundle (no-op success, still logged to CALLS).
  • tests/test_shared_just.bats: two powerwash tests asserted delegation to bctl powerwash; that delegation was removed in fix: restore native recipes without bluefinctl #1083 (2026-09-05), five days before the tests were written (test(shared.just): BATS coverage for powerwash, toggle-tpm2 #1034, 2026-09-10). Rewritten to assert the current contract: gum double-confirmation → sudo bootc install reset --experimental, and no bctl invocation even when bctl is on PATH.

Both suites pass locally after the fix (26/26), verified with bats 1.14.0.

This PR is the test-side enabler for #1105's derived-catalog gate. The .github/workflows/unit-tests.yml derivation itself is implemented and verified but currently unpushable: the App token lacks the workflows scope (push rejected; same gap previously hit in bluefin-lts, hive bead 737d89ef-ead). The verified workflow change is preserved in dangling commit fea7089 on this branch's reflog for whoever lands it once the scope gap is fixed.

Refs #1105 — left open: unit-tests.yml catalog derivation (blocked on App workflows scope) and Justfile test-recipe dedup (blocked on common#1064 occupying that recipe) are both outstanding.


Filed by architect agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.

— hive: agent=architect backend=copilot model=kimi-k3 copilot=1.0.78

@hivecommons-hive hivecommons-hive Bot added hold Work is intentionally paused. architecture Structural or interface design work. agent/architect Filed or owned by the architect agent. hive/hosted-projectbluefin-knuckle-gjvq Routed by the hosted Project Bluefin Hive deployment. labels Sep 12, 2026
@hivecommons-hive hivecommons-hive Bot changed the title [architect] test: repair broken-at-birth bats suites (test_ujust mock brew, powerwash bctl) — enabler for common#1105 test: repair broken-at-birth bats suites (test_ujust mock brew, powerwash bctl) — enabler for common#1105 Sep 17, 2026
@hivecommons-hive hivecommons-hive Bot added the agent/scanner Filed or owned by the scanner agent. label Sep 17, 2026
@hivecommons-hive hivecommons-hive Bot changed the title test: repair broken-at-birth bats suites (test_ujust mock brew, powerwash bctl) — enabler for common#1105 test: repair broken-at-birth bats suites (test_ujust mock brew, powerwash bctl) Sep 18, 2026
Two suites fail on main today but are invisible because CI never runs them
(12 of 33 bats suites are ungated — see #1105):

- test_ujust.bats: the setup() mock brew exits 1 on any subcommand outside
  install/shellenv. Recipes grew 'brew bundle' calls in #1023, so all four
  install-ai-tools tests and the bluespeed present-case test fail. Mock now
  accepts bundle.
- test_shared_just.bats: two powerwash tests asserted delegation to
  'bctl powerwash'; that delegation was removed in #1083 five days before
  the tests were written. Rewritten to assert the current contract: gum
  double-confirmation -> sudo bootc install reset --experimental, and no
  bctl invocation even when bctl is on PATH.

Both suites now pass locally (26/26). This is the test-side enabler for
the derived-catalog CI gate proposed in #1105; the unit-tests.yml change
itself is currently blocked on the App token missing the workflows scope.

Refs #1105 (left open: unit-tests.yml catalog derivation and Justfile
enumeration dedup still outstanding)

Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot force-pushed the arch/derive-test-catalog branch from a6b6972 to 197b546 Compare September 18, 2026 14:37

@Danathar Danathar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed the premise: on current main, bats tests/test_ujust.bats tests/test_shared_just.bats has 7 failures; at this PR's head all 26 pass. The powerwash rewrite matches what the recipe does after #1083 (double gum confirmation → sudo bootc install reset --experimental, no bctl), and the bundle mock case is the minimal fix for #1023's brew bundle calls.

For whoever merges: neither suite is in .github/workflows/unit-tests.yml, so this repair is invisible to CI until that file lists them — which is #1105 and needs a token with the workflows scope. Happy to open that follow-up once this lands.

@Danathar

Copy link
Copy Markdown
Contributor

Hold removed: this was the Hive's ACMM level gate, which I operate, and the PR has a human approval with CI green. Ready for a maintainer to merge.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style

  • tests/test_shared_just.bats:98 — the comment "Both confirmations were prompted before any destructive call" overstates the assertion below it, which only counts gum lines (-eq 2) and never checks ordering against the sudo line. Since calls.log is append-ordered, asserting the last gum line number < the sudo line number would make the comment true; otherwise reword the comment.
  • tests/test_shared_just.bats:90-101 — the new "two confirmations run bootc install reset via sudo" test now substantially duplicates the pre-existing "both confirmations run the experimental bootc reset" (line ~168) and "the reset is issued exactly once" tests. Consider folding them.

intent-alignment

  • PR body only: the claim that the verified unit-tests.yml change is "preserved in dangling commit fea7089 on this branch's reflog" is not actionable — a reflog is local to the agent's clone and the commit was never pushed, so no one else can land it from there. The workflow change should be attached somewhere durable (issue #1105, a patch file, or a branch without workflow-scope needs).

Verified against head 197b546: the rewritten powerwash assertions match the actual recipe (shared.just:11-23 — gum double-confirm, no bctl, sudo bootc install reset --experimental), and the bundle) mock case (test_ujust.bats:24-25) correctly unblocks the set -euo pipefail recipes calling brew bundle (apps.just:63, system.just:56).

No findings from: correctness, security, docs-currency.

— hive: agent=reviewer backend=copilot model=claude-fable-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/architect Filed or owned by the architect agent. agent/scanner Filed or owned by the scanner agent. architecture Structural or interface design work. hive/hosted-projectbluefin-knuckle-gjvq Routed by the hosted Project Bluefin Hive deployment.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant