terraform-compliance / cli

a lightweight, security focused, BDD test framework against terraform.
https://terraform-compliance.com
MIT License
1.35k stars 151 forks source link

Code Coverage Stats #328

Open proffalken opened 4 years ago

proffalken commented 4 years ago

Feature Request

Feature description : It would be great to have the tool output "code coverage" stats if possible - number of resources in the plan vs. number of resources covered by tests would be a good/simple start?

Something like the output from pycov/pyunit etc. so it can be pulled into existing tools for analysis would be amazing!

eerkunt commented 4 years ago

Superb idea! Just added this to our backlog.

proffalken commented 4 years ago

Amazing, thank you!

vrbcntrl commented 4 years ago

it would definitely be a cool feature...waiting for the new release to test this :)

AErmie commented 3 years ago

This is exactly what I'm looking for, and what other Terraform scanning tools (ie. TFSec, Checkov, TFLint, TerraScan, etc.) already provide. Is there any ETA when this feature might be made available?

For reference, I've accomplished the same with these other tools; which I want to do the same with Terraform-Compliance:

eerkunt commented 3 years ago

Since terraform-compliance runs agains a plan output and does not parse any HCL code, the code coverage functionality won't be similar to other tools that runs against HCL code.

There are no plans currently about scanning the HCL code by the way, since very earlier versions of terraform-compliance already did that and we think that is not the right way of doing it. 🤷‍♂️

I will ping this issue whenever we have something. 🎉

joanayma commented 6 months ago

I tried using --with-coverage and --cover-html=output but it seems to not read terraform-compliance results.