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: integration-tests/README.md
+22-78Lines changed: 22 additions & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,89 +13,22 @@ The general flow is:
13
13
For simplicity, integration tests are set up to only test against ARM runtimes and 4 runtimes (Python, Node, Java, and Dotnet).
14
14
15
15
16
-
## Test Suites
17
-
18
-
### Base Tests
19
-
20
-
The base test suite provides basic functionality tests across all supported Lambda runtimes. These tests verify core extension functionality without additional instrumentation.
21
-
22
-
**What it tests:**
23
-
- Extension can collect and forward logs to Datadog
24
-
- Extension generates and sends traces with proper span structure
25
-
- Extension detects cold starts correctly
26
-
27
-
**Test Coverage:**
28
-
- Lambda invocation succeeds (200 status code)
29
-
- "Hello world!" log message is sent to Datadog
30
-
- One trace is sent to Datadog
31
-
-`aws.lambda` span exists with correct properties including `cold_start: 'true'`
32
-
-`aws.lambda.cold_start` span is created
33
-
-`aws.lambda.load` span is created for Python and Node
34
-
35
-
### OTLP Tests
36
-
37
-
The OTLP test suite verifies OpenTelemetry Protocol (OTLP) integration with the Datadog Lambda Extension. These tests use Lambda functions instrumented with OpenTelemetry SDKs to ensure telemetry data flows correctly through the extension to Datadog.
38
-
39
-
**What it tests:**
40
-
- Lambda functions instrumented with OpenTelemetry SDKs can invoke successfully
41
-
- Traces are properly sent to Datadog via OTLP
42
-
- Spans contain correct structure and attributes
43
-
44
-
**Test Coverage:**
45
-
- Lambda invocation succeeds (200 status code)
46
-
- At least one trace is sent to Datadog
47
-
- Trace contains valid spans with proper structure
4.**Update pipeline**: Add suite name to `.gitlab/templates/pipeline.yaml.tpl`:
84
-
```yaml
85
-
parallel:
86
-
matrix:
87
-
- TEST_SUITE: [base, otlp, <suite-name>]
88
-
```
89
-
90
-
## Guidelines
91
-
92
-
### Naming
93
-
* An `identifier` is used to differentiate the different stacks. For local development, the identifier is automatically set using the command `whoami` and parses the user's first name. For gitlab pipelines, the identifier is the git commit short sha.
94
-
* Stacks should be named `integ-<identifier>-<stack name>`
95
-
* Lambda functions should be named `<stack-id>-<function name>`
96
-
97
-
### Stacks
98
-
* Stacks automatically get destroyed at the end of the gitlab integration tests step. Stack should be setup to not retain resources. A helper function `createLogGroup` exists with `removalPolicy: cdk.RemovalPolicy.DESTROY`.
31
+
4.**Update pipeline**: Add suite name to `.gitlab/datasources/test-suites.yaml`:
99
32
100
33
101
34
## Local Development
@@ -140,7 +73,6 @@ This creates `integ-<your-name>-<stack-name>` and automatically:
140
73
```bash
141
74
# Deploy base test stack
142
75
./scripts/local_deploy.sh base
143
-
144
76
```
145
77
146
78
#### 3. Run Integration Tests
@@ -153,7 +85,19 @@ npm test
153
85
154
86
# Run specific test file
155
87
npm test -- base.test.ts
156
-
157
88
```
158
89
159
90
**Note**: Tests wait several minutes after Lambda invocation to allow telemetry to propagate to Datadog.
91
+
92
+
93
+
## Guidelines
94
+
95
+
### Naming
96
+
* An `identifier` is used to differentiate the different stacks. For local development, the identifier is automatically set using the command `whoami` and parses the user's first name. For gitlab pipelines, the identifier is the git commit short sha.
97
+
* Stacks should be named `integ-<identifier>-<stack name>`
98
+
* Lambda functions should be named `<stack-id>-<function name>`
99
+
100
+
### Stacks
101
+
* Stacks automatically get destroyed at the end of the gitlab integration tests step.
102
+
* Stacks should be setup to not retain resources. A helper function `createLogGroup` exists with `removalPolicy: cdk.RemovalPolicy.DESTROY`.
103
+
* Stacks should include the tag `extension_integration_test: true`. This gets added in `app.ts`. This lets us easily run scripts to clean up old stacks in case the cleanup step was missed.
0 commit comments