Test environments
Build Promotion Strategy
Software gets built on development machines and would get deployed to environments. The build promotion strategy could involve multiple environments until it reaches production.
A typical example is - a build could get promoted to production as shown below
DEV(local machine) → CI → QA → UAT → PreProd → Prod
Define environments
As an example, let us assume we have 2 environments
- UAT
- QA
Let us create folder structure to store environment specific properties and test data
Create a folder called
data_sets
undersrc/test/resources
. Let us use this folder as the root folder to store details of all environment properties & test dataCreate folder structure for these environments. Let us create the below folders under data_sets
data_sets/QA
: Folder to hold environment properties & test data for QA environmentdata_sets/UAT
: Folder to hold environment properties & test data for UAT environment
Define configs for environments
Let us define configs for each environment - uat.properties
and qa.properties
Let us add properties datasets.dir
and datasets.env
to the configs
datasets.dir
: The root folder holding test data & environment propertiesdatasets.env
: The folder underdatasets.dir
, holding environment specific properties and test data
Here is the code snippet.
config/uat.properties
# Web Config
web.url: https://www.uat.google.com/
# Folder name under resources having test data
datasets.dir: data_sets
# Folder name under datasets.dir having data for specific environment eg: UAT | PREPROD | QA
datasets.env: UAT
config/qa.properties
web.url: https://www.qa.google.com/
# Folder name under resources having test data
datasets.dir: data_sets
# Folder name under datasets.dir having data for specific environment eg: UAT | PREPROD | QA
datasets.env: QA