liveBook · Manning

Evaluation suite

As explained in Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu

A test suite is a collection of tests maintained and executed together to evaluate software behavior.

A test suite is a collection of tests maintained and run together to check software behavior. For a Terraform module, it provides a repeatable way to catch bugs and check that changes preserve existing behavior. section 9.0 section 9.5

Organize tests around the infrastructure configurations they need. Several checks can share one configuration, avoiding a separate create-and-destroy cycle for each check. Tests that need contradictory configurations require separate setups. section 9.2.1

Two uses for an S3 module

A private S3 configuration intended for logging and a public-facing static website need different configuration values. Give each its own group of tests rather than forcing both through one setup. section 9.2.1

Treat the suite as production code: use clear variable names, comment what each test is meant to accomplish, review test changes in pull requests, and refactor tests when that makes future tests easier to write. Add a test when a bug is found to guard against its return. section 9.2.7 section 9.0

A CI system such as GitHub Actions can run the suite automatically on a pull request and prevent a failing change from being merged. The suite must exist before CI can automate it; CI is not a substitute for writing and maintaining tests. section 7.1

How Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu covers it

How deep it goes
Explains how to group checks by configuration and maintain tests, but does not give a complete suite implementation in the supplied passages.
Examples
Contrasts tests for a private logging S3 configuration with tests for a public-facing static website configuration.
What it assumes
Assumes familiarity with Terraform modules and configurations while explaining test grouping through a concrete S3 scenario.
What you can do after
Practice/perform test-suite maintenance to catch regressions and refactor Terraform modules with less risk.
How it connects
Connects test suites to continuous integration, regression testing, backward compatibility, and refactoring.

Also explained in

Compare how 11 books explain evaluation suite →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu. The section links point to the parts of the book it draws on.