Skip to content

Test dependencies and ordering — conditional execution chains #18

Description

@ThomasMalletCodra

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

  1. Extend # guitest: parser to support depends: directive.
  2. Build a DAG (directed acyclic graph) of test dependencies.
  3. Topological sort for execution order.
  4. Skip dependents immediately when a prerequisite fails.
  5. GUI: show dependency arrows or indent dependent tests under their parent.

Acceptance criteria

  • Tests can declare dependencies on other tests
  • Dependent tests are skipped when prerequisites fail
  • Skipped tests show reason: "dependency X failed"
  • Circular dependencies are detected and reported
  • Execution order respects the dependency graph
  • Independent tests are unaffected

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions