Global flags
The CLI exposes the following global flags available to all subcommands:
--var
Provides a single additional templating variable.
Syntax:
--var <KEY>=<VALUE>
Example:
rtf run test-plan.yaml --var 'message="hello, world"'
Multiple --var flags can be specified to override multiple variables:
rtf run test-plan.yaml \
--var 'message="hello"' \
--var 'subject="world"'
--vars
Provides multiple templating variables from a JSON file.
Syntax:
--vars <PATH>
Where <PATH> is a path to a JSON file containing key-value pairs.
Example:
Given a file variables.json:
{
"message": "hello",
"subject": "world"
}
rtf run test-plan.yaml --vars variables.json
Precedence
Variables are resolved in the following order (later values override earlier):
- Variables defined in the test plan’s
variablessection - Variables provided via
--varsJSON file - Variables provided via
--varflags
Related
- Hello, world! tutorial - demonstrates variable overrides
- Test Plans reference - documents the
variablessection