Skip to content

Commit 8d795d5

Browse files
author
Andreas Heumaier
committed
Fix: Sync README from azure-dev-docs-pr on best-practice-compliance-testing
1 parent a1f201a commit 8d795d5

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

samples/compliance-testing/README.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
---
2-
title: Terraform Compliance Testing
3-
description: This article shows how to apply BDD-style compliance testing to terraform
4-
ms.topic: tutorial
5-
ms.date: 06/15/2020
6-
---
7-
81
# Tutorial: Terraform Compliance Testing
92

103
Compliance testing, also known as Conformance testing, is a nonfunctional testing technique which is done to validate whether the system developed meets the organization’s prescribed standards or not. Most software teams do an analysis to check that the standards are properly enforced and implemented. Often working simultaneously to improve the standards, which will, in turn, lead to better quality.
114

12-
## Prerequisites
13-
14-
- **Terraform:** [install and run](configure-vs-code-extension-for-terraform.md) your first Terraform command from your machine.
15-
- **Docker:** [install](https://docs.docker.com/get-docker/) the docker command on your machine.
16-
- **terraform-compliance:** [install](https://terraform-compliance.com/pages/installation/docker) the terraform-compliance tool on your machine.
17-
- **Fork testing samples:** to get started quickly, we recommend that you fork [this repository](https://github.com/Azure/terraform) into your own GitHub organization.
18-
195
## When to use Compliance Testing
206

217
Compliance testing is performed to ensure the compliance of the deliverables of each phase of the development lifecycle. If you you have to enforce sufficient tests to validate the degree of compliance to the methodology and identify the violators.
@@ -125,7 +111,7 @@ docker run --rm -v $PWD:/target -it eerkunt/terraform-compliance -f features -p
125111

126112
This should result in a failing test run. We see our first rule of requiring existence of tags suceed but we don't comply with the full spec of tags: `Role` and `Creator` tags are missing:
127113

128-
![tf-compliance-run-tagging-fail](media/best-practice-compliance-testing/tf-compliance-run-tagging-fail.png)
114+
![tf-compliance-run-tagging-fail](assets/tf-compliance-run-tagging-fail.png)
129115

130116
Make the test green again by adding all required tags to `main.tf`:
131117

@@ -148,9 +134,5 @@ terraform plan -out tf.out
148134

149135
Now, we should be green when running the tests suite again. We see our first rule of requiring existence of tags suceed and now we also provide the full spec of tags too:
150136

151-
![tf-compliance-run-tagging-succeed](media/best-practice-compliance-testing/tf-compliance-run-tagging-succeed.png)
152-
153-
## Next steps
137+
![tf-compliance-run-tagging-succeed](assets/tf-compliance-run-tagging-succeed.png)
154138

155-
> [!div class="nextstepaction"]
156-
> [Create and run end-to-end tests in Terraform projects](best-practices-end-to-end-testing.md)

0 commit comments

Comments
 (0)