简体   繁体   English

跳过 InitAndApply 和销毁

[英]Skipping InitAndApply and Destroy

Is there a way to skip the InitAndApply and Destroy phases of the test?有没有办法跳过测试的InitAndApplyDestroy阶段?

I want to just terraform output and build out my test assertions with testify/assert我只想terraform output并使用 testify testify/assert构建我的测试断言

It does not fit very well for Terratest to skip the init and apply phases. Terratest不太适合跳过initapply阶段。 Just because Terratest is an end-to-end test tool.仅仅因为Terratest是一个端到端的测试工具。 According to the Terraform blog post Testing HashiCorp Terraform , Terratest as and end-to-end tool aims to answer the question:根据 Terraform 博客文章测试 HashiCorp TerraformTerratest作为端到端工具旨在回答这个问题:

Can someone use the infrastructure system successfully?”有人能成功使用基础设施系统吗?” For example, application developers should still be able to deploy to HashiCorp Nomad after you upgrade the version.例如,应用程序开发人员在升级版本后应该仍然能够部署到 HashiCorp Nomad。

For the type of test that you are looking for you might use a simple unit test like terraform validate that do not require active infrastructure resources or authentication to an infrastructure provider.对于您正在寻找的测试类型,您可以使用简单的单元测试,例如terraform validate ,不需要主动基础设施资源或对基础设施提供商进行身份验证。 Other tools for Terraform unit test can be found at the Some examples of Test-Driven Development for Infrastructure git repo. Terraform 单元测试的其他工具可以在一些示例的基础设施测试驱动开发git 存储库中找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM