Skip to content

testform graph

Ventana de terminal
testform [global options] graph [options]

The testform graph command outputs the visual execution graph of your test infrastructure. It supports multiple output formats including the canonical Graphviz DOT format, native Mermaid diagrams, and an interactive terminal tree (Console / Tree).


Option Description
-format=FORMAT Output format for the graph. Allowed values: dot (default), mermaid, console, tree, string.
-draw-cycles Highlight dependency cycles in red edges for troubleshooting.
-type=TYPE Type of operation graph to output: plan, plan-refresh-only, plan-destroy, or apply.
-plan=tfplan Render graph using a previously saved plan file. Implies -type=apply.
-scope=SCOPE Filter graph by resource scope (testcase, testrun, testplan).

Ideal for generating SVG or PNG images with Graphviz tools:

Ventana de terminal
$ testform graph -format=dot
digraph G {
rankdir = "RL";
node [shape = rect, fontname = "sans-serif"];
"testcase.login_valid" -> "testrun.sprint_42";
"testcase.checkout_coupon" -> "testrun.sprint_42";
"testrun.sprint_42" -> "testplan.release_2_0";
}
Ventana de terminal
# Export directly to SVG:
testform graph | dot -Tsvg -o dependencies.svg

Ideal for embedding into Markdown documentation, Pull Requests, or wikis:

Ventana de terminal
$ testform graph -format=mermaid
graph TD
subgraph testplan["Certification Plan"]
TP1["Release 2.0 (@tp-1)"]
end
subgraph testrun["Test Runs"]
TR1["Sprint 42 (@tr-1)"]
end
subgraph testcase["Test Cases"]
TC1["Validate Login (@tc-1)"]
TC2["Checkout with Coupon (@tc-2)"]
end
TR1 --> TP1
TC1 --> TR1
TC2 --> TR1

3. Console / Tree Format (-format=console or -format=tree)

Section titled “3. Console / Tree Format (-format=console or -format=tree)”

Inspect dependencies directly in your terminal with a clean ASCII tree:

Ventana de terminal
$ testform graph -format=console
testplan: Release v2.0 (@tp-1)
└── testrun: Sprint 42 (@tr-1)
├── testcase: Validate Login (@tc-1)
└── testcase: Checkout with Coupon (@tc-2)

When circular dependencies exist between tests, the -draw-cycles flag detects the cycle using a depth-first search (DFS) algorithm and highlights the back-edges in red:

Ventana de terminal
$ testform graph -draw-cycles -format=dot
digraph G {
"testcase.A" -> "testcase.B";
"testcase.B" -> "testcase.A" [color = "red", penwidth = 2.0];
}