tests

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 15 Imported by: 6 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeDirAndAssert added in v1.7.0

func ChangeDirAndAssert(t *testing.T, dirPath string)

func ChangeDirWithCallback added in v1.7.0

func ChangeDirWithCallback(t *testing.T, originWd, destinationWd string) func()

ChangeDirWithCallback changes working directory to the given path and return function that change working directory back to the original path.

func CloseQuietly added in v1.55.0

func CloseQuietly(t *testing.T, closer io.Closer)

func ExcludeTestsPackage

func ExcludeTestsPackage(packages []string, packageToExclude string) []string

func GetLocalArtifactoryTokenIfNeeded added in v1.26.0

func GetLocalArtifactoryTokenIfNeeded(url string) (adminToken string)

func GetTestPackages

func GetTestPackages(searchPattern string) []string

func InitVcsSubmoduleTestDir added in v0.20.1

func InitVcsSubmoduleTestDir(t *testing.T, srcPath, tmpDir string) (submodulePath string)

func InitVcsWorktreeTestDir added in v1.26.0

func InitVcsWorktreeTestDir(t *testing.T, srcPath, tmpDir string) (worktreePath string)

func RedirectLogOutputToNil added in v1.34.0

func RedirectLogOutputToNil() (previousLog log.Log)

Set new logger with output redirection to a null logger. This is useful for negative tests. Caller is responsible to set the old log back.

func RemoveAllAndAssert added in v1.7.0

func RemoveAllAndAssert(t *testing.T, path string)

func RemoveAllQuietly added in v1.55.0

func RemoveAllQuietly(t *testing.T, path string)

func RemoveAndAssert added in v1.7.0

func RemoveAndAssert(t *testing.T, path string)

func RunTests

func RunTests(testsPackages []string, hideUnitTestsLog bool) error

func SetEnvAndAssert added in v1.7.0

func SetEnvAndAssert(t *testing.T, key, value string)

func SetEnvWithCallbackAndAssert added in v1.7.0

func SetEnvWithCallbackAndAssert(t *testing.T, key, value string) func()

func StartHttpServer

func StartHttpServer(handlers HttpServerHandlers) (int, error)

func UnSetEnvAndAssert added in v1.7.0

func UnSetEnvAndAssert(t *testing.T, key string)

Types

type HttpServerHandlers

type HttpServerHandlers map[string]func(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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