IMPORTANT: The Bazel docs have moved! Please update your bookmark to

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

Extensions > API reference > testing


Helper methods for Starlark to access testing infrastructure.


ExecutionInfo testing.ExecutionInfo(requirements)

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


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.


TestEnvironmentInfo testing.TestEnvironment(environment)

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


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.