Skip to content

Commit 81f6cf6

Browse files
authored
Update README.md
1 parent a0e056c commit 81f6cf6

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

terraform/README.md

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
1-
## 1. Add a testing suite
1+
# How to add a testing suite to the framework
2+
3+
## 1. Basic concepts
4+
5+
There're some concepts you might want to learn before starting to add your testing suite.
6+
7+
### 1.1 the workflow of the testing framework
8+
9+
the testing framework is built based on terraform, every time you run your testing suite, it will
10+
11+
1. **Create resources** Create the related resources in your aws account, such as, ec2 instance/ecs cluster.
12+
2. **Install softwares** Install AWS Otel Collector/sample apps onto it and start it base on the configurations you provide.
13+
3. **Validate data** Validate the data by fetching them from backend(CloudWatch, XRay) base on the validation config you provide.
14+
15+
16+
### 1.2 Testing Suite
17+
18+
each file with suffix ".tfvar" under folder `terraform/testing-suites` will be treated as a testing suite, each testing suite defines different otconfig, validation_config, and deployment config based on different platform.Ex(taskdef for ECS)
19+
20+
### 1.3 AOC Version
21+
22+
`aoc_version` is a parameter you can use while running the testing-suite, which tells the testing framework to fetch the AWS Otel Collector with this version, this parameter is useful especially when you create a PR to AWS Otel Collector, which will build a version to you with your unmerged code, so that you can test your "new code" with your new testing suite.
23+
24+
### 1.4 Testing Id
25+
26+
`testing_id` is a placeholder that you can use in your configuration, which is a unique id representing each run of the testing suite. You can use this testing id as part of your metric name, or dimension name, to ensure the metric emitted from each run of the testing suite is different, so that the validation will always validate on your new metric.
27+
28+
29+
## 2. Add a testing suite
230

331
please add a new tfvars file under `terraform/testing-suites` folder, each tfvar file represent a testing suite.
432

5-
### 1.1 add an ecs testing suite
33+
### 2.1 add an ecs testing suite
634

735
specify below config in the tfvars file
836
1. otconfig_path, please put a new otconfig file under `terraform/templates/otconfig` folder and specify the path in the tfvars file.
@@ -27,7 +55,7 @@ validation_config="statsd-metric-validation.yml"
2755
data_emitter_image="alpine/socat:latest"
2856
```
2957

30-
### 1.2 add an ec2 testing suite
58+
### 2.2 add an ec2 testing suite
3159

3260
specify below config in the tfvars file
3361
1. otconfig_path, please put a new otconfig file under `terraform/templates/otconfig` folder and specify the path in the tfvars file.
@@ -53,7 +81,7 @@ data_emitter_image="alpine/socat:latest"
5381
```
5482

5583

56-
### 1.3 add an eks testing suite
84+
### 2.3 add an eks testing suite
5785

5886
specify below config in the tfvars file
5987
1. otconfig_path, please put a new otconfig file under `terraform/templates/otconfig` folder and specify the path in the tfvars file.
@@ -76,11 +104,11 @@ validation_config="statsd-metric-validation.yml"
76104
data_emitter_image="alpine/socat:latest"
77105
```
78106

79-
### 1.4 how to write the configurations?
107+
### 3 how to write the configurations?
80108

81109
You are able to use placeholders in your configuration files, the testing framework will replace the placeholders with its runtime value when you run the testing suite.
82110

83-
#### 1.4.1 otconfig
111+
#### 3.1 otconfig
84112

85113
Below are the placeholders you can use in the otconfig
86114

@@ -108,7 +136,7 @@ service:
108136
exporters: [logging, awsemf]
109137
```
110138
111-
#### 1.4.2 ecs task definition
139+
#### 3.2 ecs task definition
112140
113141
Below are the placeholders you can use in the ecs task def.
114142
@@ -222,7 +250,7 @@ an example:
222250
]
223251
```
224252

225-
#### 1.4.3 Docker compose file
253+
#### 3.3 Docker compose file
226254

227255
Below are the placeholders you can use in the docker compose file
228256

@@ -255,7 +283,7 @@ services:
255283
start_period: 10s
256284
```
257285
258-
#### 1.4.4 Eks Config
286+
#### 3.4 Eks Config
259287
260288
Below are the placeholders you can use in the EKS config.
261289
@@ -274,7 +302,7 @@ sample_app:
274302
args: []
275303
```
276304
277-
#### 1.4.5 Validation config.
305+
#### 3.5 Validation config.
278306
279307
An example for validation config.
280308
@@ -369,7 +397,7 @@ an example:
369397
```
370398

371399

372-
## 2. Build Sample App
400+
## 4. Build Sample App
373401

374402
For any testing suite related with sdk, you are required to build a sample app.
375403

@@ -396,7 +424,7 @@ Environment Variable: There will be some env vars which will be set while runnin
396424

397425
* Keep “/” accessible with response code 200.: This “/” will be used for the load balancer health check.
398426

399-
## 3. configure the testing suite in github workflow
427+
## 5. configure the testing suite in github workflow
400428

401429
below is an example in the aoc repo workflow, you can also configure it in your sdk repos.
402430

0 commit comments

Comments
 (0)