Skip to content

Fixes a runbook test's sabotage note - #123

Merged
johnnyt merged 1 commit into
mainfrom
ece-5g8-release-task-case-and-sabotage-note
Sep 30, 2026
Merged

johnnyt merged 1 commit into
mainfrom
ece-5g8-release-task-case-and-sabotage-note

Conversation

@johnnyt

@johnnyt johnnyt commented Sep 30, 2026

Copy link
Copy Markdown
Member

What

The runbook test "starting both vaults inside the callback, from configuration, makes it a clean pass" (test/encryptor/ecto/runbook_test.exs, describe "a release task that starts only the repository") carried a sabotage note that mutated Pass.migratable/1. That mutation breaks every dry-run count, so it says nothing about the property this test claims: that vaults started inside the release task's callback, reading their keys from configuration, give a clean pass.

The note now names a mutation of that property: the fixture Vault.init/1 (test/support/test_runbook.ex, Encryptor.Ecto.TestRunbook.Vault) builds its provider over an empty workspace map instead of the configured one. The vault still starts inside the callback, holds no key for the row's scope, and the pass answers :error.

Test comment only: no library change, no guide change, no changelog fragment (changelog.d/README.md excludes test harness changes). The bead's other half, the release-task "If it differs" paragraph of the migrate-from-cloak guide, was fixed in an earlier PR and is not touched here.

Sabotage run

  • Mutation: in Encryptor.Ecto.TestRunbook.Vault.init/1, provider(Keyword.fetch!(keys, :workspaces), ...) replaced with provider(%{}, ...); git diff of the fixture was non-empty.
  • Outcome: the test failed on the assertion assert status == :ok (left :error), a kill.
  • Restore: the fixture restored from a copy, byte-equal by cmp and git diff --exit-code, then recompiled; the runbook file passed again.

Review (in-turn)

I re-read the diff against the bead's acceptance and notes. Every claim in the new comment was checked against the code: Vault.init/1 builds its provider from the :workspaces entry of the application environment it reads at start; the mutation leaves the vault startable, so the test reaches its assertions rather than failing on the {:ok, _vault} match; the assertion that fails is status == :ok. The comment keeps the file's sabotage-note shape (mutation, then consequence, after a hyphen). The sibling test file for the parallel-column exit is untouched.

Gate

Full mix quality green on the rebased head with the database arm running (no skip message).

Refs: ece-5g8

The note above "starting both vaults inside the callback, from
configuration, makes it a clean pass" named a mutation of
Pass.migratable/1, which every dry-run test would catch and which says
nothing about the vaults. It now names the mutation that breaks what
the test claims: the fixture vault built its provider over an empty
workspace map instead of the configured one, so the vault started
inside the callback held no key for the row's scope and the pass
answered :error. Run against this test, the test failed on
assert status == :ok.

Test comment only; no library change and no fragment.

Refs: ece-5g8
@johnnyt
johnnyt merged commit 9256360 into main Sep 30, 2026
1 check passed
@johnnyt
johnnyt deleted the ece-5g8-release-task-case-and-sabotage-note branch September 30, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant