Notebook discovery via filesystem glob patterns.
Uses Path.wildcard/2 to find .livemd files matching
configured path patterns, then excludes any matching
exclusion patterns. This module is the first stage
in the LivebookTest pipeline:
Discovery → Exporter → DependencyPatcher → Runner → ReportHow notebook discovery works
- A list of glob patterns is provided (from config or CLI)
- Each pattern is expanded using
Path.wildcard/2 - Results are deduplicated and sorted for deterministic execution
- Only files ending in
.livemdare included - Files matching any exclusion pattern are removed
Exclusion
The exclude option filters out notebooks that should not be
run by default — for example, intentionally broken notebooks
kept as test fixtures:
LivebookTest.Discovery.find(["examples/**/*.livemd"],
exclude: ["**/broken/**/*.livemd"]
)Examples
iex> paths = LivebookTest.Discovery.find(["examples/**/*.livemd"])
iex> is_list(paths)
true
Summary
Types
Result of discovery: a list of paths to .livemd files
Functions
Counts discovered notebooks without returning the full list.
Discovers Livebook notebooks matching the given glob patterns, excluding any that match the exclusion patterns.
Types
@type discovery_result() :: [Path.t()]
Result of discovery: a list of paths to .livemd files
Functions
@spec count( [String.t()], keyword() ) :: non_neg_integer()
Counts discovered notebooks without returning the full list.
Useful for quick status checks or summary reporting.
Examples
iex> LivebookTest.Discovery.count(["nonexistent/**/*.livemd"])
0
@spec find( [String.t()], keyword() ) :: discovery_result()
@spec find( String.t(), keyword() ) :: discovery_result()
Discovers Livebook notebooks matching the given glob patterns, excluding any that match the exclusion patterns.
Returns a sorted, deduplicated list of paths.
Examples
iex> LivebookTest.Discovery.find(["nonexistent/**/*.livemd"])
[]
iex> paths = LivebookTest.Discovery.find(["examples/**/*.livemd"])
iex> Enum.all?(paths, &String.ends_with?(&1, ".livemd"))
true