tests

package
v0.0.0-...-06858c0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NonExistingIntegerID          = 9999
	NonExistingStringID           = "n0n-3x1st1ng-1d"
	DefaultFileName               = "test.txt"
	DefaultFileContent            = "Hello, Codemoon!"
	DefaultDirectoryName          = "test/"
	FileNameWithAbsolutePath      = "/test.txt"
	DefaultEnvironmentIDAsInteger = 0
	DefaultEnvironmentIDAsString  = "0"
	AnotherEnvironmentIDAsInteger = 42
	AnotherEnvironmentIDAsString  = "42"
	DefaultUUID                   = "MY-DEFAULT-RANDOM-UUID"
	AnotherUUID                   = "another-uuid-43"
	DefaultTemplateJobID          = "template-" + DefaultEnvironmentIDAsString
	DefaultRunnerID               = DefaultEnvironmentIDAsString + "-" + DefaultUUID
	AnotherRunnerID               = AnotherEnvironmentIDAsString + "-" + AnotherUUID
	DefaultExecutionID            = "s0m3-3x3cu710n-1d"
	DefaultMockID                 = "m0ck-1d"
	ShortTimeout                  = 100 * time.Millisecond
	DefaultTestTimeout            = 10 * time.Minute
)

Variables

View Source
var (
	ErrDefault              = errors.New("an error occurred")
	ErrCleanupDestroyReason = errors.New("destruction required for cleanup")

	DefaultPortMappings = []nomadApi.PortMapping{{To: defaultPort, Value: anotherPort, Label: "lit", HostIP: "127.0.0.1"}}
	DefaultMappedPorts  = []*dto.MappedPort{{ExposedPort: defaultPort, HostAddress: "127.0.0.1:1337"}}
)

Functions

func ChannelReceivesSomething

func ChannelReceivesSomething(ch chan bool, timeout time.Duration) bool

ChannelReceivesSomething waits timeout seconds for something to be received from channel ch. If something is received, it returns true. If the timeout expires without receiving anything, it returns false.

func RemoveMethodFromMock

func RemoveMethodFromMock(m *mock.Mock, method string)

Types

type MemoryLeakTestSuite

type MemoryLeakTestSuite struct {
	suite.Suite
	ExpectedGoroutineIncrease int
	//nolint:containedctx // We have to embed the context into the struct because we have no control over the parameters of testify.
	TestCtx context.Context
	// contains filtered or unexported fields
}

MemoryLeakTestSuite adds an assertion for checking Goroutine leaks. Be aware not to overwrite the SetupTest or TearDownTest function!

func (*MemoryLeakTestSuite) SetupTest

func (s *MemoryLeakTestSuite) SetupTest()

func (*MemoryLeakTestSuite) TearDownTest

func (s *MemoryLeakTestSuite) TearDownTest()

Directories

Path Synopsis
Package helpers contains functions that help executing tests.
Package helpers contains functions that help executing tests.

Jump to

Keyboard shortcuts

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