integrations

package
v1.67.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 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 DdTest

type DdTest interface {

	// Name returns the name of the test.
	Name() string

	// Suite returns the suite to which the test belongs.
	Suite() DdTestSuite

	// Close closes the test with the given status.
	Close(status TestResultStatus)

	// CloseWithFinishTime closes the test with the given status and finish time.
	CloseWithFinishTime(status TestResultStatus, finishTime time.Time)

	// CloseWithFinishTimeAndSkipReason closes the test with the given status, finish time, and skip reason.
	CloseWithFinishTimeAndSkipReason(status TestResultStatus, finishTime time.Time, skipReason string)

	// 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
}

DdTest represents an individual test within a suite.

type DdTestModule

type DdTestModule interface {

	// Session returns the test session to which the module belongs.
	Session() DdTestSession

	// 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()

	// CloseWithFinishTime closes the test module with the given finish time.
	CloseWithFinishTime(finishTime time.Time)

	// GetOrCreateSuite returns an existing suite or creates a new one with the given name.
	GetOrCreateSuite(name string) DdTestSuite

	// GetOrCreateSuiteWithStartTime returns an existing suite or creates a new one with the given name and start time.
	GetOrCreateSuiteWithStartTime(name string, startTime time.Time) DdTestSuite
	// contains filtered or unexported methods
}

DdTestModule represents a module within a test session.

type DdTestSession

type DdTestSession interface {

	// 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)

	// CloseWithFinishTime closes the test session with the given exit code and finish time.
	CloseWithFinishTime(exitCode int, finishTime time.Time)

	// GetOrCreateModule returns an existing module or creates a new one with the given name.
	GetOrCreateModule(name string) DdTestModule

	// GetOrCreateModuleWithFramework returns an existing module or creates a new one with the given name, framework, and framework version.
	GetOrCreateModuleWithFramework(name string, framework string, frameworkVersion string) DdTestModule

	// GetOrCreateModuleWithFrameworkAndStartTime returns an existing module or creates a new one with the given name, framework, framework version, and start time.
	GetOrCreateModuleWithFrameworkAndStartTime(name string, framework string, frameworkVersion string, startTime time.Time) DdTestModule
	// contains filtered or unexported methods
}

DdTestSession represents a session for a set of tests.

func CreateTestSession

func CreateTestSession() DdTestSession

CreateTestSession initializes a new test session. It automatically determines the command and working directory.

func CreateTestSessionWith

func CreateTestSessionWith(command string, workingDirectory string, framework string, startTime time.Time) DdTestSession

CreateTestSessionWith initializes a new test session with specified command, working directory, framework, and start time.

type DdTestSuite

type DdTestSuite interface {

	// Module returns the module to which the suite belongs.
	Module() DdTestModule

	// Name returns the name of the suite.
	Name() string

	// Close closes the test suite.
	Close()

	// CloseWithFinishTime closes the test suite with the given finish time.
	CloseWithFinishTime(finishTime time.Time)

	// CreateTest creates a new test with the given name.
	CreateTest(name string) DdTest

	// CreateTestWithStartTime creates a new test with the given name and start time.
	CreateTestWithStartTime(name string, startTime time.Time) DdTest
	// contains filtered or unexported methods
}

DdTestSuite represents a suite of tests within a 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
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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