The tenzir-test harness discovers and runs
integration tests for pipelines, fixtures, and custom runners. Use this page as
a reference for concepts, configuration, and CLI details. For step-by-step
walkthroughs, see the guides for running tests,
writing tests,
creating fixtures, and
adding custom runners.
Install
Section titled “Install”tenzir-test ships as a Python package that requires Python 3.12 or later.
Install it with uv (or pip) and verify the
console script:
uv add tenzir-testuvx tenzir-test --helpCore concepts
Section titled “Core concepts”- Project root – Directory passed to
--root; typically containsfixtures/,inputs/,runners/, andtests/. - Mode – Auto-detected as project or package. A
package.yamlin the current directory (or its parent when you run from<package>/tests) switches to package mode. - Library – A root that contains multiple packages (each with a
package.yamland its owntests/). The harness can discover all packages under such a library root and run their suites in one invocation. Use--package-dirsto load packages so their operators can cross-import. - Test – Any supported file under
tests/; frontmatter controls execution. - Runner – Named strategy that executes a test (
tenzir,python, custom entries). - Fixture – Reusable environment provider registered under
fixtures/and requested via frontmatter. - Suite – Directory-owned group of tests that share fixtures and run
sequentially. Declare it with
suite:in atest.yaml; all descendants join automatically. - Input – Data accessed with
TENZIR_INPUTS; defaults to<root>/inputsbut you can override it per directory or per test with aninputs:setting. The harness also supports inline inputs viaTENZIR_INPUTfor test-specific data files. - Stdin – Content piped to the test process via a
.stdinfile placed next to the test. The harness exposes the file path viaTENZIR_STDINand automatically pipes its content to the subprocess stdin. - Scratch directory – Ephemeral workspace exposed as
TENZIR_TMP_DIRduring each test run. - Artifact / Baseline – Runner output persisted next to the test; regenerate
with
--update. - Configuration sources – Frontmatter plus inherited
test.yamlfiles;tenzir.yamlstill configures the Tenzir binary.
A typical project layout looks like this:
project-root/├── fixtures/│ └── __init__.py├── inputs/│ └── sample.ndjson├── runners/│ └── __init__.py└── tests/ ├── alerts/ │ ├── sample.tql │ └── sample.txt ├── parsing/ │ ├── csv.input # Inline input for this test │ ├── csv.tql │ └── csv.txt ├── shell/ │ ├── echo.sh │ ├── echo.stdin # Stdin content piped to the test │ └── echo.txt └── python/ └── quick-check.pyFor a package layout (with package.yaml), the structure may look like:
my-package/├── package.yaml├── operators/│ └── custom-op.tql├── pipelines/│ └── smoke.tql└── tests/ ├── inputs/ │ └── sample.ndjson ├── fixtures/ │ └── __init__.py ├── runners/ │ └── __init__.py └── pipelines/ ├── custom-op.tql └── custom-op.txtExecution modes and packages
Section titled “Execution modes and packages”- Mode resolution:
--rootwithtests/→ project mode.--root(or its parent when namedtests) with apackage.yaml→ package mode.
- In package mode the harness exposes:
TENZIR_PACKAGE_ROOT– Absolute package directory.TENZIR_INPUTS–<package>/tests/inputs/unless a directorytest.yamlor the test frontmatter overrides it.--package-dirs=<package>– Passed automatically to thetenzirbinary.
- Without a manifest the harness stays in project mode, recursively
discovers tests under
tests/, and applies global fixtures, runners, and inputs.
CLI reference
Section titled “CLI reference”Run the tests from the project root:
uvx tenzir-testUseful options:
--update: Rewrite reference artifacts next to each test.--purge: Remove generated artifacts (diffs, text outputs) from previous runs.--jobs N: Control concurrency (4 * CPU coresby default).--coverageand--coverage-source-dir: Enable LLVM coverage.-k,--keep: Preserve per-test scratch directories instead of deleting them (same as settingTENZIR_KEEP_TMP_DIRS=1).--package-dirs <path>: Extra package directories for Tenzir binaries. Repeatable and accepts comma-separated lists. Entries merge with anypackage-dirs:declared in directorytest.yamlfiles, then get normalized, de-duplicated, and exported viaTENZIR_PACKAGE_DIRS.--debug: Emit framework-level diagnostics (fixture lifecycle, discovery notes, comparison targets, etc.) and automatically enable verbose output so you see all test results (pass/skip/fail) instead of only failures. The same mode is available viaTENZIR_TEST_DEBUG=1.--summary: Print the tabular breakdown and failure tree after each project.--diff/--no-diff: Toggle unified diff output for failed comparisons. Diffs are shown by default; disable them when you only need aggregated statistics.--diff-stat/--no-diff-stat: Show (or suppress) the per-file change counter, which summarises additions and deletions even when the diff body is hidden.-p,--passthrough: Stream raw stdout/stderr to the terminal instead of comparing against reference artifacts. The harness forces single-job execution (overriding--jobswhen necessary) and ignores--updatewhile passthrough is active. Passthrough mode automatically enables verbose output.-v,--verbose: Print individual test results as they complete. By default (quiet mode) the harness only shows failures and a compact summary, significantly reducing noise for large test suites. Verbose mode displays passing and skipped tests alongside failures. Use--summarytogether with--verboseto include the tree summary at the end of the run.-a,--all-projects: Run the root project together with any satellites provided on the command line.-m,--match: Select tests whose relative path matches a substring or glob pattern. Bare strings (without*,?, or[) match as substrings, so-m mysqlselects any test with “mysql” anywhere in its path. Patterns containing glob metacharacters use fnmatch syntax. Repeatable; tests matching any pattern are selected. When combined with positional TEST paths, only tests matching both are run (intersection).
Set TENZIR_TEST_DEBUG=1 in CI when you want the same diagnostics without
passing --debug on the command line.
Python API
Section titled “Python API”The harness is also available as a typed Python library. Import tenzir_test
and call execute() when you need to run scenarios from automation or another
tool without shelling out to the CLI:
from pathlib import Path
from tenzir_test import ExecutionResult, execute
result: ExecutionResult = execute(tests=[Path("tests/pipeline.tql")])if result.exit_code: # propagate non-zero status to your orchestration layer raise SystemExit(result.exit_code)for project in result.project_results: print(project.selection.root, project.summary.total)The helper mirrors the CLI options but returns an ExecutionResult with
aggregated Summary objects and metadata you can inspect or serialize. Errors
surface as HarnessError exceptions so callers can control reporting and retry
logic.
Selections
Section titled “Selections”A selection is the ordered list of positional paths you pass after the CLI flags. Each element can point to a single test file, a directory, or an entire project. The harness resolves every element relative to the current working directory first and then relative to the root project. How you shape the selection determines which projects run:
- No positional arguments → run every test in the root project.
- Paths inside the root project → run only those targets (plus any explicitly named satellites).
- Paths that resolve to satellite projects → run those satellites, skipping the root unless you also request it.
Use --all-projects when you want the root project to execute alongside a
selection that only names satellites. This keeps the CLI predictable: the
selection lists the exact satellites you care about, and the flag opts the root
back in without duplicating its path on the command line.
Suites
Section titled “Suites”Suites let you run several tests under one shared fixture lifecycle. Declare a
suite in a directory-level test.yaml; the definition applies to every test
under that directory, including nested subdirectories.
suite: smoke-httpfixtures: [http]timeout: 45Key rules:
- Suites are directory-owned. Once a
test.yamlsetssuite, all descendants belong to that suite. Put tests that should remain independent outside the suite directory or in a sibling directory with a different suite. - Per-test frontmatter may not declare
suite. - Suite members inherit the directory defaults and can still override most keys
on a per-file basis. The exceptions are
fixturesandretry, which must be defined at the directory level once a suite is active so every member agrees on the shared lifecycle. Outside suites you can still set those keys directly in frontmatter. - The harness runs suite members sequentially in lexicographic order of their
relative paths. Each suite occupies a single worker, but different suites can
run in parallel when
--jobsallows it. - The CLI executes all suites before any remaining standalone tests so shared fixtures start and stop predictably.
- Run the directory that defines the suite (for example
tenzir-test tests/http) when you want to focus on it. Selecting an individual member now raises an error so every run exercises the full lifecycle and shared fixtures stay in sync.
Inputs
Section titled “Inputs”Tests access input data through the TENZIR_INPUTS environment variable. By
default this points to <root>/inputs or <package>/tests/inputs/ in package
mode. The harness supports two additional mechanisms for placing inputs closer
to the tests that use them.
Inline inputs
Section titled “Inline inputs”Place a .input file next to a test to provide test-specific input data. The
harness exposes the file path via TENZIR_INPUT (singular):
tests/parsing/ parse-csv.input # Input data for this test parse-csv.tql # Test file parse-csv.txt # Expected output baselineAccess the inline input in TQL:
from_file env("TENZIR_INPUT")read_csvOr in a shell script:
cat "$TENZIR_INPUT" | tenzir 'read_csv'The harness sets TENZIR_INPUT only when a matching .input file exists. Tests
can use both TENZIR_INPUT and TENZIR_INPUTS together when they need a
test-specific file plus access to shared data.
Local inputs directories
Section titled “Local inputs directories”Place an inputs/ directory at any level in the test hierarchy to provide
shared inputs for tests in that subtree. The harness walks up from each test
directory and uses the nearest inputs/ directory it finds:
tests/ network/ inputs/ # Shared inputs for network tests sample.pcap flows.ndjson tcp/ analysis.tql # env("TENZIR_INPUTS") → ../inputs/ analysis.txt udp/ stats.tql stats.txtinputs/ # Global inputs (fallback) common.jsonResolution hierarchy for TENZIR_INPUTS:
inputs:override in test frontmatter ortest.yaml(highest priority)- Nearest
inputs/directory walking up from the test directory - Package-level
tests/inputs/directory - Project-level
inputs/directory (fallback)
When multiple inputs/ directories exist in the hierarchy, the nearest one
shadows the others. This keeps the mental model simple: move inputs closer to
the tests that use them without worrying about inheritance.
Stdin inputs
Section titled “Stdin inputs”Place a .stdin file next to a test to provide content that the harness pipes
to the subprocess stdin. For TQL tests, this lets pipelines start with a parser
directly as an alternative to using .input files with from_file:
tests/parsing/ csv.stdin # CSV data piped to stdin csv.tql # Test file starting with read_csv csv.txt # Expected output baselineThe TQL test reads directly from stdin:
read_csvsort nameFor shell scripts, the same mechanism applies:
tests/shell/ echo.stdin # Content piped to stdin echo.sh # Test file echo.txt # Expected output baseline#!/bin/shcatThe harness pipes the contents of the .stdin file automatically. Tests can
combine .stdin with .input when they need both stdin content and a
test-specific input file:
tests/shell/ process.stdin # Content piped to stdin process.input # Input file accessible via TENZIR_INPUT process.sh # Test file process.txt # Expected output baselineA script using both mechanisms:
#!/bin/shecho "from stdin:"catecho "from TENZIR_INPUT:"cat "$TENZIR_INPUT"The harness sets TENZIR_STDIN only when a matching .stdin file exists. TQL
tests can also combine both mechanisms—start with a parser for stdin data while
using env("TENZIR_INPUT") to reference additional files.
Run a subset of tests
Section titled “Run a subset of tests”Pass individual files or directories to run specific tests:
uvx tenzir-test tests/alerts/high-severity.tqlYou can list multiple paths in a single invocation. tenzir-test wires every
argument into the same runner and fixture registry, so you can mix scenarios
from the project and external checkouts:
uvx tenzir-test tests/alerts ../contrib/plugins/*/testsFilter tests by pattern
Section titled “Filter tests by pattern”Use -m/--match to select tests by matching against their relative path.
Bare strings default to substring matching, so you can write short keywords
without glob syntax:
uvx tenzir-test -m mysql # runs every test with "mysql" in its pathuvx tenzir-test -m connect # runs every test with "connect" in its pathPatterns containing glob metacharacters (*, ?, [) still use fnmatch
syntax, which is fully backwards-compatible:
uvx tenzir-test -m '*mysql*' # equivalent to -m mysqluvx tenzir-test -m 'tests/*/connect.tql' # glob with wildcardRepeat the flag to match multiple patterns (logical OR):
uvx tenzir-test -m context -m create # tests matching either substringWhen you combine positional TEST paths with -m patterns, the harness runs
only tests that satisfy both constraints (intersection):
uvx tenzir-test tests/integrations/ -m mysql # only mysql tests under integrations/If a matched test belongs to a suite (configured via test.yaml), all tests in
that suite are included automatically so the shared fixture lifecycle stays
intact.
Run multiple projects with one command
Section titled “Run multiple projects with one command”Pass additional project directories after --root to execute several projects
in one go. Include --all-projects so the root executes next to its satellites.
The directory given to --root acts as the root project; all other
directories are treated as satellites:
uvx tenzir-test --root example-project --all-projects example-satelliteThe harness prints a project listing before execution that identifies each project with a marker and path:
i found 3 projectsi ■ testi □ ../contrib/plugins/context/testi □ ../contrib/plugins/packages/testMarker semantics:
- Filled markers indicate the root project; empty markers indicate satellites.
- Squares (■ □) represent regular projects; circles (● ○) represent packages or libraries.
Satellite paths display relative to the root project, making projects with identical directory names distinguishable.
Key rules:
- The root project provides the baseline configuration (fixtures, runners,
test.yamldefaults, inputs). Satellites layer their own fixtures and runners on top; duplicate names raise an error so conflicts surface early. - Paths printed in the CLI summary are relative to the working directory. The harness announces each project before running it and lists the runner mix per project for quick insight.
- You can target subsets inside each project with additional positional
arguments (
tenzir-test --root main --all-projects secondary tests/smoke). When you skip--rootentirely and only list satellite directories, the harness runs those satellites in isolation. - Satellites keep their own
tests/,inputs/,fixtures/, andrunners/folders. A root project can host shared assets that satellites reuse without duplication—for example, the example repository includes anexample-satellite/directory that consumes thexxdrunner exported by the root project while defining a satellite-specific fixture.
To regenerate baselines while targeting a specific binary and project root:
TENZIR_BINARY=/opt/tenzir/bin/tenzir \TENZIR_NODE_BINARY=/opt/tenzir/bin/tenzir-node \uvx tenzir-test --root tests --updateRunners
Section titled “Runners”| Runner | Command/behavior | Input extension | Artifact |
|---|---|---|---|
tenzir | tenzir -f <test> | .tql | .txt |
python | Execute with the active Python runtime | .py | .txt |
shell | sh -eu <test> via the harness helper | .sh | varies |
Selection flow:
- The harness chooses the first registered runner that claimed the file extension.
- Default suffix mapping applies when no runner explicitly claims an extension:
.tql → tenzir,.py → python,.sh → shell. - A
runner: <name>frontmatter entry overrides the automatic choice. - If no runner claims the extension and none is specified in frontmatter, the harness fails with an error instead of guessing.
Shell runner
Section titled “Shell runner”Place scripts (for example under tests/shell/) with the .sh suffix to run
them under bash -eu via the shell runner. The harness also prepends
<root>/_shell to PATH so project-specific helper binaries become
discoverable. The runner captures stdout and stderr (like 2>&1) and compares
the combined output with <test>.txt; run tenzir-test --update path/to/test.sh
when you need to refresh the baseline.
Register custom runners in runners/__init__.py via
tenzir_test.runners.register() or the @tenzir_test.runners.startup()
decorator. Use replace=True to override a bundled runner or
register_alias() to publish alternate names.
The runner guide contains a full example
(XxdRunner).
Passthrough-aware subprocesses
Section titled “Passthrough-aware subprocesses”When passthrough mode is active the harness streams stdout/stderr directly to
the terminal and skips reference comparisons. Runner implementations can
respect this automatically by spawning processes through
tenzir_test.run.run_subprocess(...). The helper captures output when the
harness needs it and inherits the parent descriptors otherwise. Pass
force_capture=True when your runner must collect stdout even in passthrough
mode. If you need to branch on the current behavior, call
tenzir_test.run.get_harness_mode() or tenzir_test.run.is_passthrough_enabled().
The harness cycles between three internal modes:
HarnessMode.COMPARE– default behavior; compare actual output with stored baselines.HarnessMode.UPDATE– engaged when you pass--update; runners should overwrite reference files.HarnessMode.PASSTHROUGH– enabled via-p/--passthrough; stream output directly without touching baselines.
get_harness_mode() returns the current enum value so custom runners can adapt logic if needed.
Configuration and frontmatter
Section titled “Configuration and frontmatter”tenzir-test merges configuration sources in this order (later wins):
- Project defaults (
test.yamlfiles, applied per directory). - Per-test frontmatter (YAML for
.tql/.xxd,# key: valuecomments for Python and shell scripts).
Common frontmatter keys:
| Key | Type | Default | Description |
|---|---|---|---|
runner | string | by suffix | Runner name (tenzir, python, shell, custom). |
fixtures | list of strings | [] | Requested fixtures; use fixture for a single value. |
timeout | integer (s) | 30 | Command timeout. (--coverage multiplies it by five.) |
error | boolean | false | Expect a non-zero exit code. |
skip | string or dict | unset | Mark tests as skipped. See skip configuration. |
inputs | string | project | Override TENZIR_INPUTS for this directory or test. |
retry | integer | 1 | Total attempt budget for flaky tests (see below). |
package-dirs | list of strings | inherit | Directory-only; extra packages merged with CLI --package-dirs. |
test.yaml files accept the same keys and apply recursively to child
directories. A relative inputs: value resolves against the file that defines
it, so inputs: ../data inside tests/alerts/test.yaml points at
tests/data/. Frontmatter values follow the same rule and win over directory
defaults. Adjacent tenzir.yaml files still configure the Tenzir binary; the
harness appends --config=<file> automatically. The lookup keeps working even
when you point the CLI at extra directories on the command line.
retry represents the total number of attempts the harness should make before
declaring the test failed. Intermediate attempts stay quiet; the final outcome
line includes attempts=N/M whenever the budget exceeds one. Keep the value
small and treat it as a temporary guardrail while you fix the underlying
flakiness.
Skip configuration
Section titled “Skip configuration”The skip key supports two forms:
String form marks the test (or every test in the directory) as unconditionally skipped. The value is the reason:
skip: "pending upstream fix"Structured form conditionally skips tests when a fixture signals that it cannot provide its service. Use this when the suite depends on an external resource that may not be available in every environment (for example a container runtime):
skip: on: fixture-unavailableThe only supported value for on is fixture-unavailable. When a fixture
raises FixtureUnavailable during initialization and the suite carries this
configuration, all tests in the suite are marked as skipped with exit code 0.
Without the opt-in configuration the exception propagates normally and causes a
test failure.
The optional reason field provides additional context that is combined with
the exception message in the skip output. See
Fixture unavailability for the fixture-side API.
Tenzir configuration files
Section titled “Tenzir configuration files”- The harness inspects the directory that owns each test. If it finds
tenzir.yaml, it appends--config=<path>to every invocation of the bundledtenzir/tql/diffrunners. The path also seedsTENZIR_CONFIGunless you set that variable yourself. Custom runners that call the Tenzir binary should either userun.get_test_env_and_config_args(test)or honour the exported environment variables explicitly. - The built-in
nodefixture uses the same discovery process and startstenzir-nodefrom the directory that owns the test file, so relative paths insidetenzir-node.yamlresolve against the test location. See the built-in node fixture section for precedence rules. - This lets you keep one config for CLI-driven scenarios while passing a different config to the embedded node, for example to tweak endpoints or data directories independently.
Fixtures
Section titled “Fixtures”Declaring fixtures
Section titled “Declaring fixtures”- List fixture names in frontmatter (
fixtures: [node, http]). Importing the projectfixturespackage is enough to register custom fixtures thanks to the side effects infixtures/__init__.py. - The harness encodes requests in
TENZIR_TEST_FIXTURESand exposes helper APIs intenzir_test.fixtures:fixtures()– Read-only view of active fixtures. Attribute access is supported, e.g.fixtures().nodereturnsTrueif the fixture was requested and raisesAttributeErrorotherwise.acquire_fixture("name")– Manual controller for the named fixture. Use it as a context manager for automaticstart()/stop()or call those methods explicitly to interleave lifecycle steps and optional hooks (for examplekill()orrestart()).require("name")– Assert that a fixture was requested.Executor()– Convenience wrapper that runs Tenzir commands with resolved binaries and timeout budget.
Example use from a Python helper:
from tenzir_test.fixtures import Executor
executor = Executor()result = executor.run("from_file 'inputs/events.ndjson' | where severity >= 5\n")assert result.returncode == 0Built-in node fixture
Section titled “Built-in node fixture”- Request the fixture with
fixtures: [node]; the harness will starttenzir-nodewith the binaries discovered for the current test. - Configuration precedence:
TENZIR_NODE_CONFIGin the environment.- A
tenzir-node.yamlplaced next to the test file (exported automatically). - The Tenzir defaults (no config file).
- The node process inherits the test directory as its current working
directory, letting
tenzir-node.yamlreference files with relative paths (for examplestate/orschemas/). - Each controller reuses its state and cache directories across
start()/stop()cycles. By default they live under the per-test scratch directory (TENZIR_TMP_DIR/tenzir-node-*) and are removed once the fixture context ends. Starting a fresh controller (for example in another test run) yields a brand-new workspace. - The fixture reuses other inherited arguments (for example
--package-dirs=…) but replaces any existing--config=flag so the node process always honours the chosen configuration file. - Tests can read
TENZIR_NODE_CLIENT_ENDPOINT,TENZIR_NODE_CLIENT_BINARY,TENZIR_NODE_CLIENT_TIMEOUT,TENZIR_NODE_STATE_DIRECTORY, andTENZIR_NODE_CACHE_DIRECTORYfrom the environment to connect to the spawned node and inspect its working tree. - Pipelines launched by the bundled Tenzir runners automatically receive
--endpoint=<value>when this fixture is active, so they talk to the transient node without additional wiring. - CLI and node configuration are independent: configure the CLI with
tenzir.yamland drop atenzir-node.yaml(or setTENZIR_NODE_CONFIG) only when the node needs custom settings. - When
tenzir-nodefails to start, the fixture reports the exit code and stderr output, making it easier to diagnose startup failures.
Registering fixtures
Section titled “Registering fixtures”Implement fixtures in fixtures/ and register them with @tenzir_test.fixture().
Decorate a generator function, yield the environment mapping, and handle cleanup
in a finally block:
from tenzir_test import fixture
@fixture()def http(): server = _start_server() try: yield {"HTTP_FIXTURE_URL": server.url} finally: server.stop()@fixture also accepts regular callables returning dictionaries, context
managers, or FixtureHandle instances for advanced scenarios.
The fixture guide demonstrates an HTTP echo
server that exposes HTTP_FIXTURE_URL and tears down cleanly.
Fixture unavailability
Section titled “Fixture unavailability”Fixtures can signal that they cannot provide their service by raising
FixtureUnavailable during initialization (before yielding). This is useful
when a fixture depends on an external tool or runtime that may not be present
in every environment.
from tenzir_test.fixtures import FixtureUnavailable, fixture
@fixture()def mysql(): if not shutil.which("docker"): raise FixtureUnavailable("docker not found") # ... start container, yield env, cleanup ...By default the exception propagates and causes a test failure. To convert it
into a skip, add a structured skip entry to the suite’s test.yaml:
suite: mysql-integrationfixtures: [mysql]skip: on: fixture-unavailable reason: "needs container runtime"When the fixture raises FixtureUnavailable and the suite carries this
configuration, the harness marks every test in the suite as skipped (exit
code 0) and logs the combined reason. Without the opt-in configuration the
exception surfaces as a regular failure. See
skip configuration for the full syntax of the skip
key.
Environment variables
Section titled “Environment variables”tenzir-test recognises the following environment variables:
TENZIR_TEST_ROOT– Default test root when--rootis omitted.TENZIR_BINARY/TENZIR_NODE_BINARY– Override binary auto-detection. Supports multi-part commands likeTENZIR_BINARY="uvx tenzir"orTENZIR_NODE_BINARY="docker exec container tenzir-node".TENZIR_INPUTS– Preferred data directory. Defaults to the nearestinputs/directory walking up from the test, falling back to the project-level inputs folder. Reflects anyinputs:override fromtest.yamlor frontmatter.TENZIR_INPUT– Path to the inline input file when a.inputfile exists next to the test. Not set otherwise.TENZIR_STDIN– Path to the stdin file when a.stdinfile exists next to the test. The harness pipes this file’s content to the subprocess stdin. Not set otherwise.TENZIR_KEEP_TMP_DIRS– Keep per-test scratch directories (equivalent to--keep).TENZIR_TEST_DEBUG– Enable debug logging and verbose output (equivalent to--debug).
Binary resolution
Section titled “Binary resolution”The harness automatically detects tenzir and tenzir-node binaries using this
precedence:
TENZIR_BINARY/TENZIR_NODE_BINARYenvironment variable (highest priority)- Local installation found via
PATHlookup (shutil.which) - Fallback to
uvx tenzir/uvx --from tenzir tenzir-nodewhenuvis installed
Most users can run tenzir-test without any configuration. When uv is
installed, the harness automatically uses uvx to fetch and run Tenzir on
demand.
Environment variables support multi-part commands, allowing invocations like
TENZIR_BINARY="uvx tenzir" or TENZIR_BINARY="docker exec node tenzir". The
harness splits these values into argument lists using shell tokenization rules.
Fixtures often publish additional variables (for example
TENZIR_NODE_CLIENT_*, TENZIR_NODE_STATE_DIRECTORY,
TENZIR_NODE_CACHE_DIRECTORY, HTTP_FIXTURE_URL).
During execution the harness also adds transient variables such as
TENZIR_TMP_DIR so tests and fixtures can create temporary artifacts without
polluting the repository. Combine it with --keep (or
TENZIR_KEEP_TMP_DIRS=1) when you need to inspect the generated files after a
run.
Baselines and artifacts
Section titled “Baselines and artifacts”Regenerate reference output whenever behavior changes intentionally:
uvx tenzir-test --update--purge removes stale artifacts (diffs, temporary files). Keep generated
.txt files under version control so future runs can diff against them.
Troubleshooting
Section titled “Troubleshooting”- Missing binaries – The harness auto-detects binaries on
PATHand falls back touvx tenzirwhenuvis installed. If neither is available, set theTENZIR_BINARYandTENZIR_NODE_BINARYenvironment variables to point at your installation. - Unexpected exits – Set
error: truein frontmatter when a non-zero exit is expected. - Skipped tests – Use
skip: reasonto document temporary skips; baseline files can stay empty. For fixture-dependent suites, use the structuredskip: {on: fixture-unavailable}form so tests skip gracefully when a required tool is missing. - Noisy output – Use
--jobs 1to serialize worker logs, and enable--debug(or setTENZIR_TEST_DEBUG=1) when you need to trace comparisons and fixture activity. Note that--debugautomatically enables verbose output.