Gate the artifacts and the checks ledger, not just the logs
The brief's gate names "logs, artifacts and checks ledger" and the clickthrough arm asserted only the first. render-artifacts returns the empty string for a run with no artifacts, so a fixture that produced none left the artifact path unreachable and any assertion about it vacuous.
The fixture pipeline now writes a ledger into $KILN_ARTIFACTS with no artifact step, which is what .kiln/ci.sh does: the runner sets that variable to <workspace>/artifacts on both the legacy and the node paths and retrieve-artifacts! copies the directory back regardless.
The arm now scrapes the artifact href off the rendered run page, fetches it, and requires the downloaded bytes to be the ledger the run wrote -- so a rendered panel whose links do not resolve reddens too.
test/integration/test-run-addressing.sh | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)test/integration/test-run-addressing.shmodified
EOF}# THE FIXTURE WRITES A CHECK LEDGER, because the gate this work was given names# "logs, artifacts and checks ledger" and an artifacts panel renders NOTHING# when a run produced no artifacts -- so a run with none would let the artifact# assertions pass vacuously by never being reachable.## It writes straight into $KILN_ARTIFACTS with no `artifact` step, which is what# .kiln/ci.sh does: the runner sets KILN_ARTIFACTS to <workspace>/artifacts on# both the legacy and the node paths, and retrieve-artifacts! copies that whole# directory back regardless of any `artifact` step.mk_pipeline ci.sgv '(pipeline ci on: #[ (manual) ] (job ci steps: #[ (shell "echo addressing-gate-node-ran" name: checks) ]))' steps: #[ (shell "echo addressing-gate-node-ran; mkdir -p \"$KILN_ARTIFACTS\"; printf %s\\n \"check: addressing-gate PASS\" > \"$KILN_ARTIFACTS/checks.ledger\"" name: checks) ]))'register() { # slug anchor-job-name k job add "$2" --repo "$1" > "$G/.add.$2" 2>&1 || true || fail "the run page does not link back to its group; navigation only works downward" echo "$PAGE" | grep -q 'log-viewer' \ || fail "the run page rendered no log viewer" ok "the group page's own link resolves to a page carrying the run's logs, its repo, and a link back to the group" # ARTIFACTS AND THE CHECKS LEDGER, which are the other two things the gate # for this work names. The artifacts panel renders the empty string when a # run produced nothing, so asserting its ABSENCE would pass for free -- the # fixture writes a real ledger into $KILN_ARTIFACTS so there is something # for the panel to be wrong about. echo "$PAGE" | grep -q 'checks.ledger' \ || fail "the run page does not list the run's checks ledger. Logs, artifacts and the ledger are the three things an operator opens a run page for, and before this change all three were reachable only through the JSON API." ALINK=$(echo "$PAGE" | grep -o 'href="/artifacts/[^"]*"' | head -1 | sed 's/href="//; s/"$//') [ -n "$ALINK" ] || fail "the run page rendered no artifact link" say "run page emits artifact href=$ALINK" [ "$(code "$ALINK")" = 200 ] \ || fail "the artifact link on the run page answered $(code "$ALINK"). A rendered panel whose links do not resolve is the same defect one layer down." pub "$ALINK" | grep -q 'addressing-gate PASS' \ || fail "the artifact downloaded through the run page's own link is not the ledger the run wrote" ok "the group page's own link resolves to a page carrying the run's logs, its checks ledger as a downloadable artifact, its repo name, and a link back to its group"fi# ==================================================================