Skip to content

testform modules

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

The testform modules command inspects the referenced configuration (main.yml and domain configuration files) and prints a list of all testing modules declared in the workspace along with their sources and resolved versions.

It matches the exact format and JSON schema of terraform modules.


Option Default Description
-json false Outputs declared modules and their resolved versions in machine-readable JSON format.
-var 'foo=bar' — Sets an input variable value in the root module. Can be specified multiple times.
-var-file=filename — Loads variable values from a file (testform.vars.yml or *.auto.vars.yml).

When no modules are present in the configuration:

Ventana de terminal
$ testform modules
No modules found in configuration.

And in JSON mode (-json):

Ventana de terminal
$ testform modules -json
{"format_version":"1.0","modules":null}

When modules are declared in main.yml (using the module: block):

version: "1.0"
module:
auth:
source: "./modules/auth"
checkout:
source: "./modules/checkout"
version: "1.2.0"
remote_qa:
source: "git::https://github.com/my-org/qa-modules.git//auth?ref=v2.0.0"

Running testform modules:

Ventana de terminal
$ testform modules
Modules declared by configuration:
.
├── "auth"[./modules/auth]
├── "checkout"[./modules/checkout] 1.2.0
└── "remote_qa"[git::https://github.com/my-org/qa-modules.git//auth?ref=v2.0.0] v2.0.0

Enables CI/CD pipelines, security scanners, and auditing tools to programmatically inspect declared modules:

Ventana de terminal
$ testform modules -json
{
"format_version": "1.0",
"modules": [
{
"key": "auth",
"source": "./modules/auth",
"version": ""
},
{
"key": "checkout",
"source": "./modules/checkout",
"version": "1.2.0"
},
{
"key": "remote_qa",
"source": "git::https://github.com/my-org/qa-modules.git//auth?ref=v2.0.0",
"version": "v2.0.0"
}
]
}

  • 0: Command executed successfully.
  • 1: Configuration reading or syntax error.