Skip to main content

Getting Started

Option A: Install the pytest plugin

The fastest way to start — install the plugin, run your tests, and DAGZ handles the rest.

1. Install

pip install dagz-pytest

Or with uv:

uv add dagz-pytest

2. Run your tests

pytest --dagz

On first run, DAGZ will:

  • Prompt you to install zb (the DAGZ runtime) if it's not already installed
  • Start a local daemon that stores test data on your machine
  • Record function-level coverage for every test

All tests run as usual on this first pass — the result becomes your baseline.

3. Make a change and run again

pytest --dagz

This time, DAGZ compares your code against the baseline. Tests that don't depend on your changes are skipped:

dagz: 142 selected, 891 skipped (baseline: abc1234)

Option B: Install the CLI first

If you prefer to set up the runtime before running tests:

curl -LsSf https://dagz.run/zb/install.sh | sh

This installs the zb binary. Start the daemon:

zb up

Then run pytest --dagz in any project. The daemon is shared across all your repos.

Key pytest options

OptionDescription
--dagzEnable DAGZ test selection and coverage collection
--dagz-selectEnable test selection only (skip coverage collection)
--dagz-baselineForce a specific baseline (by hash or latest)
--dagz-fullRun all tests but still collect coverage (useful for building baselines)
--dagz-explainPrint the selection trace for each selected test — shows why it was selected
--dagz-workers NNumber of parallel worker processes (default: 60% of CPU cores)

Configuration

DAGZ works with zero configuration. For customization, add a .dagz/config.yaml to your repo root:

# .dagz/config.yaml
project:
uri: [email protected]:your-org/your-repo.git
timezone: UTC

The uri identifies your project across runs. If omitted, DAGZ derives it from your git remote.

Feature flags

All enabled by default:

FlagWhat it does
detect_new_overridesTrack method overrides in class hierarchies
hires_registry_trackingPer-entry precision for plugin registries
collect_cachesDetect changes to cached values
capture_terminalCapture test stdout/stderr via PTY
distributed_coverageTrack coverage across subprocesses
collect_dynamic_importsCapture imports inside functions

Open the dashboard

Visit http://localhost:29111 to see test results, which tests were skipped and why, and performance trends over time.

What gets stored locally

All DAGZ data lives in ~/.dagz/local.env/:

DirectoryContents
clickhouse/data/Test results, coverage data, baselines
kv/Dependency graph, code unit hashes
web/web.logDaemon log file