Description
Allow declaring dependencies between tests so that a test is only executed if its prerequisite tests have passed. This avoids running a cascade of integration tests when the setup/environment test has already failed, saving time and producing cleaner reports.
Current behavior
- Tests are executed in discovery order (alphabetical or as listed).
- No dependency mechanism — all tests run regardless of previous results.
- A failed setup test still triggers all downstream tests, which all fail with confusing errors.
Expected behavior
- Tests can declare dependencies via
# guitest: directives:
# guitest: show
# guitest: depends: test_setup_environment
def test_integration_scenario():
...
- If a dependency fails, dependent tests are automatically marked as "skipped (dependency failed)".
- Dependency chains are visualized in the GUI (tree or graph view).
- Circular dependencies are detected and reported as configuration errors.
- Independent tests (no dependencies) can still run in any order.
Implementation ideas
- Extend
# guitest: parser to support depends: directive.
- Build a DAG (directed acyclic graph) of test dependencies.
- Topological sort for execution order.
- Skip dependents immediately when a prerequisite fails.
- GUI: show dependency arrows or indent dependent tests under their parent.
Acceptance criteria
Description
Allow declaring dependencies between tests so that a test is only executed if its prerequisite tests have passed. This avoids running a cascade of integration tests when the setup/environment test has already failed, saving time and producing cleaner reports.
Current behavior
Expected behavior
# guitest:directives:Implementation ideas
# guitest:parser to supportdepends:directive.Acceptance criteria