Skip to main content

kratix-test stage

A command for testing Kratix Promise stages

Description​

The command for testing Kratix Promise stages. This command will run your container stage and validate that the output generated by the container matches the contents of the --expected-output-dir.

Usage​

test stage [flags]

Examples​

# LIFECYCLE is one of: promise, resource
# ACTION is one of: configure, delete

# test stage 'create-db' from Resource Configure pipeline 'configure-pipeline-one'
kratix test stage resource/configure/configure-pipeline-one create-db --input-dir input-directory/ --expected-output-dir expected-outputs/

# test a specific stage given an image tag
kratix test stage --image-tag ghcr.io/syntasso/kratix-promise --input-dir input-directory/ --expected-output-dir expected-outputs/

Flags​

--build Build the image from the workflow path before running the test
--build-args string Extra build arguments to pass to the container run command
--buildx Run the test containers using Buildx
--command string The command to run on the specified container
-d, --dir string Directory to read the Promise from (default ".")
-e, --engine string The container engine to use when running the test containers (default "docker")
--env strings The environment variables to provide to the test container (e.g. DRY_RUN=true,ENVIRONMENT=dev)
-o, --expected-output-dir string The directory containing the expected output files to compare to the generated output
-h, --help help for stage
--image-tag string Name and a tag of the container image

See Also​