skip

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: MPL-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package skip provides helper functions for skipping test cases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Architecture

func Architecture(t T, names ...string)

Architecture will skip the test if the Go runtime detects the system architecture matches one of the given names.

func CgroupsVersion

func CgroupsVersion(t T, version int)

CgroupsVersion will skip the test if the system does not match the given cgroups version.

func CommandUnavailable

func CommandUnavailable(t T, command string)

CommandUnavailable will skip the test if the given command cannot be found on the system PATH.

func DockerUnavailable

func DockerUnavailable(t T)

DockerUnavailable will skip the test if the docker command cannot be found on the system PATH.

func EnvironmentVariableMatches

func EnvironmentVariableMatches(t T, name string, values ...string)

EnvironmentVariableMatches will skip the test if the system environment matches one of the given environment variable values.

func EnvironmentVariableNotMatches

func EnvironmentVariableNotMatches(t T, name string, values ...string)

EnvironmentVariableNotMatches will skip the test if the system environment does not match one of the given environment variable values.

func EnvironmentVariableNotSet

func EnvironmentVariableNotSet(t T, name string)

EnvironmentVariableNotSet will skip the test if the given environment variable is not set in the system environment.

func EnvironmentVariableSet

func EnvironmentVariableSet(t T, name string)

EnvironmentVariableSet will skip the test if the given environment variable is set to any value.

func Error

func Error(t T, err error)

Error will skip the test if err is not nil.

func MaximumCores

func MaximumCores(t T, num int)

MaximumCores will skip the test if the number of cores on the system exceeds the given maximum.

func MinimumCores

func MinimumCores(t T, num int)

MinimumCores will skip the test if the system does not meet the minimum number of CPU cores.

func NotArchitecture

func NotArchitecture(t T, names ...string)

NotArchitecture will skip the test if the Go runtime the system architecture does not match one of the given names.

func NotOperatingSystem

func NotOperatingSystem(t T, names ...string)

NotOperatingSystem will skip the test if the Go runtime detects the operating system does not match one of the given names.

func NotUserRoot

func NotUserRoot(t T)

NotUserRoot will skip the test if the test is not being run as the root user.

Uses the effective UID value to determine user.

func OperatingSystem

func OperatingSystem(t T, names ...string)

OperatingSystem will skip the test if the Go runtime detects the operating system matches one of the given names.

func PodmanUnavailable

func PodmanUnavailable(t T)

PodmanUnavailable will skip the test if the podman command cannot be found on the system PATH.

func UserRoot

func UserRoot(t T)

UserRoot will skip the test if the test is being run as the root user.

Uses the effective UID value to determine user.

Types

type T

type T interface {
	Skipf(string, ...any)
	Fatalf(string, ...any)
}

T is the minimal set of functions to be implemented by any testing framework compatible with the skip package.

Jump to

Keyboard shortcuts

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