Skip to content

test block is not recognized in .tftest.hcl file #2191

@tomasji

Description

@tomasji

Extension Version

v2.37.7

VS Code Version

Version: 1.109.4 (Universal)
Commit: c3a26841a84f20dfe0850d0a5a9bd01da4f003ea
Date: 2026-02-16T15:35:57.932Z (2 days ago)
Electron: 39.3.0
ElectronBuildId: 13313481
Chromium: 142.0.7444.265
Node.js: 22.21.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

Operating System

macOS Darwin 25.3.0

Terraform Version

Terraform v1.14.3 on darwin_arm64

Steps to Reproduce

Open file example_test.tftest.hcl - the "test" block is underlined:

  • Unexpected block: Blocks of type "test" are not expected here
test {
  parallel = false
}

run "create-policy" {
  command = apply
  ...

Expected Behavior

test block is supported
(https://developer.hashicorp.com/terraform/language/tests#syntax)

Actual Behavior

Blocks of type "test" are not expected here

Terraform Configuration

Project Structure

Gist

No response

Anything Else?

No response

Workarounds

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions