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 --verboseOptions
--path- glob pattern for notebook discovery (can be repeated)--exclude- glob pattern to exclude from discovery (can be repeated)--mode- dependency mode:localorremote(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 passed1- 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.testFor local dependency testing:
- name: Test Livebooks (local deps)
run: mix livebook.test --mode localConfiguration
See LivebookTest.Config for application environment configuration.