LivebookTest.Preflight (livebook_test v0.1.1)

Copy Markdown View Source

Runtime checks for Elixir, OTP, and Livebook compatibility.

Runs before notebook discovery to fail fast with actionable messages when the environment cannot support livebook_test.

Supported versions

ComponentRequirement
Elixir~> 1.18 (1.18.0 and later)
OTP26, 27, or 28
Livebook~> 0.19.0 with live_markdown_to_elixir/1

Livebook is a transitive dependency of livebook_test. If :livebook fails to compile in your project, see the troubleshooting section in the README.

Summary

Types

Preflight check result

Functions

Runs all preflight checks.

Runs preflight checks and raises on failure.

Returns the formatted preflight error message for display.

Types

result()

@type result() :: :ok | {:error, String.t()}

Preflight check result

Functions

check()

@spec check() :: result()

Runs all preflight checks.

Returns :ok when the environment is supported, or {:error, message} with a human-readable explanation.

Examples

iex> LivebookTest.Preflight.check() == :ok
true

check!()

@spec check!() :: :ok

Runs preflight checks and raises on failure.

Suitable for Mix tasks where a raised error is the desired outcome.

check_elixir(version \\ System.version())

@spec check_elixir(String.t()) :: result()

check_livebook()

@spec check_livebook() :: result()

check_otp(otp_release \\ current_otp_release())

@spec check_otp(non_neg_integer()) :: result()

format_error(message)

@spec format_error(String.t()) :: String.t()

Returns the formatted preflight error message for display.