Skip to content

[SVLS-7939] Add Lambda E2E tests#2333

Merged
ava-silver merged 9 commits into
masterfrom
tal.usvyatsky/datadog-ci-lambda-e2e-tests
Jun 22, 2026
Merged

[SVLS-7939] Add Lambda E2E tests#2333
ava-silver merged 9 commits into
masterfrom
tal.usvyatsky/datadog-ci-lambda-e2e-tests

Conversation

@TalUsvyatsky

@TalUsvyatsky TalUsvyatsky commented May 22, 2026

Copy link
Copy Markdown
Contributor

What and why?

Adds real AWS Lambda e2e coverage for datadog-ci lambda instrument and datadog-ci lambda uninstrument. The tests are gated in CI, target eu-central-1, and use the nodejs24.x runtime.

Stacked on #2369 (shared telemetry checker).

How?

  • Adds a Lambda e2e test that creates a temporary one-e2e-ci-lambda-* function with the AWS CLI, instruments it, verifies the AWS configuration, invokes it and asserts telemetry flows, re-instruments and asserts idempotency (exactly one of each Datadog layer), uninstruments, verifies cleanup, and deletes it.
  • Adds a Lambda verifier for the Datadog Node/Extension layers, handler restoration, Datadog env vars, and the dd_sls_ci tag.
  • Asserts telemetry identity (service + env + version) via the shared telemetry checker rather than mere existence; the unique per-run function name doubles as the run-id marker.
  • Updates GitHub Actions with a Lambda path filter, conditional AWS OIDC auth, Lambda e2e env vars, and Windows/standalone skips.
  • Allows quoted values in e2e/.env.local, matching the local e2e docs.
  • Adds CODEOWNERS coverage for the new Lambda e2e files.

Test plan

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

@datadog-datadog-prod-us1-2

This comment has been minimized.

@TalUsvyatsky TalUsvyatsky added the serverless Related to [aas, cloud-run, lambda, stepfunctions] label May 22, 2026
@TalUsvyatsky
TalUsvyatsky force-pushed the tal.usvyatsky/datadog-ci-lambda-e2e-tests branch from 1d8b6d7 to 1aa9a92 Compare May 22, 2026 19:21
@TalUsvyatsky
TalUsvyatsky marked this pull request as ready for review June 5, 2026 19:43
@TalUsvyatsky
TalUsvyatsky requested review from a team as code owners June 5, 2026 19:43
@urseberry urseberry self-assigned this Jun 5, 2026
Comment thread e2e/fixtures/lambda/README.md Outdated
Comment thread e2e/fixtures/lambda/README.md Outdated
Comment thread e2e/fixtures/lambda/README.md Outdated
@ava-silver
ava-silver force-pushed the tal.usvyatsky/datadog-ci-lambda-e2e-tests branch from 2e0551c to a6a4df0 Compare June 15, 2026 19:37

ava-silver commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@ava-silver
ava-silver force-pushed the tal.usvyatsky/datadog-ci-lambda-e2e-tests branch from a6a4df0 to 4bfe122 Compare June 15, 2026 21:37
@ava-silver
ava-silver force-pushed the tal.usvyatsky/datadog-ci-lambda-e2e-tests branch 2 times, most recently from 6b6d4c9 to bcf57a2 Compare June 17, 2026 17:54
@ava-silver
ava-silver changed the base branch from master to graphite-base/2333 June 17, 2026 18:23
@ava-silver
ava-silver force-pushed the tal.usvyatsky/datadog-ci-lambda-e2e-tests branch from bcf57a2 to 7e54ba0 Compare June 17, 2026 18:23
@ava-silver
ava-silver changed the base branch from graphite-base/2333 to ava.silver/chore/shared-e2e-telemetry-checker June 17, 2026 18:23
@ava-silver ava-silver added the chores Related to the CI or developer experience label Jun 17, 2026 — with Graphite App
@ava-silver
ava-silver force-pushed the tal.usvyatsky/datadog-ci-lambda-e2e-tests branch 2 times, most recently from 61bbd3b to b097b38 Compare June 17, 2026 20:45
@ava-silver
ava-silver force-pushed the ava.silver/chore/shared-e2e-telemetry-checker branch from 8cbadb2 to 83da7dd Compare June 17, 2026 20:45
@ava-silver
ava-silver dismissed urseberry’s stale review June 17, 2026 21:09

ursula left datadog :(

Comment thread e2e/helpers/lambda-verifier.ts
Comment thread e2e/lambda.test.ts Outdated
Comment thread e2e/helpers/lambda-verifier.ts
Comment thread e2e/lambda.test.ts
@ava-silver
ava-silver force-pushed the tal.usvyatsky/datadog-ci-lambda-e2e-tests branch from b097b38 to 957856e Compare June 18, 2026 22:33
@ava-silver
ava-silver requested a review from avangelillo June 22, 2026 15:04
Comment thread e2e/helpers/lambda-verifier.ts
Base automatically changed from ava.silver/chore/shared-e2e-telemetry-checker to master June 22, 2026 15:25
@ava-silver
ava-silver requested a review from a team as a code owner June 22, 2026 15:25
@ava-silver
ava-silver force-pushed the tal.usvyatsky/datadog-ci-lambda-e2e-tests branch from 34e1df8 to 9ed1b16 Compare June 22, 2026 15:26
@ava-silver
ava-silver merged commit ba7805a into master Jun 22, 2026
124 of 127 checks passed
@ava-silver
ava-silver deleted the tal.usvyatsky/datadog-ci-lambda-e2e-tests branch June 22, 2026 16:27
ava-silver added a commit that referenced this pull request Jun 22, 2026
…#2370)

### What and why?

Re-running `instrument` on a serverless-init sidecar target (Azure Container App) must be a true no-op. Previously a re-instrument could drop provider-populated sidecar fields (e.g. `resources`) and re-append the shared volume mount, producing config drift. This makes the sidecar merge idempotent and enables APM on the Container App sidecar.

Split out from the Container App e2e PR (#2364) so the production behavior change is reviewed on its own. Stacked on #2333.

### How?

- `packages/base/src/helpers/serverless/common.ts`: when a sidecar container already exists, merge the new config **onto** it -- preserving existing `resources` and env vars, and deduping the shared volume mount via a new `ensureSharedVolumeMount` helper -- instead of replacing it wholesale.
- `packages/plugin-container-app/src/common.ts`: set `DD_APM_ENABLED=true` so the sidecar enables APM.
- Updates the affected unit tests and the instrument snapshot.

### Test plan

- `yarn test` for `packages/base` serverless helpers and `packages/plugin-container-app` (60 tests pass).
- End-to-end idempotency is asserted by the Container App e2e suite in #2364.

### Review checklist

- [x] Feature or bugfix MUST have appropriate tests (unit, integration)
@ava-silver ava-silver mentioned this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chores Related to the CI or developer experience serverless Related to [aas, cloud-run, lambda, stepfunctions]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants