Open joshuaspence opened 4 months ago
Is your feature request related to a problem? Please describe. I have written unit tests for a Terraform module (see https://developer.hashicorp.com/terraform/language/tests) and want to run them in CircleCI.
Describe the solution you'd like A terraform/test command and terraform/test job.
terraform/test
Describe alternatives you've considered I am currently using my own job definition to achieve this.
job
jobs: terraform-test: description: 'Execute Terraform tests.' executor: name: 'terraform/default' resource_class: '<< parameters.resource_class >>' tag: '<< parameters.tag >>' parameters: checkout: description: 'Perform checkout as first step in job.' type: 'boolean' default: false path: description: 'Path to the Terraform module.' type: 'string' default: '.' resource_class: description: 'Specify the resource class for Docker executor.' type: 'string' default: 'medium' tag: description: 'Specify the Terraform Docker image tag for the executor.' type: 'string' default: '1.0.0' test_directory: description: 'Set the Terraform test directory.' type: 'string' default: 'tests' timeout: description: 'Configure a custom timeout limit' type: 'string' default: '10m' steps: - when: condition: '<< parameters.checkout >>' steps: - 'checkout' - run: command: 'terraform -chdir=<< parameters.path >> init -input=false -test-directory=<< parameters.test_directory >>' name: 'terraform init' - run: command: 'terraform -chdir=<< parameters.path >> test -test-directory=<< parameters.test_directory >>' name: 'terraform test' no_output_timeout: '<< parameters.timeout >>'
I am happy to submit a PR if there is interest in this.
Hi @joshuaspence, any contribution is welcome. It looks like you already have part of the work done, feel free to submit a PR and we will review it.
Is your feature request related to a problem? Please describe. I have written unit tests for a Terraform module (see https://developer.hashicorp.com/terraform/language/tests) and want to run them in CircleCI.
Describe the solution you'd like A
terraform/test
command andterraform/test
job.Describe alternatives you've considered I am currently using my own
job
definition to achieve this.