System and end-to-end (E2E) tests for cardano-node.
59
stars
7,847
commits
Python
primary language
Sep 8, 2026
updated
System and end-to-end (E2E) tests for cardano-node.
📘 Check the documentation site for full usage guides, setup instructions, and details.
Run tests easily using GitHub Actions:
Fork this repository.
Enable GitHub Actions in your fork:
Settings ➝ Actions ➝ General ➝ Actions permissionsAllow all actions and reusable workflowsNavigate to the Actions tab, then choose:
01 Regression tests, or02 Regression tests with db-sync, or03 Upgrade testsClick Run workflow to start testing.
The preferred way is via runner/runc.sh, which builds a container image and runs tests inside it using podman or docker. If the host has /nix, it is bind-mounted into an Alpine container; otherwise a self-contained NixOS container is used — no local Nix installation required.
./runner/runc.sh ./runner/regression.sh
Run with clock skew on one pool node:
./runner/runc.sh -- TIME_DRIFT_POOL=1 TIME_DRIFT_SPEC='+0 x1.008' ./runner/regression.sh
Run a specific test:
./runner/runc.sh -- TEST_THREADS=0 CLUSTERS_COUNT=1 PYTEST_ARGS="-k test_minting_one_token" ./runner/regression.sh
A specific Linux distro can be selected (Ubuntu, Debian, Linux Mint, or NixOS):
./runner/runc.sh --ubuntu-container=24.04 -- ./runner/regression.sh
ℹ️ Run
./runner/runc.shwithout arguments to see all available options.
Alternatively, with Nix available on the host, tests can be run directly:
./runner/regression.sh
Or run the upgrade test suite:
./runner/load-gh-env.sh runner/env_nightly_upgrade CI_BYRON_CLUSTER=false ./runner/node_upgrade.sh
In Claude Code, /analyze-failures [run_dir] triages a finished run (run_workdir by default, also artifacts downloaded from a CI run) and answers where a run's logs and artifacts live.
Create the .bin directory in the repo root and add your custom cardano-cli /
cardano-node / cardano-db-sync binaries there.
⚠️ When running in a container via
runner/runc.sh,.binentries must be statically linked binaries, or - for containers that bind-mount the host/nixstore (the default when the host has/nix) - symlinks pointing directly into/nixor binaries whose dynamic dependencies all live under/nix. A NixOS container has its own/nixstore, so only statically linked binaries work there.
Run a specific test:
./runner/runc.sh -- TEST_THREADS=0 CLUSTERS_COUNT=1 PYTEST_ARGS="-k 'test_minting_and_burning_sign[asset_name-build_raw-submit_cli]'" ./runner/regression.sh
Clean up by removing binaries from .bin after tests complete.
ℹ️ Pro Tip: Enable full CLI command logging:
PYTEST_ARGS="... --log-level=debug" ./runner/regression.sh
For workflows requiring repeated test runs on a persistent testnet cluster:
Start a Nix shell:
nix flake update --accept-flake-config --override-input cardano-node github:IntersectMBO/cardano-node/master
nix develop --accept-flake-config
Set up the local test environment:
make test-env
Activate the environment:
source ./dev_workdir/activate
Launch the local testnet cluster:
./dev_workdir/local_fast/start-cluster
Run your tests:
pytest -s -k test_minting_one_token cardano_node_tests/tests/tests_plutus
pytest -s --log-level=debug -k test_minting_one_token cardano_node_tests/tests/tests_plutus
Stop the testnet cluster:
./dev_workdir/local_fast/stop-cluster
ℹ️ Pro Tip: Next time, you can omit step 2 if the environment is already set up.
You can fine-tune test runs using these environment variables:
| Variable | Description |
|---|---|
BOOTSTRAP_DIR | Bootstrap testnet directory. |
CLUSTERS_COUNT | Number of clusters to launch (default: 9). |
COMMAND_ERA | CLI command target era. |
KEEP_CLUSTERS_RUNNING | Don't shut down clusters after tests. |
MARKEXPR | Marker expression for pytest filtering. |
MAX_TESTS_PER_CLUSTER | Max tests per cluster (default: 8). |
NUM_POOLS | Number of stake pools (default: 3). |
PORTS_BASE | Starting port number for cluster services. |
SCHEDULING_LOG | Path to scheduler log output. |
TESTNET_VARIANT | Name of the testnet variant to use. |
UTXO_BACKEND | Backend type: mem, disk, disklmdb or empty. |
MIXED_UTXO_BACKENDS | List of UTXO backends for mixed setup. |
ENABLE_TX_GENERATOR | Enable tx-generator (default: false). |
ENABLE_TX_CENTRIFUGE | Enable tx-centrifuge (default: false). |
ENABLE_TX_FIREHOSE | Enable tx-firehose (default: false). |
PROTOCOL_VERSION | Cardano protocol version to use (default: 11). |
USE_GENESIS_MODE | Switch to using GenesisMode (default: false). |
ALLOW_UNSTABLE_ERROR_MESSAGES | Allow tests to pass with unstable error messages. |
regression.sh| Variable | Description |
|---|---|
CARDANO_CLI_REV | cardano-cli version. |
CI_BYRON_CLUSTER | Run cluster from Byron ➝ Conway (slow start). |
DBSYNC_REV | cardano-db-sync version. |
NODE_REV | cardano-node version (default: master). |
TX_CENTRIFUGE_REV | tx-centrifuge version (default: bench/leios-11.0.1). |
TX_FIREHOSE_REV | tx-firehose version (default: leios-prototype). |
PYTEST_ARGS | Extra options passed to pytest. |
TEST_THREADS | Number of pytest workers (default: 20). |
TIME_DRIFT_POOL | Pool (1-3) for libfaketime clock skew; unset = off. |
TIME_DRIFT_SPEC | libfaketime FAKETIME string, e.g. +0 x1.008. |
LIBFAKETIME_PATH | Override path to libfaketimeMT.so.1. |
Run with 6 pools and mixed networking:
NUM_POOLS=6 ./runner/regression.sh
Run selective tests with filtering:
TEST_THREADS=15 PYTEST_ARGS="-k 'test_stake_pool_low_cost or test_reward_amount'" MARKEXPR="not long" ./runner/regression.sh
Run on preview testnet with specific node revision:
NODE_REV=10.6.3 BOOTSTRAP_DIR=~/tmp/preview_config/ ./runner/regression.sh
ℹ️ Pro Tip: All the examples above can be prefixed with
./runner/runc.sh --to run inside the containerized environment.
While the setup described in Persistent Local Testnet for Repeated Testing is sufficient for most test development, test authors may require a more customizable environment, such as editable installs, different testnet variants, or multiple testnet cluster instances.
make install
cd ../cardano-node
git checkout <tag>
cd ../cardano-node-tests
make update-node-bins repo=../cardano-node
source .source.dev
make check-dev-env
make cluster-scripts
make start-cluster
The default cluster variant is local_fast. Override with TESTNET_VARIANT=<variant>, e.g. make cluster-scripts TESTNET_VARIANT=local_slow.
Keys and configs are stored under /var/tmp/cardonnay-of-$USER/state-cluster0.
pytest -k "test_missing_tx_out or test_multiple_same_txins" cardano_node_tests
pytest -m smoke cardano_node_tests/tests/test_cli.py
make lint
ℹ️ Pro Tip: Run
make init-lintto initialize linters and activate Git hooks.
cardano-clusterlib in Editable Modemake reinstall-editable repo=../cardano-clusterlib-py
⚠️ After each dependencies update, repeat the step above to retain dev mode.
This step is required after modifying dependencies in pyproject.toml.
make update-uv-lock
make doc
Python
95.6%
Shell
4.1%
System and end-to-end (E2E) tests for cardano-node.
59
stars
7,847
commits
Python
primary language
Sep 8, 2026
updated
System and end-to-end (E2E) tests for cardano-node.
📘 Check the documentation site for full usage guides, setup instructions, and details.
Run tests easily using GitHub Actions:
Fork this repository.
Enable GitHub Actions in your fork:
Settings ➝ Actions ➝ General ➝ Actions permissionsAllow all actions and reusable workflowsNavigate to the Actions tab, then choose:
01 Regression tests, or02 Regression tests with db-sync, or03 Upgrade testsClick Run workflow to start testing.
The preferred way is via runner/runc.sh, which builds a container image and runs tests inside it using podman or docker. If the host has /nix, it is bind-mounted into an Alpine container; otherwise a self-contained NixOS container is used — no local Nix installation required.
./runner/runc.sh ./runner/regression.sh
Run with clock skew on one pool node:
./runner/runc.sh -- TIME_DRIFT_POOL=1 TIME_DRIFT_SPEC='+0 x1.008' ./runner/regression.sh
Run a specific test:
./runner/runc.sh -- TEST_THREADS=0 CLUSTERS_COUNT=1 PYTEST_ARGS="-k test_minting_one_token" ./runner/regression.sh
A specific Linux distro can be selected (Ubuntu, Debian, Linux Mint, or NixOS):
./runner/runc.sh --ubuntu-container=24.04 -- ./runner/regression.sh
ℹ️ Run
./runner/runc.shwithout arguments to see all available options.
Alternatively, with Nix available on the host, tests can be run directly:
./runner/regression.sh
Or run the upgrade test suite:
./runner/load-gh-env.sh runner/env_nightly_upgrade CI_BYRON_CLUSTER=false ./runner/node_upgrade.sh
In Claude Code, /analyze-failures [run_dir] triages a finished run (run_workdir by default, also artifacts downloaded from a CI run) and answers where a run's logs and artifacts live.
Create the .bin directory in the repo root and add your custom cardano-cli /
cardano-node / cardano-db-sync binaries there.
⚠️ When running in a container via
runner/runc.sh,.binentries must be statically linked binaries, or - for containers that bind-mount the host/nixstore (the default when the host has/nix) - symlinks pointing directly into/nixor binaries whose dynamic dependencies all live under/nix. A NixOS container has its own/nixstore, so only statically linked binaries work there.
Run a specific test:
./runner/runc.sh -- TEST_THREADS=0 CLUSTERS_COUNT=1 PYTEST_ARGS="-k 'test_minting_and_burning_sign[asset_name-build_raw-submit_cli]'" ./runner/regression.sh
Clean up by removing binaries from .bin after tests complete.
ℹ️ Pro Tip: Enable full CLI command logging:
PYTEST_ARGS="... --log-level=debug" ./runner/regression.sh
For workflows requiring repeated test runs on a persistent testnet cluster:
Start a Nix shell:
nix flake update --accept-flake-config --override-input cardano-node github:IntersectMBO/cardano-node/master
nix develop --accept-flake-config
Set up the local test environment:
make test-env
Activate the environment:
source ./dev_workdir/activate
Launch the local testnet cluster:
./dev_workdir/local_fast/start-cluster
Run your tests:
pytest -s -k test_minting_one_token cardano_node_tests/tests/tests_plutus
pytest -s --log-level=debug -k test_minting_one_token cardano_node_tests/tests/tests_plutus
Stop the testnet cluster:
./dev_workdir/local_fast/stop-cluster
ℹ️ Pro Tip: Next time, you can omit step 2 if the environment is already set up.
You can fine-tune test runs using these environment variables:
| Variable | Description |
|---|---|
BOOTSTRAP_DIR | Bootstrap testnet directory. |
CLUSTERS_COUNT | Number of clusters to launch (default: 9). |
COMMAND_ERA | CLI command target era. |
KEEP_CLUSTERS_RUNNING | Don't shut down clusters after tests. |
MARKEXPR | Marker expression for pytest filtering. |
MAX_TESTS_PER_CLUSTER | Max tests per cluster (default: 8). |
NUM_POOLS | Number of stake pools (default: 3). |
PORTS_BASE | Starting port number for cluster services. |
SCHEDULING_LOG | Path to scheduler log output. |
TESTNET_VARIANT | Name of the testnet variant to use. |
UTXO_BACKEND | Backend type: mem, disk, disklmdb or empty. |
MIXED_UTXO_BACKENDS | List of UTXO backends for mixed setup. |
ENABLE_TX_GENERATOR | Enable tx-generator (default: false). |
ENABLE_TX_CENTRIFUGE | Enable tx-centrifuge (default: false). |
ENABLE_TX_FIREHOSE | Enable tx-firehose (default: false). |
PROTOCOL_VERSION | Cardano protocol version to use (default: 11). |
USE_GENESIS_MODE | Switch to using GenesisMode (default: false). |
ALLOW_UNSTABLE_ERROR_MESSAGES | Allow tests to pass with unstable error messages. |
regression.sh| Variable | Description |
|---|---|
CARDANO_CLI_REV | cardano-cli version. |
CI_BYRON_CLUSTER | Run cluster from Byron ➝ Conway (slow start). |
DBSYNC_REV | cardano-db-sync version. |
NODE_REV | cardano-node version (default: master). |
TX_CENTRIFUGE_REV | tx-centrifuge version (default: bench/leios-11.0.1). |
TX_FIREHOSE_REV | tx-firehose version (default: leios-prototype). |
PYTEST_ARGS | Extra options passed to pytest. |
TEST_THREADS | Number of pytest workers (default: 20). |
TIME_DRIFT_POOL | Pool (1-3) for libfaketime clock skew; unset = off. |
TIME_DRIFT_SPEC | libfaketime FAKETIME string, e.g. +0 x1.008. |
LIBFAKETIME_PATH | Override path to libfaketimeMT.so.1. |
Run with 6 pools and mixed networking:
NUM_POOLS=6 ./runner/regression.sh
Run selective tests with filtering:
TEST_THREADS=15 PYTEST_ARGS="-k 'test_stake_pool_low_cost or test_reward_amount'" MARKEXPR="not long" ./runner/regression.sh
Run on preview testnet with specific node revision:
NODE_REV=10.6.3 BOOTSTRAP_DIR=~/tmp/preview_config/ ./runner/regression.sh
ℹ️ Pro Tip: All the examples above can be prefixed with
./runner/runc.sh --to run inside the containerized environment.
While the setup described in Persistent Local Testnet for Repeated Testing is sufficient for most test development, test authors may require a more customizable environment, such as editable installs, different testnet variants, or multiple testnet cluster instances.
make install
cd ../cardano-node
git checkout <tag>
cd ../cardano-node-tests
make update-node-bins repo=../cardano-node
source .source.dev
make check-dev-env
make cluster-scripts
make start-cluster
The default cluster variant is local_fast. Override with TESTNET_VARIANT=<variant>, e.g. make cluster-scripts TESTNET_VARIANT=local_slow.
Keys and configs are stored under /var/tmp/cardonnay-of-$USER/state-cluster0.
pytest -k "test_missing_tx_out or test_multiple_same_txins" cardano_node_tests
pytest -m smoke cardano_node_tests/tests/test_cli.py
make lint
ℹ️ Pro Tip: Run
make init-lintto initialize linters and activate Git hooks.
cardano-clusterlib in Editable Modemake reinstall-editable repo=../cardano-clusterlib-py
⚠️ After each dependencies update, repeat the step above to retain dev mode.
This step is required after modifying dependencies in pyproject.toml.
make update-uv-lock
make doc
Python
95.6%
Shell
4.1%