Skip to content

Implement native terraform test code coverage generation #37605

@PT-GD

Description

@PT-GD

Terraform Version

Terraform v1.8.4
on linux_amd64

Use Cases

There doesn't seem to be a way to generate unit test coverage from a Terraform test. None of the current output options address coverage.

As HCL isn't an executable language where lines of code are run sequentially, I can see how this might be a hard-ish problem. However, it seems possible to mark a resource and/or attribute as "covered" if a test case evaluated it in the dependency graph of the test.

Attempted Solutions

The output options only report "passed, skipped, or failed" at the test case level. There's no concept of coverage.

Proposal

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions