fix(tests): name the peer cache priming task statically #52

Merged
claudiomaradonna merged 1 commit from fix/peer-derivation-task-name into main 2026-11-16 14:00:56 +01:00
Collaborator

Why

The peer_derivation gate, one of the checks make check runs before
every push and on the forge, proves how firewall-apply works out which
cluster peers its firewall admits. It first primes a fact cache from a
small fixture playbook.

On every run, that fixture printed a template error,
'fixture_host' is undefined, although the gate passed. Everyone who
reads make check's output meets it, and has to stop to tell it from a
real failure, which hides a real template error in the same place. The
fixture's task was named with its own loop variable, which Ansible
templates before the loop defines it.

What changed

Before, the priming task printed a template error in every make check.
Now its name is static, "Cache each fixture host's default route", and
each item still prints its host; the gate captures the priming run's
output and fails when it holds a template error. The change is in
tests/fixtures/peer_derivation/prime.yml and
tests/gates/check_peer_derivation.sh.

How to verify

Have the toolchain CONTRIBUTING sets up, run
from the clone's root.

D=$(mktemp -d)
git clone https://git.unitoo.it/claudiomaradonna/castrum.git "$D/castrum" && cd "$D/castrum"
./tests/gates/check_peer_derivation.sh 2>&1 | grep -E "template error|is undefined"

On main the gate passes and prints:

[WARNING]: Encountered 1 template error.
error 1 - 'fixture_host' is undefined

On the branch:

git fetch origin fix/peer-derivation-task-name && git switch --detach FETCH_HEAD
./tests/gates/check_peer_derivation.sh 2>&1 | grep -cE "template error|is undefined"

prints 0, and the gate still passes.

Checks: make check passed on the tip with no template error in its
output; the gate as changed fails on main with "FAIL: priming the fact
cache hit a template error". Not tried: make test, since podman was
missing where the change was made; the change touches no role or
scenario.

## Why The `peer_derivation` gate, one of the checks `make check` runs before every push and on the forge, proves how `firewall-apply` works out which cluster peers its firewall admits. It first primes a fact cache from a small fixture playbook. On every run, that fixture printed a template error, `'fixture_host' is undefined`, although the gate passed. Everyone who reads `make check`'s output meets it, and has to stop to tell it from a real failure, which hides a real template error in the same place. The fixture's task was named with its own loop variable, which Ansible templates before the loop defines it. ## What changed Before, the priming task printed a template error in every `make check`. Now its name is static, "Cache each fixture host's default route", and each item still prints its host; the gate captures the priming run's output and fails when it holds a template error. The change is in `tests/fixtures/peer_derivation/prime.yml` and `tests/gates/check_peer_derivation.sh`. ## How to verify Have the toolchain [CONTRIBUTING](CONTRIBUTING.md#setup) sets up, run from the clone's root. ```bash D=$(mktemp -d) git clone https://git.unitoo.it/claudiomaradonna/castrum.git "$D/castrum" && cd "$D/castrum" ./tests/gates/check_peer_derivation.sh 2>&1 | grep -E "template error|is undefined" ``` On `main` the gate passes and prints: ```text [WARNING]: Encountered 1 template error. error 1 - 'fixture_host' is undefined ``` On the branch: ```bash git fetch origin fix/peer-derivation-task-name && git switch --detach FETCH_HEAD ./tests/gates/check_peer_derivation.sh 2>&1 | grep -cE "template error|is undefined" ``` prints `0`, and the gate still passes. Checks: `make check` passed on the tip with no template error in its output; the gate as changed fails on `main` with "FAIL: priming the fact cache hit a template error". Not tried: `make test`, since podman was missing where the change was made; the change touches no role or scenario.
fix(tests): name the peer cache priming task statically
Some checks failed
check / check (pull_request) Failing after 2m59s
ed653cb3f2
The priming task of the peer_derivation fixture was named with its
own loop variable, which Ansible templates before the loop defines
it, so every make check printed "'fixture_host' is undefined" though
the gate passed. The loop label already names each host. The gate now
fails when its priming run hits a template error.
claudiomaradonna deleted branch fix/peer-derivation-task-name 2026-11-16 14:01:04 +01:00
Sign in to join this conversation.
No description provided.