yatest

package
v0.5.11-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package yatest provides access to testing context, when running under ya make -t.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryPath

func BinaryPath(dataPath string) (string, error)

func BuildFlag

func BuildFlag(name string) (string, bool)

BuildFlag returns the value of the requested build flag

func BuildPath

func BuildPath(dataPath string) string

BuildPath returns absolute path to the build directory.

func BuildType

func BuildType() string

BuildType returns build type that was used to compile the test

func CCompilerPath

func CCompilerPath() string

func CxxCompilerPath

func CxxCompilerPath() string

func EnvFile

func EnvFile() string

func GlobalResourcePath

func GlobalResourcePath(name string) string

GlobalResourcePath returns absolute path to a directory containing global build resource.

func HasRAMDrive

func HasRAMDrive() bool

HasRAMDrive returns true if ramdrive is enabled in tests

func HasYaTestContext

func HasYaTestContext() bool

func OutputPath

func OutputPath(dataPath string) string

OutputPath returns absolute path to the output directory (testing_out_stuff).

func OutputRAMDrivePath

func OutputRAMDrivePath(dataPath string) string

OutputRAMDrivePath returns absolute path to the ramdrive output directory

func PrepareGOCACHE

func PrepareGOCACHE() error

func PrepareGOPATH

func PrepareGOPATH() error

func ProjectPath

func ProjectPath() string

ProjectPath returns arcadia-relative path to the test project

func PythonBinPath

func PythonBinPath() string

PythonBinPath returns absolute path to the python

Warn: if you are using build with system python (-DUSE_SYSTEM_PYTHON=X) beware that some python bundles are built in a stripped-down form that is needed for building, not running tests. See comments in the file below to find out which version of python is compatible with tests. https://a.yandex-team.ru/arc/trunk/arcadia/build/platform/python/resources.inc

func PythonLibPath

func PythonLibPath() string

func RAMDrivePath

func RAMDrivePath(dataPath string) string

RAMDrivePath returns absolute path to the ramdrive directory

func RelaxedGlobalResourcePath

func RelaxedGlobalResourcePath(name string) (string, bool)

func Sanitizer

func Sanitizer() string

Sanitizer returns sanitizer name that was used to compile the test

func SourcePath

func SourcePath(arcadiaPath string) string

SourcePath returns absolute path to source directory.

arcadiaPath must be declared using DATA macro inside ya.make.

func TestParam

func TestParam(name string) (string, bool)

TestParam returns the value of the requested test parameter

func TestToolPath

func TestToolPath() string

func WorkPath

func WorkPath(dataPath string) string

WorkPath returns absolute path to the work directory (initial test cwd).

func YtHDDPath

func YtHDDPath(dataPath string) string

YtHDDPath returns absolute path to the directory mounted to ext4 fs in YT

Types

type TestContext

type TestContext struct {
	Build struct {
		BuildType string            `json:"build_type"`
		Flags     map[string]string `json:"flags"`
		Sanitizer string            `json:"sanitizer"`
	} `json:"build"`

	Runtime struct {
		BuildRoot              string            `json:"build_root"`
		OutputPath             string            `json:"output_path"`
		ProjectPath            string            `json:"project_path"`
		PythonBin              string            `json:"python_bin"`
		PythonLibPath          string            `json:"python_lib_path"`
		RAMDrivePath           string            `json:"ram_drive_path"`
		YtHDDPath              string            `json:"yt_hdd_path"`
		TestOutputRAMDrivePath string            `json:"test_output_ram_drive_path"`
		SourceRoot             string            `json:"source_root"`
		WorkPath               string            `json:"work_path"`
		TestToolPath           string            `json:"test_tool_path"`
		TestParameters         map[string]string `json:"test_params"`
	} `json:"runtime"`

	Resources struct {
		Global map[string]string `json:"global"`
	} `json:"resources"`

	Internal struct {
		EnvFile string `json:"env_file"`
	} `json:"internal"`

	Initialized bool
}

Jump to

Keyboard shortcuts

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