InternalRunnerTestInfo
Provider that signals that a rule can be tested using Buck2's internal test runner, bypassing the external TPX runner. This provider has the same API as ExternalRunnerTestInfo but uses a different execution strategy.
InternalRunnerTestInfo.command
InternalRunnerTestInfo.command: list
A Starlark value representing the command for this test. The test runner is what gives meaning to this command.
InternalRunnerTestInfo.contacts
InternalRunnerTestInfo.contacts: list[str]
A starlark value representing the contacts for this test. This is largely expected to be an oncall, though it's not validated in any way.
InternalRunnerTestInfo.default_executor
InternalRunnerTestInfo.default_executor: CommandExecutorConfig | None
Default executor to use to run tests. If none is passed we will default to the execution platform.
InternalRunnerTestInfo.env
InternalRunnerTestInfo.env: dict[str, typing.Any]
A Starlark value representing the environment for this test. This is of type dict[str, ArgLike].
InternalRunnerTestInfo.exec_group
InternalRunnerTestInfo.exec_group: ExecGroup | None
The execution group whose execution platform runs the tests when the test runner does not request an executor. When the analysis of a rule that declares the group creates the test info, the group's executor is recorded in default_executor, so it still applies when another rule returns the test info. Nothing is recorded when the group has no compatible execution platform, when the rule does not declare the group, or outside rule analysis; the test then resolves the group against the tested target when it runs. A passed default_executor wins and the group is not resolved, so copying a test info field by field works in any rule. A rule that declares named groups but not DefaultExecGroup must set exec_group or default_executor; executor_overrides does not replace them, as the tests run in the default group whenever no override is picked.
InternalRunnerTestInfo.executor_overrides
InternalRunnerTestInfo.executor_overrides: dict[str, CommandExecutorConfig]
Executors that can be used to override the default executor.
InternalRunnerTestInfo.labels
InternalRunnerTestInfo.labels: list[str]
A starlark value representing the labels for this test.
InternalRunnerTestInfo.listing_command
InternalRunnerTestInfo.listing_command: list
A Starlark value representing the command used for test discovery (listing). This is the command that runs the test binary with framework-specific listing flags (e.g., ["binary", "--gtest_list_tests"] for GTest). The internal runner uses this for the listing step, while command is used for execution.
InternalRunnerTestInfo.local_resources
InternalRunnerTestInfo.local_resources: dict[str, Label | None]
Mapping from a local resource type to a target with a corresponding provider. Required types are passed from test runner. If the value for a corresponding type is omitted it means local resource should be ignored when executing tests even if those are passed as required from test runner.
InternalRunnerTestInfo.parse_test_listing
InternalRunnerTestInfo.parse_test_listing: typing.Callable[[str], list[dict[str, typing.Any]]]
A Starlark callable that parses test listing output into structured test entries. The callback signature is:
def parse_test_listing(listing_content: str) -> list[dict[str, ...]]:
"""Returns list of dicts with keys:
"name": str — human-readable display name
"filter": str — argument to select this test for execution
"""
InternalRunnerTestInfo.parse_test_result
InternalRunnerTestInfo.parse_test_result: typing.Callable[[str, str, int], list[dict[str, typing.Any]]]
A Starlark callable that parses test execution output into structured per-test results. The callback signature is:
def parse_test_result(stdout: str, stderr: str, exit_code: int) -> list[dict[str, ...]]:
"""Returns list of dicts with keys:
"name": str — test name (should match listing name)
"status": str — "PASS", "FAIL", "SKIP", "TIMEOUT", "OMITTED", etc.
"message": str | None — failure/skip reason
"duration": float | None — duration of this test case
"details": str | None — full diagnostic output
"""
InternalRunnerTestInfo.required_local_resources
InternalRunnerTestInfo.required_local_resources: list[RequiredTestLocalResource]
List of local resource types which should be set up additionally to those which are passed from test runner. Allows specifying local resources on a per-rule basis.
InternalRunnerTestInfo.run_from_project_root
InternalRunnerTestInfo.run_from_project_root: bool
Whether this test should run from the project root, as opposed to the cell root
Defaults to True.
InternalRunnerTestInfo.test_type
InternalRunnerTestInfo.test_type: str
A Starlark value representing the type of this test.
InternalRunnerTestInfo.use_project_relative_paths
InternalRunnerTestInfo.use_project_relative_paths: bool
Whether this test should use relative paths
InternalRunnerTestInfo.worker
InternalRunnerTestInfo.worker: None | WorkerInfo
Configuration needed to spawn a new worker. This worker will be used to run every single command related to test execution, including listing.