Skip to main content

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

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.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.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: WorkerInfo

Configuration needed to spawn a new worker. This worker will be used to run every single command related to test execution, including listing.