Documentation
¶
Overview ¶
Package retryselect chooses which feature paths a retried behaviour run executes. scripts/run-with-infra-retry.sh retries an infrastructure-classified run once; rerunning the whole suite takes as long as the first attempt and does not fit the merge queue's check window, so the retry reruns only the scenarios attempt 1 recorded as failed.
The wrapper passes attempt 1's failure-class report through EnvVar. Each failed scenario's record names its feature file and scenario; Select parses that file and returns a godog "path:line" entry for every scenario with that name. A name it cannot find, for example one changed by redaction, falls back to the whole feature file. A report with a bootstrap failure, or a scenario failure without a feature file, falls back to the full suite, since nothing narrower is known to be enough.
Index ¶
Constants ¶
const EnvVar = "BEHAVIOUR_RETRY_FROM"
EnvVar names the path of attempt 1's failure-class report. The infra-retry wrapper sets it for attempt 2 only.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Selection ¶
type Selection struct {
// Paths are the godog feature paths to run.
Paths []string
// Targeted is true when Paths names only the failed scenarios or
// their feature files, and false when the run executes the full
// suite.
Targeted bool
// Reason explains a full-suite selection on a retry; it is empty
// when Targeted is true or when the run is not a retry.
Reason string
}
Selection is the set of feature paths a run executes.
func Select ¶
Select returns the feature paths for a run. reportPath is attempt 1's failure-class report, or "" when the run is not a retry; then the suite's own featurePaths run unchanged. fsys must resolve feature files the way godog does, by the same relative paths.
An unreadable or malformed report, a report whose class is not infrastructure, or a failed scenario outside featurePaths is an error: the wrapper only retries infrastructure-classified runs, so any of these means the report is not the one the retry was granted for.