Skip to content

chore: add e2e lambda lifecycle test and workflow - #627

Merged
ava-silver merged 2 commits into
mainfrom
ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow
Nov 16, 2026
Merged

ava-silver merged 2 commits into
mainfrom
ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow

Conversation

@ava-silver

@ava-silver ava-silver commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds the Lambda lifecycle test and its CI job:

cdk lambda e2e
  validating credentials        # fail fast on missing AWS, Datadog, or secret config
  deploying the baseline function
  instrumenting the function    # cdk deploy with DatadogLambda (#626)
  verifying the deployed configuration  # layers, handler, runtime, DD_* env, tags
  invoking the function
  waiting for Datadog telemetry # spans and logs with service, env, version, and run ID
  checking CDK idempotence      # cdk diff --fail
  removing the function         # cdk destroy
  verifying cleanup             # function, log group, and stack are gone
  • Each phase logs START, a RUNNING heartbeat every 30 seconds, and DONE.
  • Uses the synced e2e/helpers for naming, retries, config checks, and telemetry matching. Retries cover only transient AWS errors.
  • Workflow: a changes job runs each suite only when its own paths change. The Lambda job runs on any src/** change, and the ECS job on src/ecs/**. Both skip forks. An in-progress run finishes instead of being cancelled, and the Lambda job has a 50-minute timeout.
  • Credentials: AWS through OIDC, and Datadog keys through dd-sts. The workflow writes the API key into the workload's secret before the suite runs.
  • Cleanup: the suite always attempts cdk destroy. A final if: always() step deletes the run's stack after a timeout or cancellation, and the shared sweeper deletes stale stacks that remain.

Motivation

Second half of SVLS-10087. It meets the acceptance bar on the E2E Tooling Testing Status page, matching the merged terraform-aws-lambda-datadog suite.

Testing Guidelines

Before: DatadogLambda changes merge without proof that instrumentation produces telemetry or tears down cleanly.
After: The E2E run passed the Lambda lifecycle in about 4 minutes. Config checks passed, spans and logs matched on service, env, version, and run ID, the diff was empty, and the cleanup checks passed. The ECS job also passed.

Additional Notes

  • Depends on ddoghq/serverless-ci#302, which adds the API key secret and the stack cleanup permissions. Both are already applied.
  • The cleanup step found nothing to delete in the passing run. An IAM policy simulation confirms that the role can delete one-e2e-cdk-lambda-* stacks and no others.

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

ava-silver commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

@ava-silver
ava-silver marked this pull request as ready for review June 26, 2026 21:54
@ava-silver
ava-silver requested review from a team as code owners June 26, 2026 21:54
@ava-silver
ava-silver requested a review from TalUsvyatsky June 26, 2026 21:54
@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow branch from 6c6b703 to 6f54462 Compare June 29, 2026 17:34
@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-cdk-lambda-fixture branch from f0c6f88 to 95acad5 Compare June 29, 2026 17:34
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 74833b0 | Docs | Give us feedback!

@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-cdk-lambda-fixture branch from 95acad5 to eefe03a Compare August 6, 2026 19:06
@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow branch from 6f54462 to 6a4e3d7 Compare August 6, 2026 19:06
@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow branch from ee496d7 to cd39275 Compare August 17, 2026 20:59
@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-cdk-lambda-fixture branch from eefe03a to a22a825 Compare August 17, 2026 20:59
@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow branch from cd39275 to 1aaded2 Compare November 13, 2026 22:31
@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-cdk-lambda-fixture branch from a22a825 to 378f072 Compare November 13, 2026 22:31
@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow branch 2 times, most recently from 590cb63 to d14e3e7 Compare November 13, 2026 23:17
Base automatically changed from ava.silver/chore/add-e2e-cdk-lambda-fixture to main November 16, 2026 16:29
@ava-silver
ava-silver force-pushed the ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow branch from d14e3e7 to 74833b0 Compare November 16, 2026 16:31
@ava-silver
ava-silver merged commit 18f801c into main Nov 16, 2026
11 of 12 checks passed
@ava-silver
ava-silver deleted the ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow branch November 16, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants