steps

package
v0.46.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupScenario

func CleanupScenario(w *world.World)

func CollectFailureLogs added in v0.46.0

func CollectFailureLogs(ctx context.Context, w *world.World, scenarioErr error)

CollectFailureLogs is called by the suite's After hook for a failed scenario, before CleanupScenario and before the leased repository — and with it every run's logs — is deleted. It saves the logs of the repository's recent workflow runs (and the scenario's resolved run) that were not already saved during the scenario, which covers the failure paths where no step got hold of a run: a wait that timed out, a setup step that failed before any run was resolved, or a step that waits for a run without saving its logs.

It always writes a failure-summary.txt under debug-scenario-<name>-<suffix>/ listing the scenario error and, for each run, where its logs were saved or why they could not be collected — so every failed scenario leaves an artifact, even when there are no logs to collect.

Like saveWorkflowRunLogs it is best-effort, a no-op when BEHAVIOUR_ARTIFACT_DIR is unset, redacts everything it writes, and writes files 0o600.

func DeactivateKillSwitch added in v0.34.0

func DeactivateKillSwitch(w *world.World) error

DeactivateKillSwitch sets kill_switch: false in the enrolled repo's config.yaml. Exported so CleanupScenario (in package steps) can call it during scenario teardown.

func DisableReactionNotifications added in v0.38.0

func DisableReactionNotifications(w *world.World) error

DisableReactionNotifications removes the status_notifications from the enrolled repo's config.yaml. Exported so CleanupScenario can call it during scenario teardown.

func Register

func Register(sc *godog.ScenarioContext)

Register binds all step definitions. Steps retrieve their per-scenario World from the godog context via world.FromContext.

func RestoreAgents added in v0.38.0

func RestoreAgents(w *world.World) error

RestoreAgents sets the agents list back to the pre-scenario value captured by snapshotAgents. Exported so CleanupScenario can call it during scenario teardown.

func RestoreAllowedResources added in v0.38.0

func RestoreAllowedResources(w *world.World) error

RestoreAllowedResources sets allowed_remote_resources back to the pre-scenario value captured by snapshotAllowedResources. Exported so CleanupScenario can call it during scenario teardown.

func RestoreRuntime added in v0.37.0

func RestoreRuntime(w *world.World) error

RestoreRuntime puts the install-time runtime back. Exported so CleanupScenario can call it during scenario teardown.

func ValidateSlotClean added in v0.44.0

func ValidateSlotClean(w *world.World) error

ValidateSlotClean reads the leased repo's config and fails if a previous scenario left mutable state behind (e.g. kill switch on, OWNERS auth enabled). Called when a scenario leases its repo, so stale state is caught before it causes a silent false positive.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL