dream_test/parallel

Types

Configuration for parallel test execution.

pub type ParallelConfig {
  ParallelConfig(max_concurrency: Int, default_timeout_ms: Int)
}

Constructors

  • ParallelConfig(max_concurrency: Int, default_timeout_ms: Int)

Values

pub fn default_config() -> ParallelConfig

Default parallel configuration: 4 concurrent tests, 5 second timeout.

pub fn run_parallel(
  config: ParallelConfig,
  test_cases: List(types.TestCase),
) -> List(types.TestResult)

Run tests in parallel with the given configuration.

Tests are executed concurrently up to max_concurrency. Results are returned in the same order as the input tests.

pub fn run_suite_parallel(
  config: ParallelConfig,
  suite: types.TestSuite,
) -> List(types.TestResult)

Run a test suite with before_all/after_all semantics.

Execution flow for each group:

  1. Run before_all hooks sequentially
  2. If any fail, mark all tests in group as SetupFailed
  3. Run tests in parallel (with their before_each/after_each)
  4. Wait for all tests to complete
  5. Run after_all hooks sequentially
  6. Recurse for nested groups
Search Document