Loading...
Loading...
### Terraform Version ```shell Terraform v1.10.3 on linux_amd64 ``` ### Terraform Configuration Files ```terraform # main.tf variable "name" { default = "John" } output "message" { value = "Hello, ${var.name}" } ``` ```terraform # ./tests/unit/example.tftest.hcl run "should_return_correct_message" { assert { condition = output.message == "Hello, John" error_message = "The message is not correct" } } ``` ### Debug Output ``` 2025-02-05T20:04:31.648Z [INFO] Terraform version: 1.10.3 2025-02-05T20:04:31.648Z [DEBUG] using github.com/hashicorp/go-tfe v1.70.0 2025-02-05T20:04:31.648Z [DEBUG] using github.com/hashicorp/hcl/v2 v2.23.0 2025-02-05T20:04:31.648Z [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1 2025-02-05T20:04:31.648Z [DEBUG] using github.com/zclconf/go-cty v1.15.1-0.20241111215639-63279be090d7 2025-02-05T20:04:31.648Z [INFO] Go runtime version: go1.23.3 2025-02-05T20:04:31.648Z [INFO] CLI args: []string{"terraform", "test", "-filter=tests/unit/example.tftest.hcl"} 2025-02-05T20:04:31.648Z [TRACE] Stdout is a terminal of width 204 2025-02-05T20:04:31.649Z [TRACE] Stderr is a terminal of width 204 2025-02-05T20:04:31.649Z [TRACE] Stdin is a terminal 2025-02-05T20:04:31.649Z [DEBUG] Attempting to open CLI config file: /home/vscode/.terraformrc 2025-02-05T20:04:31.649Z [DEBUG] File doesn't exist, but doesn't need to. Ignoring. 2025-02-05T20:04:31.649Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins 2025-02-05T20:04:31.649Z [DEBUG] ignoring non-existing provider search directory /home/vscode/.terraform.d/plugins 2025-02-05T20:04:31.649Z [DEBUG] ignoring non-existing provider search directory /home/vscode/.local/share/terraform/plugins 2025-02-05T20:04:31.649Z [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins 2025-02-05T20:04:31.649Z [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins 2025-02-05T20:04:31.649Z [INFO] CLI command args: []string{"test", "-filter=tests/unit/example.tftest.hcl"} 2025-02-05T20:04:31.649Z [DEBUG] checking for provisioner in "." 2025-02-05T20:04:31.656Z [DEBUG] checking for provisioner in "/usr/bin" 2025-02-05T20:04:31.656Z [DEBUG] TestSuiteRunner: found 0 files with 0 run blocks ``` ### Expected Behavior ``` tests/unit/example.tftest.hcl... in progress run "should_return_correct_message"... pass tests/unit/example.tftest.hcl... tearing down tests/unit/example.tftest.hcl... pass Success! 1 passed, 0 failed. ``` ### Actual Behavior `Success! 0 passed, 0 failed.` ### Steps to Reproduce 1. `terraform test -filter=tests/unit/example.tftest.hcl` ### Additional Context As per the [documentation](https://developer.hashicorp.com/terraform/cli/commands/test) we should be able to target a specific file with the -filter flag. The test is executed when either of the following commands are used: - `terraform test` - `terraform-test -test-directory=tests/unit` ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.