3 ms·
Sorry, this may be a miscommunication. Terraform itself has a test suite, yeah, but it doesn't have a testing framework that users of the language can use to te
by tedivm 3y ago
Sorry, this may be a miscommunication. Terraform itself has a test suite, yeah, but it doesn't have a testing framework that users of the language can use to test their own code.
To make a python metaphor, if cpython had a testing suite but pytest didn't exist then people wouldn't be able to test their own python code. That's kind of the situation with Terraform right now- you can't test your code using just the Terraform tools, you have to rely on Terratest which was written by Gruntwork. Hashicorp has spent years relying on the open source community to fill those gaps, which Gruntwork has done very nicely.
Hashicorp even recommends Terratest for testing: https://www.hashicorp.com/blog/testing-hashicorp-terraform https://www.hashicorp.com/blog/testing-hashicorp-terraform
- pseg134 3y agoIt isn’t a miscommunication, jen20 is astroturfing for hashicorp. Look at all of their recent posts.
- jen20 3y ago"Astroturfing"... lol OK. I don't think I've ever made it a secret that I worked for HashiCorp in the early days (leaving in 2017), and have been critical to the point of being banned by the CEO from speaking at HashiConf. Saying "Terraform doesn't have a test suite" is not miscommunication, it is misinformation, plain and simple - the same as most of the other things I have been correcting this week (not least from the same poster in this thread - someone who's clearly has an axe to grind).
- candiddevmike 3y agoYou and the OP are referring to different things. Terraform the codebase has a test suite. Terraform the app does not have a test suite/runner as in a way to run tests against your Terraform files.
- jen20 3y agoIt doesn’t have a testing tool built in. No one legitimately understands the phrase “terraform doesn’t have a test suite” to mean anything except “there are no tests”. A runner and a suite are quite different.
- tedivm 3y agoI can understand the miscommunication in the first post, but I clarified in a direct comment to you what I meant. I was even comparing it to Terratest, which is not used for testing terraform core. At this point you're just being belligerent for the sake of being belligerent.
- jen20 3y agoI'm not arguing with you, your clarifying comment was fine. I'm arguing with the person who replied to you.
- empressplay 3y agoThis is not testing? https://developer.hashicorp.com/terraform/cli/commands/plan https://developer.hashicorp.com/terraform/cli/commands/plan
- candiddevmike 3y agoNo, that's a rough guesstimate from Terrafrom on what actions it will be doing. Terratest allows you to write actual tests and mocks.
- jen20 3y agoThis one needs some clarification. It’s actually not a guesstimate about what actions will be taken, it’s a guesstimate of the state that will result from those actions without any reference to ordering or “actions” as a cloud API would understand them - the plan is purely in terms of CRUD on Terraform provider resources and provisioners. This may seem like a nit, but it fundamentally changes what Terraform is capable of doing in a single pass without external coordination.