mix livebook.test (livebook_test v0.1.1)

Copy Markdown View Source

Runs Livebook notebooks as tests.

This task discovers .livemd files, converts them to Elixir scripts, executes them, and reports results, similar to mix test but for Livebook notebooks.

Usage

mix livebook.test
mix livebook.test --path livebooks/**/*.livemd
mix livebook.test --exclude '**/broken/**/*.livemd'
mix livebook.test --mode local
mix livebook.test --mode remote
mix livebook.test --timeout 120
mix livebook.test --verbose

Options

  • --path - glob pattern for notebook discovery (can be repeated)
  • --exclude - glob pattern to exclude from discovery (can be repeated)
  • --mode - dependency mode: local or remote (default: from config)
  • --timeout - per-notebook timeout in seconds (default: from config)
  • --verbose - enable verbose output with per-notebook details

Exit codes

  • 0 - all notebooks passed
  • 1 - one or more notebooks failed (or preflight check failed)
  • 2 - no notebooks discovered

Preflight checks

Before discovery, the task verifies Elixir, OTP, and Livebook compatibility. Unsupported environments fail fast with troubleshooting guidance.

CI/CD integration

Add to your CI workflow:

- name: Test Livebooks
  run: mix livebook.test

For local dependency testing:

- name: Test Livebooks (local deps)
  run: mix livebook.test --mode local

Configuration

See LivebookTest.Config for application environment configuration.