internal/core/acceptance
import "github.com/nilstate/scafld/v2/internal/core/acceptance"
Package acceptance evaluates criterion evidence against expected result kinds.
Constants
Source: internal/core/acceptance/model.go:10
const (
// ExpectedExitCodeZero passes when the command exits with code 0.
ExpectedExitCodeZero ExpectedKind = "exit_code_zero"
// ExpectedExitCodeNonzero passes when the command exits with a non-zero code.
ExpectedExitCodeNonzero ExpectedKind = "exit_code_nonzero"
// ExpectedNoMatches passes when the captured output is empty.
ExpectedNoMatches ExpectedKind = "no_matches"
// ExpectedManual marks a criterion that requires human evidence.
ExpectedManual ExpectedKind = "manual"
)Functions
func Evaluate(kind ExpectedKind, evidence Evidence) Result
Source: internal/core/acceptance/model.go:42
Evaluate compares evidence with the requested expected kind.
func ValidExpectedKind(kind ExpectedKind) bool
Source: internal/core/acceptance/model.go:20
ValidExpectedKind reports whether kind is supported by the evaluator.
Types
type Evidence
Source: internal/core/acceptance/model.go:30
Evidence is the command output used to evaluate an acceptance criterion.
type Evidence struct {
ExitCode int
Output string
}Fields
ExitCode intOutput string
type ExpectedKind
Source: internal/core/acceptance/model.go:6
ExpectedKind names the machine-checkable expectation for criterion evidence.
type ExpectedKind stringtype Result
Source: internal/core/acceptance/model.go:36
Result is the normalized pass/fail/pending outcome for criterion evidence.
type Result struct {
Status string
Reason string
}Fields
Status stringReason string
