Skip to main content

test

Command used to confirm the desired state of resources in a specified stack in a given environment.


Syntax

stackql-deploy test STACK_DIR STACK_ENV [FLAGS]

Arguments

ArgumentDescriptionExample
STACK_DIRThe directory containing the stack configuration filesmy-stack
STACK_ENVThe target environment for testing the stackdev
info

STACK_DIR can be an absolute or relative path.

STACK_ENV is a user-defined environment symbol (e.g., dev, sit, prd) used to test your stack in different environments.

Optional Flags

FlagDescriptionExample
--log-levelSet the logging level. Default is INFO--log-level DEBUG
--env-fileSpecify an environment variables file. Default is .env--env-file .env
-e --envSet additional environment variables (can be used multiple times)--env DB_USER=admin
--dry-runPerform a dry run of the operation. No changes will be made
--show-queriesDisplay the queries executed in the output logs
--download-dirCustom download directory for StackQL/etc/stackql
--custom-registryCustom StackQL provider registry URLhttps://myreg
tip

Exported variables specified as protected in the respective resource definition in the stackql_manifest.yml file are obfuscated in the logs by default.


Examples

Confirm desired state for a stack in a target environment

Run tests for the stack defined in the azure-stack directory in the sit environment, setting additional environment variables:

stackql-deploy test azure-stack sit \
-e AZURE_SUBSCRIPTION_ID=631d1c6d-0000-0000-0000-688bfe4e1468