Documentation ¶
Index ¶
- Constants
- func EnsureCiVisibilityInitialization()
- func ExitCiVisibility()
- func GetEarlyFlakeDetectionSettings() *net.EfdResponseData
- func GetSettings() *net.SettingsResponseData
- func GetSkippableTests() map[string]map[string][]net.SkippableResponseDataAttributes
- func InitializeCIVisibilityMock() mocktracer.Tracer
- func PushCiVisibilityCloseAction(action ciVisibilityCloseAction)
- type ErrorOption
- type FlakyRetriesSetting
- type Test
- type TestCloseOption
- type TestModule
- type TestModuleCloseOption
- type TestModuleStartOption
- type TestResultStatus
- type TestSession
- type TestSessionCloseOption
- type TestSessionStartOption
- func WithTestSessionCommand(command string) TestSessionStartOption
- func WithTestSessionFramework(framework, frameworkVersion string) TestSessionStartOption
- func WithTestSessionStartTime(startTime time.Time) TestSessionStartOption
- func WithTestSessionWorkingDirectory(workingDirectory string) TestSessionStartOption
- type TestStartOption
- type TestSuite
- type TestSuiteCloseOption
- type TestSuiteStartOption
Constants ¶
const ( DefaultFlakyRetryCount = 5 DefaultFlakyTotalRetryCount = 1_000 )
Variables ¶
This section is empty.
Functions ¶
func EnsureCiVisibilityInitialization ¶
func EnsureCiVisibilityInitialization()
EnsureCiVisibilityInitialization initializes the CI visibility tracer if it hasn't been initialized already.
func ExitCiVisibility ¶
func ExitCiVisibility()
ExitCiVisibility executes all registered close actions and stops the tracer.
func GetEarlyFlakeDetectionSettings ¶ added in v1.69.0
func GetEarlyFlakeDetectionSettings() *net.EfdResponseData
GetEarlyFlakeDetectionSettings gets the early flake detection known tests data
func GetSettings ¶ added in v1.69.0
func GetSettings() *net.SettingsResponseData
GetSettings gets the settings from the backend settings endpoint
func GetSkippableTests ¶ added in v1.70.0
func GetSkippableTests() map[string]map[string][]net.SkippableResponseDataAttributes
GetSkippableTests gets the skippable tests from the backend
func InitializeCIVisibilityMock ¶
func InitializeCIVisibilityMock() mocktracer.Tracer
InitializeCIVisibilityMock initialize the mocktracer for CI Visibility usage
func PushCiVisibilityCloseAction ¶
func PushCiVisibilityCloseAction(action ciVisibilityCloseAction)
PushCiVisibilityCloseAction adds a close action to be executed when CI visibility exits.
Types ¶
type ErrorOption ¶ added in v1.70.0
type ErrorOption func(*tslvErrorOptions)
ErrorOption is a function that sets an option for creating an error.
func WithError ¶ added in v1.70.0
func WithError(err error) ErrorOption
WithError sets the error on the options.
func WithErrorInfo ¶ added in v1.70.0
func WithErrorInfo(errType string, message string, callstack string) ErrorOption
WithErrorInfo sets detailed error information on the options.
type FlakyRetriesSetting ¶ added in v1.69.0
type FlakyRetriesSetting struct { RetryCount int64 TotalRetryCount int64 RemainingTotalRetryCount int64 }
FlakyRetriesSetting struct to hold all the settings related to flaky tests retries
func GetFlakyRetriesSettings ¶ added in v1.69.0
func GetFlakyRetriesSettings() *FlakyRetriesSetting
GetFlakyRetriesSettings gets the flaky retries settings
type Test ¶ added in v1.70.0
type Test interface { // TestID returns the ID of the test. TestID() uint64 // Name returns the name of the test. Name() string // Suite returns the suite to which the test belongs. Suite() TestSuite // Close closes the test with the given status. Close(status TestResultStatus, options ...TestCloseOption) // SetTestFunc sets the function to be tested. (Sets the test.source tags and test.codeowners) SetTestFunc(fn *runtime.Func) // SetBenchmarkData sets benchmark data for the test. SetBenchmarkData(measureType string, data map[string]any) // contains filtered or unexported methods }
Test represents an individual test within a suite.
type TestCloseOption ¶ added in v1.70.0
type TestCloseOption func(*tslvTestCloseOptions)
TestCloseOption represents an option for closing a test.
func WithTestFinishTime ¶ added in v1.70.0
func WithTestFinishTime(finishTime time.Time) TestCloseOption
WithTestFinishTime sets the finish time of the test.
func WithTestSkipReason ¶ added in v1.70.0
func WithTestSkipReason(skipReason string) TestCloseOption
WithTestSkipReason sets the skip reason of the test.
type TestModule ¶ added in v1.70.0
type TestModule interface { // ModuleID returns the ID of the module. ModuleID() uint64 // Session returns the test session to which the module belongs. Session() TestSession // Framework returns the testing framework used by the module. Framework() string // Name returns the name of the module. Name() string // Close closes the test module. Close(options ...TestModuleCloseOption) // GetOrCreateSuite returns an existing suite or creates a new one with the given name. GetOrCreateSuite(name string, options ...TestSuiteStartOption) TestSuite // contains filtered or unexported methods }
TestModule represents a module within a test session.
type TestModuleCloseOption ¶ added in v1.70.0
type TestModuleCloseOption func(*tslvTestModuleCloseOptions)
TestModuleCloseOption represents an option for closing a test module.
func WithTestModuleFinishTime ¶ added in v1.70.0
func WithTestModuleFinishTime(finishTime time.Time) TestModuleCloseOption
WithTestModuleFinishTime sets the finish time for closing the test module.
type TestModuleStartOption ¶ added in v1.70.0
type TestModuleStartOption func(*tslvTestModuleStartOptions)
TestModuleStartOption represents an option that can be passed to GetOrCreateModule.
func WithTestModuleFramework ¶ added in v1.70.0
func WithTestModuleFramework(framework, frameworkVersion string) TestModuleStartOption
WithTestModuleFramework sets the testing framework used by the test module.
func WithTestModuleStartTime ¶ added in v1.70.0
func WithTestModuleStartTime(startTime time.Time) TestModuleStartOption
WithTestModuleStartTime sets the start time of the test module.
type TestResultStatus ¶
type TestResultStatus int
TestResultStatus represents the result status of a test.
const ( // ResultStatusPass indicates that the test has passed. ResultStatusPass TestResultStatus = 0 // ResultStatusFail indicates that the test has failed. ResultStatusFail TestResultStatus = 1 // ResultStatusSkip indicates that the test has been skipped. ResultStatusSkip TestResultStatus = 2 )
type TestSession ¶ added in v1.70.0
type TestSession interface { // SessionID returns the ID of the session. SessionID() uint64 // Command returns the command used to run the session. Command() string // Framework returns the testing framework used. Framework() string // WorkingDirectory returns the working directory of the session. WorkingDirectory() string // Close closes the test session with the given exit code. Close(exitCode int, options ...TestSessionCloseOption) // GetOrCreateModule returns an existing module or creates a new one with the given name. GetOrCreateModule(name string, options ...TestModuleStartOption) TestModule // contains filtered or unexported methods }
TestSession represents a session for a set of tests.
func CreateTestSession ¶
func CreateTestSession(options ...TestSessionStartOption) TestSession
CreateTestSession initializes a new test session with the given command and working directory.
type TestSessionCloseOption ¶ added in v1.70.0
type TestSessionCloseOption func(*tslvTestSessionCloseOptions)
TestSessionCloseOption represents an option that can be passed to Close.
func WithTestSessionFinishTime ¶ added in v1.70.0
func WithTestSessionFinishTime(finishTime time.Time) TestSessionCloseOption
WithTestSessionFinishTime sets the finish time of the test session.
type TestSessionStartOption ¶ added in v1.70.0
type TestSessionStartOption func(*tslvTestSessionStartOptions)
TestSessionStartOption represents an option that can be passed to CreateTestSession.
func WithTestSessionCommand ¶ added in v1.70.0
func WithTestSessionCommand(command string) TestSessionStartOption
WithTestSessionCommand sets the command used to run the test session.
func WithTestSessionFramework ¶ added in v1.70.0
func WithTestSessionFramework(framework, frameworkVersion string) TestSessionStartOption
WithTestSessionFramework sets the testing framework used in the test session.
func WithTestSessionStartTime ¶ added in v1.70.0
func WithTestSessionStartTime(startTime time.Time) TestSessionStartOption
WithTestSessionStartTime sets the start time of the test session.
func WithTestSessionWorkingDirectory ¶ added in v1.70.0
func WithTestSessionWorkingDirectory(workingDirectory string) TestSessionStartOption
WithTestSessionWorkingDirectory sets the working directory of the test session.
type TestStartOption ¶ added in v1.70.0
type TestStartOption func(*tslvTestStartOptions)
TestStartOption represents an option for starting a test.
func WithTestStartTime ¶ added in v1.70.0
func WithTestStartTime(startTime time.Time) TestStartOption
WithTestStartTime sets the start time for starting a test.
type TestSuite ¶ added in v1.70.0
type TestSuite interface { // SuiteID returns the ID of the suite. SuiteID() uint64 // Module returns the module to which the suite belongs. Module() TestModule // Name returns the name of the suite. Name() string // Close closes the test suite. Close(options ...TestSuiteCloseOption) // CreateTest creates a new test with the given name and options. CreateTest(name string, options ...TestStartOption) Test // contains filtered or unexported methods }
TestSuite represents a suite of tests within a module.
type TestSuiteCloseOption ¶ added in v1.70.0
type TestSuiteCloseOption func(*tslvTestSuiteCloseOptions)
TestSuiteCloseOption represents an option for closing a test suite.
func WithTestSuiteFinishTime ¶ added in v1.70.0
func WithTestSuiteFinishTime(finishTime time.Time) TestSuiteCloseOption
WithTestSuiteFinishTime sets the finish time for closing the test suite.
type TestSuiteStartOption ¶ added in v1.70.0
type TestSuiteStartOption func(*tslvTestSuiteStartOptions)
TestSuiteStartOption represents an option for starting a test suite.
func WithTestSuiteStartTime ¶ added in v1.70.0
func WithTestSuiteStartTime(startTime time.Time) TestSuiteStartOption
WithTestSuiteStartTime sets the start time for starting a test suite.