百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

tdd-infrastructure

> 编程语言
开源

基础设施测试驱动开发的一些示例

199 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

基础设施测试驱动开发的一些示例

tdd-infrastructure

Examples for Test-Driven Development (TDD) of infrastructure.

Each directory has its own README and Makefile documenting how to run the tests and build the infrastructure associated with the example.

  • tf-aws-ec2: A TDD example created for 2019 O'Reilly Velocity
  • tf-aws-s3: A TDD example created for this blog post
  • tf-azure-network: A TDD example create for the Perth Hashicorp User Group

Refer to the Makefile in each directory for how to build the tests.

Useful References

Test-Driven Development

Generally, you can write your own testing framework with any language, focusing on testing the state or definition of infrastructure. For unit or contract (state) testing, tests will involve checking JSON or YAML configuration. Most infrastructure as code frameworks will already have acceptance tests to ensure the infrastructure resources are created properly.

  • Introduction to Test-Driven Development

Server Testing Tools

  • Goss
  • Inspec
  • Test-Kitchen
    • kitchen-ec2

Terraform Specific

Unit / Contract Testing

Below are frameworks that check for configuration that might lead to upstream problems (not caught by Terraform plan). For example, database username must be 16 characters.

  • terraform-linters/tflint

The tools below are mostly presented as policy as code frameworks but can be used for unit or contract (state) testing infrastructure.

  • instrumenta/conftest
  • Open Policy Agent
  • Terraform Sentinel (not OSS)

BDD Frameworks

Thanks to @petems for discovering these!

  • xchapter7x/clarity
  • eerkunt/terraform-compliance
  • elmundio87/terraform-validate

End-to-End Frameworks

These are frameworks that create the infrastructure, execute a set of tests, and (optionally) destroys the infrastructure.

  • gruntwork-io/terratest
  • newcontext-oss/kitchen-terraform

Policy as Code (with Security Scanning)

Some of these frameworks include built-in policies for various providers, others must be extended.

Built-In Policies
  • liamg/tfsec
  • accurics/terrascan
  • bridgecrew/checkov
  • Terraform Sentinel (not OSS)
  • fugue/regula: policies you can run via Open Policy Agent
  • Forseti Terraform-Validator (not OSS)
Write Your Own
  • instrumenta/conftest
  • Open Policy Agent
  • Terraform Sentinel (not OSS)

Infrastructure Mocking

Use with caution. Mocks aren't always updated with latest API or configuration.

  • localstack for AWS
  • GCP Emulator: emulates specific services on GCP. Mostly for application-related use.

Kubernetes

  • vmware-tanzu/sonobuoy
  • Open Policy Agent
  • Helm unittest
  • Helm test

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言