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: README.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,6 @@ This is optional item, only do it if your goal is to add a component or fix a bu
37
37
38
38
4. find out the version number, click into the workflow page, click `e2etest-preparation` step, and click `Versioning for testing`, record the version number. Ex(v0.1.12-299946851).
39
39
40
-
5. provide your testing aws account id to Ying(wangmyin@), so that he will give permission to your aws account to fetch the testing image from a private ECR. [todo, once we migrate to dockerhub, you don't need this step]
41
-
42
40
43
41
## 2. Run ECS Test
44
42
@@ -48,7 +46,7 @@ This is optional item, only do it if your goal is to add a component or fix a bu
48
46
cd terraform/ecs && terraform init && terraform apply -var-file="../testing-suites/statsd-ecs.tfvars"
49
47
```
50
48
51
-
### 2.1 run with a specific aoc version
49
+
### 2.2 run with a specific aoc version if you have done 1.4
52
50
53
51
```shell
54
52
cd terraform/ecs && terraform init && terraform apply -var-file="../testing-suites/statsd-ecs.tfvars" -var="aoc_version={the version you got from workflow}"
@@ -61,35 +59,35 @@ cd terraform/ecs && terraform destory"
61
59
```
62
60
## 3. Run EC2
63
61
64
-
### 3.1 run with the testing suite [only amazonlinux2 is supported at this moment]
62
+
### 3.1 run with the testing suite [support amazonlinux2, ubuntu16, windows2019]
65
63
66
64
```shell
67
-
cd terraform/ec2 && terraform init && terraform apply -var="sshkey_s3_bucket={the bucket name you setin setup}" -var-file="../testing-suites/statsd-ec2.tfvars"
65
+
cd terraform/ec2 && terraform init && terraform apply -var="testing_ami=amazonlinux2" -var="sshkey_s3_bucket={the bucket name you setin setup}" -var-file="../testing-suites/statsd-ec2.tfvars"
68
66
```
69
67
70
-
### 3.2 run with a specfic aoc version
68
+
### 3.2 run with a specfic aoc version if you have done 1.4
71
69
72
70
73
71
```shell
74
72
cd terraform/ec2 && terraform init && terraform apply -var="sshkey_s3_bucket={the bucket name you setin setup}" -var-file="../testing-suites/statsd-ec2.tfvars" -var="aoc_version={the version you got from workflow}"
75
73
```
76
74
77
-
### 3.3 don't forget to clean the resources
75
+
### 3.3 don't forget to clean the resources
78
76
```shell
79
-
cd terraform/ec2 && terraform destory"
77
+
cd terraform/ec2 && terraform destory
80
78
```
81
79
82
80
## 4. Run EKS
83
81
84
-
create a eks cluster in your account before run below command
82
+
please note you are required to create a eks cluster in your account before running below command
85
83
86
84
### 4.1 run with the testing suite
87
85
88
86
```shell
89
87
cd terraform/eks && terraform init && terraform apply -var="eks_cluster_name={the eks cluster name in your account}" -var-file="../testing-suites/statsd-eks.tfvars"
90
88
```
91
89
92
-
### 4.2 run with a specfic aoc version
90
+
### 4.2 run with a specfic aoc version if you have done 1.4
93
91
94
92
```shell
95
93
cd terraform/eks && terraform init && terraform apply -var="eks_cluster_name={the eks cluster name in your account}" -var-file="../testing-suites/statsd-eks.tfvars" -var="aoc_version={the version you got from workflow}"
Copy file name to clipboardExpand all lines: terraform/README.md
+89-20Lines changed: 89 additions & 20 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
2
3
-
please add a new tfvars file under `terraform/testing-suites` folder, each tfvar file represent a testing suite.
3
+
## 1. Basic concepts
4
4
5
-
### 1.1 add an ecs testing suite
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
30
+
31
+
please add a new tfvars file under `terraform/testing-suites` folder, each tfvar file represent a testing suite.
32
+
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.
@@ -13,24 +41,47 @@ specify below config in the tfvars file
13
41
6.[optional] aoc_image_repo, if you have an aoc image you just built with the new component, then set its repo name here
14
42
7.[optional] aoc_version, if you have an aoc image you just built with the new component, then set it as its tag name.
# this file is defined in validator/src/main/resources/validations
53
+
validation_config="statsd-metric-validation.yml"
54
+
55
+
data_emitter_image="alpine/socat:latest"
56
+
```
57
+
58
+
### 2.2 add an ec2 testing suite
17
59
18
60
specify below config in the tfvars file
19
61
1. otconfig_path, please put a new otconfig file under `terraform/templates/otconfig` folder and specify the path in the tfvars file.
20
62
2. docker_compose_path, please put a new docker compose file under `terraform/templates/ec2-docker-compose-config` folder and specify the path in the tfvars file.
21
63
3. validation_config, please put a new validation config file under `validator/src/main/resources/validations` folder and specify the filename in the tfvars file.
22
64
4.[optional] sample_app_callable, by default it's true, only set it to false when you don't have a web application sample app image
23
65
5.[optional] data_emitter_image, if you have a sample app then set its image name here
24
-
6.[optional] package_s3_bucket, if you have an aoc rpm/deb/msi built with the new component, and uploaded it to s3, then set its s3 bucket name here.
25
66
7.[optional] aoc_version, if you have an aoc rpm/dev/msi you just built with the new component, then set it as its tag name.
26
67
27
-
please note the rpm/dev/msi s3 object path should be
# this file is defined in validator/src/main/resources/validations
102
+
validation_config="statsd-metric-validation.yml"
103
+
104
+
data_emitter_image="alpine/socat:latest"
105
+
```
106
+
107
+
### 3 how to write the configurations?
108
+
109
+
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.
45
110
46
-
#### 1.4.1 otconfig
111
+
#### 3.1 otconfig
47
112
48
113
Below are the placeholders you can use in the otconfig
49
114
@@ -71,7 +136,7 @@ service:
71
136
exporters: [logging, awsemf]
72
137
```
73
138
74
-
#### 1.4.2 ecs task definition
139
+
#### 3.2 ecs task definition
75
140
76
141
Below are the placeholders you can use in the ecs task def.
77
142
@@ -185,7 +250,7 @@ an example:
185
250
]
186
251
```
187
252
188
-
#### 1.4.3 Docker compose file
253
+
#### 3.3 Docker compose file
189
254
190
255
Below are the placeholders you can use in the docker compose file
191
256
@@ -218,7 +283,7 @@ services:
218
283
start_period: 10s
219
284
```
220
285
221
-
#### 1.4.4 Eks Config
286
+
#### 3.4 Eks Config
222
287
223
288
Below are the placeholders you can use in the EKS config.
224
289
@@ -237,7 +302,7 @@ sample_app:
237
302
args: []
238
303
```
239
304
240
-
#### 1.4.5 Validation config.
305
+
#### 3.5 Validation config.
241
306
242
307
An example for validation config.
243
308
@@ -269,6 +334,10 @@ Below are the placeholders you can use in the expected data pattern.
269
334
270
335
* metricNamespace
271
336
* testingId
337
+
* ecsContext.ecsClusterName
338
+
* ecsContext.ecsTaskArn
339
+
* ecsContext.ecsTaskDefFamily
340
+
* ecsContext.ecsTaskDefVersion
272
341
273
342
an example:
274
343
@@ -278,7 +347,7 @@ an example:
278
347
namespace: {{metricNamespace}}
279
348
dimensions:
280
349
-
281
-
name: OTLib
350
+
name: OTelLib
282
351
value: cloudwatch-otel
283
352
-
284
353
name: apiName
@@ -291,7 +360,7 @@ an example:
291
360
namespace: {{metricNamespace}}
292
361
dimensions:
293
362
-
294
-
name: OTLib
363
+
name: OTelLib
295
364
value: cloudwatch-otel
296
365
-
297
366
name: apiName
@@ -304,7 +373,7 @@ an example:
304
373
namespace: {{metricNamespace}}
305
374
dimensions:
306
375
-
307
-
name: OTLib
376
+
name: OTelLib
308
377
value: cloudwatch-otel
309
378
-
310
379
name: apiName
@@ -317,7 +386,7 @@ an example:
317
386
namespace: {{metricNamespace}}
318
387
dimensions:
319
388
-
320
-
name: OTLib
389
+
name: OTelLib
321
390
value: cloudwatch-otel
322
391
-
323
392
name: apiName
@@ -328,7 +397,7 @@ an example:
328
397
```
329
398
330
399
331
-
## 2. Build Sample App
400
+
## 4. Build Sample App
332
401
333
402
For any testing suite related with sdk, you are required to build a sample app.
334
403
@@ -355,7 +424,7 @@ Environment Variable: There will be some env vars which will be set while runnin
355
424
356
425
* Keep “/” accessible with response code 200.: This “/” will be used for the load balancer health check.
357
426
358
-
## 3. configure the testing suite in github workflow
427
+
## 5. configure the testing suite in github workflow
359
428
360
429
below is an example in the aoc repo workflow, you can also configure it in your sdk repos.
0 commit comments