Skip to content

Commit adc7c8c

Browse files
committed
test(integration): make container tests pass + add baseline snapshots
Three fixes needed to get the container-image integration tests deploying and invoking against real AWS-stock RIC: - Container Dockerfiles previously installed only the datadog-lambda-js tarball, which doesn't pull dd-trace because it's a devDep of the package. Add dd-trace as a direct dependency in each container test's package.json, pinned to 5.105.0 to match the version yarn.lock resolves for the layer build. - Run `npm install --omit=dev` before installing the tarball so package.json deps are picked up. - Export BUILDX_NO_DEFAULT_ATTESTATIONS=1 in run_integration_tests.sh. Modern Docker buildx attaches provenance attestations by default, which produce OCI index manifests that AWS Lambda rejects with "image manifest ... media type ... not supported." Disabling the default attestations makes buildx emit Docker v2 manifests Lambda accepts. Plus baseline snapshots for `container-{cjs,esm}_node{18,20,22,24}` across 9 input events (72 return-value + 8 log files). Each container handler returns `{"message":"hello, dog!"}` end-to-end through `dist/handler.handler`, proving CJS and ESM user code load correctly on AWS-stock RIC for every supported Node major.
1 parent 45e0613 commit adc7c8c

85 files changed

Lines changed: 7813 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

integration_tests/container/cjs/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ FROM public.ecr.aws/lambda/nodejs:${NODE_VERSION}
33

44
COPY package.json handler.js ${LAMBDA_TASK_ROOT}/
55
COPY datadog-lambda-js-local.tgz /tmp/datadog-lambda-js-local.tgz
6-
RUN cd ${LAMBDA_TASK_ROOT} && npm install /tmp/datadog-lambda-js-local.tgz \
6+
RUN cd ${LAMBDA_TASK_ROOT} \
7+
&& npm install --omit=dev \
8+
&& npm install --no-save /tmp/datadog-lambda-js-local.tgz \
79
&& rm /tmp/datadog-lambda-js-local.tgz
810

911
CMD ["node_modules/datadog-lambda-js/dist/handler.handler"]
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"name": "container-cjs-test",
33
"version": "1.0.0",
4-
"private": true
4+
"private": true,
5+
"dependencies": {
6+
"dd-trace": "5.105.0"
7+
}
58
}

integration_tests/container/esm/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ FROM public.ecr.aws/lambda/nodejs:${NODE_VERSION}
33

44
COPY package.json handler.mjs ${LAMBDA_TASK_ROOT}/
55
COPY datadog-lambda-js-local.tgz /tmp/datadog-lambda-js-local.tgz
6-
RUN cd ${LAMBDA_TASK_ROOT} && npm install /tmp/datadog-lambda-js-local.tgz \
6+
RUN cd ${LAMBDA_TASK_ROOT} \
7+
&& npm install --omit=dev \
8+
&& npm install --no-save /tmp/datadog-lambda-js-local.tgz \
79
&& rm /tmp/datadog-lambda-js-local.tgz
810

911
CMD ["node_modules/datadog-lambda-js/dist/handler.handler"]

integration_tests/container/esm/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"name": "container-esm-test",
33
"version": "1.0.0",
44
"private": true,
5-
"type": "module"
5+
"type": "module",
6+
"dependencies": {
7+
"dd-trace": "5.105.0"
8+
}
69
}

0 commit comments

Comments
 (0)