Skip to content

test: promote force and rollback runtime e2e scenarios (U6)#118

Merged
joshua-temple merged 1 commit into
mainfrom
test/e2e-promote-rollback
Jun 11, 2026
Merged

test: promote force and rollback runtime e2e scenarios (U6)#118
joshua-temple merged 1 commit into
mainfrom
test/e2e-promote-rollback

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

Two promote workflow paths had no runtime coverage:

  • The force dispatch input (bypasses the no-op promotion guard) had no e2e scenario.
  • The rollback_on_failure path (rollback jobs that revert successful deploys when a sibling deploy fails) had no failure-injection scenario.

Changes

Harness (e2e/harness/):

  • multistep.go: added RollbackOnFailure bool to PromoteStep with yaml tag rollback_on_failure. Mirrors the promote workflow's rollback_on_failure dispatch input.
  • runner.go: wire RollbackOnFailure into executePromote - passes rollback_on_failure="true" in the workflow dispatch inputs when set.

Scenarios (e2e/scenarios/promote/):

  • promote-force.yaml: three-step scenario. Clean promote succeeds; re-promote of the same SHA is rejected by the no-op guard (expect_failure); third promote with force: true bypasses the guard and succeeds. Asserts test state SHA matches dev after force.
  • promote-rollback-runtime.yaml: commits two reusable deploy workflows (deploy-infra.yaml always succeeds; deploy-app.yaml checks out the promoted SHA and exit 1s on a marker file). First promote populates test state. A marker commit is orchestrated into dev. Second promote with rollback_on_failure: true runs both deploys - app fails on the marker, so rollback-infra runs to revert the successful infra deploy. Asserts preflight/promote/deploy-infra = success, deploy-app = failure, rollback-infra = success, rollback-app = skipped.

Verification

  • go build ./... and cd e2e && go vet ./...: clean.
  • Both scenarios pass under act/gitea locally (-timeout 9m each).
  • Docker cleaned before and after each run.
  • golangci-lint run ./e2e/...: clean.

Gitea-observable trim

The exact rollback_sha value passed to the infra deploy callback is trimmed to the job-conclusion claim (rollback-infra: success). On real GitHub the SHA is observable through deployment objects; gitea/act do not model those. The job-conclusion claim is the meaningful observable: the rollback path ran and completed successfully.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple joshua-temple merged commit a424be8 into main Jun 11, 2026
6 checks passed
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