Meta-Argument depends_on
The depends_on meta-argument allows you to define explicit execution dependencies between test resources to guarantee proper ordering and prevent race conditions.
1. Gherkin Tag Syntax (@depends_on)
Section titled “1. Gherkin Tag Syntax (@depends_on)”Define dependencies directly in your feature files using either canonical array brackets (matching Terraform lists) or comma-separated parameters:
@tc-checkout@depends_on(["auth/login.case.feature.tc-1", "inventory/catalog.case.feature.tc-4"])Scenario: Finalize checkout order When the user submits checkout Then order is createdSupported Syntax:
Section titled “Supported Syntax:”- Array notation (Terraform Parity):
@depends_on(["target1", "target2"]) - Comma-separated arguments:
@depends_on("target1", "target2")or@depends_on("target1") - Multiple tags:
@depends_on("target1") @depends_on("target2")
2. YAML Syntax in main.yml
Section titled “2. YAML Syntax in main.yml”dependencies: "checkout/checkout.case.feature.@tc-6": depends_on: - "auth/login.case.feature.@tc-1" - "inventory/catalog.case.feature.@tc-4"3. DAG Sorting and Cycle Detection
Section titled “3. DAG Sorting and Cycle Detection”- Topological Sorting (Kahn’s Algorithm): Prerequisites are applied and created first during
testform apply. - Circular Cycle Detection:
testform validateinspects the DAG and reports any circular dependency cycles before execution. - Graph Visualization:
testform graphdisplays dependency links with└── 🔗 depends_on: ....