Documentation
¶
Index ¶
- func RunCompiledCases(t *testing.T, dir string, opts ...Option)
- func RunSourceCases(t *testing.T, dir string, opts ...Option)
- type Command
- type CommandResult
- type CompiledCase
- type FileCheck
- type Option
- type PlanEnvelopeCheck
- type PlanSummaryCheck
- type RemoteSource
- type SourceCase
- type StateEnvelopeCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunCompiledCases ¶
RunCompiledCases runs compiled-factory cases found under dir.
Types ¶
type Command ¶
type Command struct {
Name string `json:"name"`
Args []string `json:"args"`
Dir string `json:"dir"`
Env map[string]string `json:"env"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
ExitCode int `json:"exitCode"`
SkipPin bool `json:"skipPin"`
TamperPlanFiles []string `json:"tamperPlanFiles"`
}
Command describes one subprocess invocation.
type CommandResult ¶
CommandResult stores the process result for one command.
type CompiledCase ¶
type CompiledCase struct {
Name string `json:"name"`
Dir string `json:"-"`
FactoryPath string `json:"factoryPath"`
LibraryPath string `json:"libraryPath"`
Build bool `json:"build"`
Commands []Command `json:"commands"`
Files []FileCheck `json:"files"`
PlanSummaries []PlanSummaryCheck `json:"planSummaries"`
PlanEnvelopes []PlanEnvelopeCheck `json:"planEnvelopes"`
StateEnvelopes []StateEnvelopeCheck `json:"stateEnvelopes"`
AbsentFiles []string `json:"absentFiles"`
StateSummary string `json:"stateSummary"`
StateSeed string `json:"stateSeed"`
ExtraStateSnapshots int `json:"extraStateSnapshots"`
StateLocks []string `json:"stateLocks"`
Deterministic bool `json:"deterministic"`
}
CompiledCase describes a compiled-factory e2e case.
func DiscoverCompiledCases ¶
func DiscoverCompiledCases(dir string) ([]CompiledCase, error)
DiscoverCompiledCases reads compiled-factory case.json files under dir.
type Option ¶
type Option func(*config)
Option configures e2e case execution.
func WithE2ELibraryDir ¶
func WithRepoRoot ¶
func WithUnobinExecutable ¶
type PlanEnvelopeCheck ¶
PlanEnvelopeCheck describes a plan envelope compared to a golden.
type PlanSummaryCheck ¶
PlanSummaryCheck describes a plan file decoded and compared to a golden.
type RemoteSource ¶
type RemoteSource struct {
Key string `json:"key"`
Path string `json:"path"`
Commit string `json:"commit"`
ProjectPath string `json:"projectPath"`
ProjectSubdir string `json:"projectSubdir"`
PackageSubdir string `json:"packageSubdir"`
SourcePath bool `json:"sourcePath"`
ModuleRootPath string `json:"moduleRootPath"`
ModulePath string `json:"modulePath"`
GoImportPath string `json:"goImportPath"`
}
RemoteSource describes a fake remote repository used by source-root cases.
type SourceCase ¶
type SourceCase struct {
Name string `json:"name"`
Dir string `json:"-"`
RootPath string `json:"rootPath"`
Executor string `json:"executor"`
CLIVersion string `json:"cliVersion"`
Build bool `json:"build"`
Remotes []RemoteSource `json:"remotes"`
Tags map[string][]string `json:"tags"`
Commands []Command `json:"commands"`
Files []FileCheck `json:"files"`
AbsentFiles []string `json:"absentFiles"`
}
SourceCase describes a source-root CLI e2e case.
func DiscoverSourceCases ¶
func DiscoverSourceCases(dir string) ([]SourceCase, error)
DiscoverSourceCases reads source-root case.json files under dir.
type StateEnvelopeCheck ¶
StateEnvelopeCheck describes a current state envelope compared to a golden.