runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.82k stars 1.06k forks source link

policy_check should be able to fail when no tests executed by conftest #1550

Open xarses opened 3 years ago

xarses commented 3 years ago

In some cases, its possible to mess up your policies and end up with none available for conftest to evaluate.

Currently atlantis will bark if your policy path doesn't exist, but it doesn't have a mechanism to determine if 0 tests where ran

broken path

no tests detected

This can cause problems if you are expecting your policies to surface problems in the proposed changes, but instead there are no tests being ran.

I'd propose that we have an option added to require 0 tests not be present in the output, or even have a minimal number of tests expected per policy_set

nishkrishnan commented 3 years ago

lol https://github.com/runatlantis/atlantis/blob/master/server/events/runtime/policy/conftest_client.go#L195

seems this was never done... by me

nishkrishnan commented 3 years ago

nvm what i linked was not the same thing you're talking about.