chore: add e2e lambda lifecycle test and workflow#627
Open
ava-silver wants to merge 1 commit into
Open
Conversation
This was referenced Jun 26, 2026
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
maycmlee
approved these changes
Jun 29, 2026
ava-silver
force-pushed
the
ava.silver/chore/add-e2e-lambda-lifecycle-test-and-workflow
branch
from
June 29, 2026 17:34
6c6b703 to
6f54462
Compare
ava-silver
force-pushed
the
ava.silver/chore/add-e2e-cdk-lambda-fixture
branch
from
June 29, 2026 17:34
f0c6f88 to
95acad5
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Adds the end-to-end instrumentation lifecycle test for the
DatadogLambdaconstruct on AWS Lambda, plus its config, README, and CI workflow.lambda.test.tsdrives one CDK stack -- the same physical function throughout -- through the full contract:DD_*env, identifying tags).lambda invoke, then poll the Datadog API until spans and logs carrying the run identity (service/env/version/run id) appear.cdk diff --fail; assert no diff.cdk destroy; assert the function no longer exists.e2e.config.tsandversions.tshold the repo-specific bits: pinned versions, expected layer ARNs, the env/tag contract, and AWS retry patterns. Generic polling and verification come from the shared helpers.Infrastructure
The "tool under test" is the construct itself (
src/), bundled into the CDK app -- not a published package -- so a failure blames the construct. Each run deploys one CloudFormation stack holding a single Lambda; theE2E_INSTRUMENTflag toggles whether the app applies the construct.The Datadog API key is passed inline to the construct at deploy and surfaces as
DD_API_KEYon the function; CI mints it so the workload ships to the org the suite queries. Teardown always runscdk destroy; the cross-repo sweeper reclaims anything leaked by cancelled CI.The app is bundled to a single CJS file with esbuild (the repo's TS toolchain is incompatible with ts-node) and run with plain node.
Motivation
Gives the construct a real instrumentation lifecycle test against live AWS + Datadog, so a regression in layer pinning, handler redirect, env wiring, or telemetry flow fails CI.
Testing Guidelines
.github/workflows/e2e.ymlruns the suite behind path filters. AWS creds come from OIDC, Datadog creds from dd-sts -- no long-lived secrets, and a missing credential fails loudly rather than skipping green.Ran the full suite end-to-end locally against the serverless sandbox -- all phases plus teardown pass.
Additional Notes
package.json/yarn.lock/.projen/*churn is projen-generated from the.projenrc.jsedit (adds vitest, the Datadog API client, and thetest:e2etask).Types of Changes
Check all that apply