Documentation
¶
Index ¶
Constants ¶
const ( ActionStart = "start" ActionPass = "pass" ActionFail = "fail" ActionSkip = "skip" ActionOutput = "output" )
Go test2json (TestEvent)action constants for JSON test output See https://cs.opensource.google/go/go/+/master:src/cmd/test2json/main.go;l=34-60
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Registry *registry.Registry
TargetGate string
WorkDir string
Log log.Logger
GoBinary string // path to the Go binary
AllowSkips bool // Whether to allow skipping tests when preconditions are not met
OutputRealtimeLogs bool // Whether to output test logs to the console
TestLogLevel string // Log level to be used for the tests
FileLogger *logging.FileLogger // Logger for storing test results
NetworkName string // Name of the network being tested
DevnetEnv *env.DevnetEnv
}
Config holds configuration for creating a new runner
type GateResult ¶
type GateResult struct {
ID string
Description string
Tests map[string]*types.TestResult
Suites map[string]*SuiteResult
Status types.TestStatus
Duration time.Duration
Stats ResultStats
Inherited []string
}
GateResult captures aggregated results for a gate
type ResultStats ¶
type ResultStats struct {
Total int
Passed int
Failed int
Skipped int
StartTime time.Time
EndTime time.Time
}
ResultStats tracks test statistics at each level
type RunnerResult ¶
type RunnerResult struct {
Gates map[string]*GateResult
Status types.TestStatus
Duration time.Duration
Stats ResultStats
RunID string
}
RunnerResult captures the complete test run results
func (*RunnerResult) GetValidators ¶
func (r *RunnerResult) GetValidators() []types.ValidatorMetadata
GetValidators returns all validators in the test run
func (*RunnerResult) String ¶
func (r *RunnerResult) String() string
String returns a formatted string representation of the test results
type SuiteResult ¶
type SuiteResult struct {
ID string
Description string
Tests map[string]*types.TestResult
Status types.TestStatus
Duration time.Duration
Stats ResultStats
}
SuiteResult captures aggregated results for a test suite
type TestEvent ¶ added in v0.1.5
type TestEvent struct {
Time time.Time // Time the event occurred
Action string // The action taken (run, pause, cont, pass, fail, skip, output)
Package string // The package being tested
Test string // The test function name (may be empty for package events)
Output string // Output text (may be empty)
Elapsed float64 // Elapsed time in seconds for the specific action
}
TestEvent represents a single event from the go test JSON output
type TestRunner ¶
type TestRunner interface {
RunAllTests(ctx context.Context) (*RunnerResult, error)
RunTest(ctx context.Context, metadata types.ValidatorMetadata) (*types.TestResult, error)
ReproducibleEnv() Env
}
TestRunner defines the interface for running acceptance tests
func NewTestRunner ¶
func NewTestRunner(cfg Config) (TestRunner, error)
NewTestRunner creates a new test runner instance
type TestRunnerWithFileLogger ¶ added in v0.1.8
type TestRunnerWithFileLogger interface {
TestRunner
SetFileLogger(logger *logging.FileLogger)
}
TestRunnerWithFileLogger extends the TestRunner interface with a method to set the file logger after creation