Skip to content

Add docker environment for containerized tests#3344

Open
saratomaz wants to merge 18 commits into
IntersectMBO:masterfrom
saratomaz:prepare_docker_images
Open

Add docker environment for containerized tests#3344
saratomaz wants to merge 18 commits into
IntersectMBO:masterfrom
saratomaz:prepare_docker_images

Conversation

@saratomaz
Copy link
Copy Markdown
Collaborator

@saratomaz saratomaz commented Feb 17, 2026

Adds the Docker infrastructure needed to submit cardano-node-tests to the Antithesis platform, which runs the test suite in a fully deterministic, fault-injected environment with no internet access at runtime.

What was added

docker-antithesis/ (new directory)

  • Dockerfile — single image used by both containers. At build time it pre-builds cardano-node, cardano-cli, cardano-submit-api, and bech32 via nix build, warms the testenv and base dev shells, and creates the Python venv at /opt/tests-venv/. Nothing is downloaded at runtime.
  • node_run.sh — node container entrypoint. Prepares and starts the cardano-node cluster on a shared Docker volume; serves an HTTP health check on port 8090 for the driver to poll.
  • antithesis_run.sh — driver container entrypoint. Waits for the node health check, then in multi-container mode:
    • Starts a local cardano-submit-api (submit-api tests need localhost access)
    • Starts a TCP proxy localhost:<pool1_port> → NODE_HOST:<pool1_port> (for cardano-cli ping tests)
    • Starts a local HTTP file server for anchor URLs used by governance tests
    • Emits the Antithesis setup_complete signal and hands off to regression.sh
  • docker-compose.yaml — two-service compose: node + driver, sharing a cluster-state volume for Unix socket access.
  • Dockerfile.config — minimal FROM scratch image containing only docker-compose.yaml, as required by Antithesis for the config image.
  • README.md — build/push/validate instructions and environment variable reference.

cardano_node_tests/utils/antithesis.py (new)

Thin wrappers around the Antithesis SDK (always, sometimes, reachable, unreachable). All functions are no-ops when the antithesis package is not installed, so tests work normally outside the Antithesis environment.

cardano_node_tests/tests/conftest.py

Adds a pytest_runtest_logreport hook that emits a structured antithesis_assert SDK entry for every test failure, allowing the Antithesis platform to track individual test results. Will be removed once all relevant tests have explicit antithesis.always() assertions.

cardano_node_tests/tests/test_tx_basic.py

Adds antithesis.always() assertions to test_transfer_funds_build_raw as the first example of explicit SDK property instrumentation.

.github/regression.sh

  • CARDANO_NODE_SOCKET_PATH_CI is now set conditionally so the driver can pre-configure it to point at the shared volume socket.
  • When CARDANO_PREBUILT_DIR is set, all nix binary builds are skipped and PATH_PREPEND points at the pre-built directories instead.
  • When _VENV_DIR is set and exists, setup_venv.sh is called without clean to reuse the pre-built venv.

.github/run_tests.sh

--kill-after increased from 0 to 120 seconds to allow pytest time to complete teardown after SESSION_TIMEOUT sends SIGINT before the hard SIGKILL.

@saratomaz saratomaz force-pushed the prepare_docker_images branch 2 times, most recently from 469ffde to 00d0046 Compare February 17, 2026 17:17
@saratomaz saratomaz force-pushed the prepare_docker_images branch from 00d0046 to 44d42c3 Compare March 3, 2026 12:46
@saratomaz saratomaz force-pushed the prepare_docker_images branch 5 times, most recently from 9d70340 to f68b397 Compare March 17, 2026 15:19
@saratomaz saratomaz force-pushed the prepare_docker_images branch from 93fa764 to 7f992ed Compare April 9, 2026 14:20
@saratomaz saratomaz force-pushed the prepare_docker_images branch from 7f992ed to c37efbb Compare April 9, 2026 14:43
@saratomaz saratomaz force-pushed the prepare_docker_images branch from 3e75de1 to f3324ba Compare April 21, 2026 11:01
@saratomaz saratomaz force-pushed the prepare_docker_images branch from f3324ba to efa4b95 Compare April 21, 2026 12:04
@saratomaz saratomaz force-pushed the prepare_docker_images branch from 86aa300 to da14310 Compare May 13, 2026 09:41
@saratomaz saratomaz marked this pull request as ready for review May 20, 2026 16:20
@saratomaz saratomaz requested a review from mkoura as a code owner May 20, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant