A production-like environment approximates production without serving customers. It gives a team a place to test integrated changes before release and to investigate problems that are difficult to reproduce on a development computer. section 12.2.5 section 11.3.1
A typical workflow moves changes from a developer’s computer through integration and test environments before they reach the customer-facing environment. Local testing alone cannot check how one developer’s changes behave when integrated with others’ work. section 12.2.5
For a bug too complex to reproduce locally, first document steps that reliably reproduce it in the test environment. Experiment to identify the components involved, then remove those that do not contribute until the application is small enough to run locally. An automated test that initially fails can confirm that the bug is reproducible and later verify the fix. section 11.3.1
Create separate environments with Terraform
Parameterize the environment name and derive the application name from it. Different values can create separate development, test, and production instances from the existing Terraform configuration. section 12.2.5
Listing 12.2 Deriving app_name from environment in Terraform
variable “environment” {} #1
locals {
app_name = “flixtube-${var.environment}” #2
}
This listing derives the application name from the environment variable. section 12.2.5
A local Kubernetes deployment can also simulate a production-like setting, but it is not the same as running in production. Testing in a production-like environment improves realism without making the environment customer-facing. section 6.8.9 section 12.2.5
