Supertester.UnifiedTestFoundation (supertester v0.1.0)
View SourceUnified test foundation providing multiple isolation modes for OTP testing.
This module provides macros and utilities to establish different levels of test isolation, enabling async testing while preventing process conflicts and ensuring proper cleanup.
Isolation Modes
:basic
- Basic isolation with unique naming:registry
- Registry-based process isolation:full_isolation
- Complete process and ETS isolation:contamination_detection
- Isolation with contamination detection
Usage
defmodule MyApp.MyModuleTest do
use ExUnit.Case
use Supertester.UnifiedTestFoundation, isolation: :full_isolation
test "my test", context do
# Test runs with full isolation
end
end
Summary
Functions
Provides test isolation setup based on the specified isolation type.
Returns whether the isolation type allows async testing.
Returns the timeout for the isolation type.
Sets up test isolation based on the specified isolation type.
Verifies test isolation has been maintained.
Waits for a supervision tree to be ready.
Functions
Provides test isolation setup based on the specified isolation type.
Returns whether the isolation type allows async testing.
@spec isolation_timeout(atom()) :: non_neg_integer()
Returns the timeout for the isolation type.
Sets up test isolation based on the specified isolation type.
Verifies test isolation has been maintained.
@spec wait_for_supervision_tree_ready(pid(), non_neg_integer()) :: {:ok, pid()} | {:error, :timeout}
Waits for a supervision tree to be ready.