runatlantis / atlantis

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

Terratest implementation #892

Open ismferd opened 4 years ago

ismferd commented 4 years ago

Hi,

Could be fine to integrate a command to launch test like terratest before merge.

something like:

atlantis test

Do you have that or something like that in your roadmap?

lkysow commented 4 years ago

Do you have that or something like that in your roadmap?

No. Sounds like it would be best implemented as a custom command.

waltervargas commented 3 years ago

if is this implemented as a custom command, how can be the results post back to the pull request?

cawfeecoder commented 3 years ago

@lkysow What's the current status of this?

tjtaill commented 3 years ago

Anyone figure out how to run something tflint or terratest in atlantis be really useful ?

ismferd commented 3 years ago

finally, I did it through custom workflows and commands. So, Atlantis always runs terraform fmt if it found "drifts" the pipeline exit with a status code 1. It is something like an "admission controller". Same, with terratest but just for custom terraform modules.

je-sidestuff commented 1 year ago

finally, I did it through custom workflows and commands. So, Atlantis always runs terraform fmt if it found "drifts" the pipeline exit with a status code 1. It is something like an "admission controller". Same, with terratest but just for custom terraform modules.

Sounds cool. Do you mind posting a few implementation details?

nitrocode commented 1 year ago

@arcjor You can run terraform fmt and if it returns any output, you can throw a non zero exit code. It's possible it may return a non zero code by default.

entscheidungsproblem commented 1 year ago

I think this would be great as a separate command! I am currently setting up terratest to run in a custom workflow after applying. However, it would be even better if this can be run independently so users can rerun a test without having to reapply.