You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: terraform/README.md
+40-12Lines changed: 40 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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
2
30
3
31
please add a new tfvars file under `terraform/testing-suites` folder, each tfvar file represent a testing suite.
4
32
5
-
### 1.1 add an ecs testing suite
33
+
### 2.1 add an ecs testing suite
6
34
7
35
specify below config in the tfvars file
8
36
1. otconfig_path, please put a new otconfig file under `terraform/templates/otconfig` folder and specify the path in the tfvars file.
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.
82
110
83
-
#### 1.4.1 otconfig
111
+
#### 3.1 otconfig
84
112
85
113
Below are the placeholders you can use in the otconfig
86
114
@@ -108,7 +136,7 @@ service:
108
136
exporters: [logging, awsemf]
109
137
```
110
138
111
-
#### 1.4.2 ecs task definition
139
+
#### 3.2 ecs task definition
112
140
113
141
Below are the placeholders you can use in the ecs task def.
114
142
@@ -222,7 +250,7 @@ an example:
222
250
]
223
251
```
224
252
225
-
#### 1.4.3 Docker compose file
253
+
#### 3.3 Docker compose file
226
254
227
255
Below are the placeholders you can use in the docker compose file
228
256
@@ -255,7 +283,7 @@ services:
255
283
start_period: 10s
256
284
```
257
285
258
-
#### 1.4.4 Eks Config
286
+
#### 3.4 Eks Config
259
287
260
288
Below are the placeholders you can use in the EKS config.
261
289
@@ -274,7 +302,7 @@ sample_app:
274
302
args: []
275
303
```
276
304
277
-
#### 1.4.5 Validation config.
305
+
#### 3.5 Validation config.
278
306
279
307
An example for validation config.
280
308
@@ -369,7 +397,7 @@ an example:
369
397
```
370
398
371
399
372
-
## 2. Build Sample App
400
+
## 4. Build Sample App
373
401
374
402
For any testing suite related with sdk, you are required to build a sample app.
375
403
@@ -396,7 +424,7 @@ Environment Variable: There will be some env vars which will be set while runnin
396
424
397
425
* Keep “/” accessible with response code 200.: This “/” will be used for the load balancer health check.
398
426
399
-
## 3. configure the testing suite in github workflow
427
+
## 5. configure the testing suite in github workflow
400
428
401
429
below is an example in the aoc repo workflow, you can also configure it in your sdk repos.
0 commit comments