config

package
v0.0.0-...-fe933bc Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config provides project configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompareResults

type CompareResults struct {
	// expected
	Failed  map[string]TestResult
	Skipped map[string]TestResult
	Passed  map[string]TestResult

	// unexpected
	XFailed  map[string]TestResult
	XSkipped map[string]TestResult
	XPassed  map[string]TestResult

	Unknown map[string]TestResult

	Stats Stats
}

CompareResults represents the comparison between expected and actual test outcomes.

type Config

type Config struct {
	Runner  RunnerType
	Params  RunnerParams
	Results *ExpectedResults
}

Config represents project configuration.

type ExpectedResults

type ExpectedResults struct {
	Default Status
	Stats   *Stats

	// test names
	Fail   []string
	Skip   []string
	Pass   []string
	Ignore []string
}

ExpectedResults represents expected results for specific database.

func (*ExpectedResults) Compare

func (expected *ExpectedResults) Compare(actual map[string]TestResult) (*CompareResults, error)

Compare compares expected and actual results.

type RunnerParams

type RunnerParams interface {
	// contains filtered or unexported methods
}

RunnerParams is common interface for runner parameters.

type RunnerParamsCommand

type RunnerParamsCommand struct {
	Dir      string
	Setup    string
	Teardown string
	Tests    []RunnerParamsCommandTest
}

RunnerParamsCommand represents `command` runner parameters.

type RunnerParamsCommandTest

type RunnerParamsCommandTest struct {
	Name string
	Cmd  string
}

RunnerParamsCommandTest represents a single test in `command` runner parameters.

type RunnerParamsGoTest

type RunnerParamsGoTest struct {
	Dir  string
	Args []string
}

RunnerParamsGoTest represents `gotest` runner parameters.

type RunnerParamsYCSB

type RunnerParamsYCSB struct {
	Dir  string
	Args []string
}

RunnerParamsYCSB represents `ycsb` runner parameters.

type RunnerType

type RunnerType string

RunnerType represents the type of test runner used in the project configuration.

const (
	// RunnerTypeCommand indicates a command-line test runner.
	RunnerTypeCommand RunnerType = "command"

	// RunnerTypeGoTest indicates a Go test runner.
	RunnerTypeGoTest RunnerType = "gotest"

	// RunnerTypeYCSB indicates a YCSB test runner.
	RunnerTypeYCSB RunnerType = "ycsb"
)

type Stats

type Stats struct {
	Failed  int
	Skipped int
	Passed  int

	XFailed  int
	XSkipped int
	XPassed  int

	Unknown int
}

Stats represent expected or actual fail/skip/pass statistics for specific database.

type Status

type Status string

Status represents the status of a single test.

const (
	Fail    Status = "fail"
	Skip    Status = "skip"
	Pass    Status = "pass"
	Unknown Status = "unknown" // result can't be parsed
	Ignore  Status = "ignore"  // for fluky tests
)

Constants representing different expected or actual test statuses.

type TestResult

type TestResult struct {
	Status       Status
	Output       string
	Measurements map[string]float64
}

TestResult represents the actual outcome of a single test.

func (*TestResult) IndentedOutput

func (tr *TestResult) IndentedOutput() string

IndentedOutput returns the output of a test result with indented lines.

Jump to

Keyboard shortcuts

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