Get Help

Environment variables

CAT replaces %VARIABLE_NAME% with the value of that environment variable.

Environment variables serve two purposes in CAT configuration:

  • keeping sensitive values — passwords, secrets, whole connection strings — out of the file, and out of version control;
  • parametrizing a project file, so one set of definitions can be run against several environments, terminals, regions and so on.

Syntax

Refer to an environment variable as %YOUR_ENVIRONMENT_VARIABLE_NAME%.

Variable names follow the rules of the operating system: on Windows %testing_user% and %TESTING_USER% are the same variable, on Linux and macOS they are not. Write the name exactly as it is defined and it works on both.

Replacement happens only when a variable of that name exists. Text between percent signs that names no variable is left untouched — a query containing WHERE PilotName LIKE '%SMITH%' is passed through unchanged, because no variable named SMITH exists.

Where it applies

In values — almost anywhere a value is read. Keys are never expanded. A whole connection string, or part of one:

Connection string: '%AERO_CONNECTION_STRING%'
# or
Connection string: >
  Host=localhost;port=5432;database=aero_operations;CommandTimeout=10;
  User ID=%TESTING_USER%;Password=%TESTING_PASSWORD%;

Inside SQL or DAX statements — this is how a query is parametrized, a terminal or a race number coming from outside the file:

Query: |
  SELECT  COUNT(*) AS Count
  FROM    Operation.SecurityCheck
  WHERE   Terminal = %TERMINAL_NUMBER%

In test names, in descriptions, in the path a list points at, in root settings such as Threads — wherever a value is needed.