Skip to content

test(e2e): assert runtime outcomes instead of emitted script text - #552

Merged
joshua-temple merged 3 commits into
mainfrom
fix/e2e-devacuum-runtime-assertions
Jul 11, 2026
Merged

joshua-temple merged 3 commits into
mainfrom
fix/e2e-devacuum-runtime-assertions

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

Several e2e scenarios asserted a behavior by grepping the EMITTED workflow script (for example can_proceed=true, the state-write retry loop text, a push: trigger line). Those assertions stay green even if the runtime behavior regresses, because they only check what the generator wrote, not what the workflow does when it runs.

Fix

De-vacuum the load-bearing ones to assert on RUNTIME outcomes the running act+gitea workflow produces:

  • 08 state-write retry: drives a real orchestrate run and asserts state.dev advances, plus a new expect_log for the cascade-state-write: ok attempt=1 line the running finalize job emits.
  • 37 / 38 breaking-change gate: seed a baseline, cascade a feat!, then assert a breaking publish/promote is BLOCKED (fails, release/state unchanged) and proceeds only with allow_breaking (release present).
  • 40 dispatch-only: assert no orchestrate run occurs on push (new expect_no_run) but a run advances state on workflow_dispatch.

Harness: adds StepExpect.ExpectLog (mirrors RollbackStep.ExpectLog), OrchestrateStep.Event/ExpectNoRun, with a round-trip parse test. Scenario 43 (deploy fail_fast matrix) is relabeled generation-only with a documented residual, since act does not reliably cancel a fail-fast sibling matrix leg.

Adds a CONTRIBUTING standard: assert a runtime outcome that differs under a regression, never a marker matchable in the emitted script.

Verification

go build ./..., go test ./... (2711 pass), golangci-lint run ./... clean; e2e module builds and vets; scenario configs validate against the schema. The e2e run on this PR exercises the new runtime assertions on correct behavior.

…nd state-write scenarios

Replace source-grep e2e assertions with runtime-outcome checks for the
breaking-change gate (37/38), release-trigger dispatch-only (40), and the
state-write retry loop (08). Add an expect_log step surface plus orchestrate
event and expect_no_run knobs so a scenario can assert a log line the running
job emitted and a suppressed trigger. Relabel the rollout-strategy scenario
(43) generation-only, since act cannot observe fail-fast matrix cancellation.
Codify the assert-a-runtime-outcome standard in CONTRIBUTING.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
…gate signal

The multi-env breaking-gate crossing (prerelease to release) coincides with
the is_final_env publish, so the allow_breaking promote reaches the Trigger
Release Build step. That step shells out to gh, which act does not have, so a
correct run failed under act on exit 127.

Scope the runtime assertion to the gate outcome the act path can observe:
Publish Release cuts the v1.0.0 tag and reaps the RC before the gh dispatch,
so the published release is the gate-bypass signal and flips against the
blocked promote purely on the gate. The allow step is expect_failure with the
published release and tags asserted; the state leaf is not asserted because
Finalize runs after the dispatch. The release-build dispatch shape stays a
labeled generation-only check, with its execution proven on the fleet.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
…dispatch

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit b88719e into main Jul 11, 2026
20 checks passed
@joshua-temple
joshua-temple deleted the fix/e2e-devacuum-runtime-assertions branch July 11, 2026 05:20
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