IMPORTANT: The Bazel docs have moved! Please update your bookmark to https://bazel.build/rules/lib/testing

You can read about the migration, and let us know what you think.

Extensions > API reference > testing

testing

Helper methods for Starlark to access testing infrastructure.

ExecutionInfo

ExecutionInfo testing.ExecutionInfo(requirements)

Creates a new execution info provider. Use this provider to specify specialenvironments requirements needed to run tests.

Parameters

Parameter Description
requirements required
A map of string keys and values to indicate special execution requirements, such as hardware platforms, etc. These keys and values are passed to the executor of the test action as parameters to configure the execution environment.

TestEnvironment

TestEnvironmentInfo testing.TestEnvironment(environment)

Creates a new test environment provider. Use this provider to specify extraenvironment variables to be made available during test execution.

Parameters

Parameter Description
environment required
A map of string keys and values that represent environment variables and their values. These will be made available during the test execution.