From 36997a02547ba598b4ef8fcd5db4f6c6611d0f27 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 15 Oct 2026 19:43:05 +0200 Subject: [PATCH] docs: prohibit unit tests for E2E code Clarify that code under cardano_node_tests/tests/, including helpers and fixtures, must be validated through E2E functional tests. Apply the rule to both writing and running test guidance, including unit tests that would otherwise be placed in framework_tests/. --- agent_docs/e2e_tests.md | 2 ++ agent_docs/running_tests.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/agent_docs/e2e_tests.md b/agent_docs/e2e_tests.md index 37b3e8942..c25b7777b 100644 --- a/agent_docs/e2e_tests.md +++ b/agent_docs/e2e_tests.md @@ -2,6 +2,8 @@ This document applies only to E2E functional tests under `cardano_node_tests/tests/`. Unit tests for the framework itself live under `framework_tests/` and are plain pytest tests. +Never add unit tests for code under `cardano_node_tests/tests/`, including test-specific helpers and fixtures. Validate changes to that code through E2E functional tests instead. + The guidelines apply to writing new tests and also to larger changes of existing tests (refactoring, extending, moving tests or fixtures). When changing an existing test, bring the parts you touch in line with these guidelines, but don't rewrite unrelated code just to comply. Organize tests in classes that group related functionality. diff --git a/agent_docs/running_tests.md b/agent_docs/running_tests.md index 88303b478..b019e37a6 100644 --- a/agent_docs/running_tests.md +++ b/agent_docs/running_tests.md @@ -8,6 +8,8 @@ Unit tests cover the testing framework itself (`framework_tests/` plus doctests ./.venv/bin/pytest --doctest-modules framework_tests cardano_node_tests/utils/ ``` +Never add unit tests for code under `cardano_node_tests/tests/`, including test-specific helpers and fixtures, even if the unit tests would live in `framework_tests/`. Validate that code through E2E functional tests instead. + ## E2E Functional Tests E2E functional tests (everything under `cardano_node_tests/tests/`) run against a local testnet cluster. The tests are using pytest. Always use the `ai_run.sh` wrapper script to run the `pytest` command.