Skip to main content

Module TestProvider

Module TestProvider 

Source
Expand description

§TestProvider (Environment)

TestController impl for MountainEnvironment. Hosts the controller registry and routes test runs through proxied sidecars (extension-provided test frameworks). Native Rust controllers are not yet supported - they short-circuit to Skipped.

Layout (one export per file, file name = identity):

  • TestControllerState::Struct - per-controller registration.
  • TestRunStatus::Enum - Queued / Running / Passed / Failed / Skipped / Errored.
  • TestResult::Struct - per-test outcome.
  • TestRun::Struct - active test run record.
  • TestProviderState::Struct - aggregate controller + active-runs map, held inside ApplicationState behind a RwLock.

The trait impl TestController for MountainEnvironment and its private helpers stay in this parent file; they are dispatched via the trait, not directly addressable, so they don’t need atomic split for navigability.

VS Code reference:

  • vs/workbench/contrib/testing/common/testService.ts,
  • vs/workbench/contrib/testing/common/testTypes.ts.

Modules§

TestControllerState
Per-controller registration record. Carries the extension-provided identifier, label, owning sidecar, active flag, and supported test type tags. Stored in TestProviderState::Struct keyed by ControllerIdentifier.
TestProviderState
Aggregate state for the TestProvider: registered controllers and currently active test runs. Held inside ApplicationState behind a tokio::sync::RwLock for concurrent reads during test runs.
TestResult
Per-test outcome: identifier, fully-qualified name, status, optional duration in ms, and optional error/stack-trace pair populated on failures.
TestRun
Active test run record: run identifier, owning controller, current status, start instant, and per-test results keyed by test identifier. Stored in TestProviderState::Struct::ActiveRuns for the duration of the run.
TestRunStatus
Lifecycle state of a test run: Queued → Running → terminal (Passed / Failed / Skipped / Errored). Used both as the run-level aggregate and the per-test-result status.