From d5d68358a976e428fe36451a1b24cd2c73bd7ae5 Mon Sep 17 00:00:00 2001 From: Rithika Narayan Date: Mon, 2 Feb 2026 13:43:26 -0500 Subject: [PATCH 1/9] Adding e2e test trigger --- .gitlab/input_files/build.yaml.tpl | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index 737d746e..7c1f9c06 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -1,3 +1,5 @@ +{{- $e2e_region := "us-west-2" -}} + variables: CI_DOCKER_TARGET_IMAGE: registry.ddbuild.io/ci/datadog-lambda-js CI_DOCKER_TARGET_VERSION: latest @@ -7,6 +9,7 @@ stages: - test - sign - publish + - e2e default: retry: @@ -126,6 +129,8 @@ publish layer {{ $environment.name }} ({{ $runtime.name }}): tags: ["arch:amd64"] image: ${CI_DOCKER_TARGET_IMAGE}:${CI_DOCKER_TARGET_VERSION} rules: + - if: '"{{ $environment_name }}" == "sandbox" && $REGION == "{{ $e2e_region }}"' + when: on_success - if: '"{{ $environment.name }}" =~ /^(sandbox|staging)/' when: manual allow_failure: true @@ -203,3 +208,56 @@ publish npm package: - mkdir -p datadog_lambda_js-{{ if eq $environment.name "prod"}}signed-{{ end }}bundle-${CI_JOB_ID} - cp .layers/datadog_lambda_node*.zip datadog_lambda_js-{{ if eq $environment.name "prod"}}signed-{{ end }}bundle-${CI_JOB_ID} {{ end }} + +e2e-test: + stage: e2e + trigger: + project: DataDog/serverless-e2e-tests + strategy: depend + variables: + LANGUAGES_SUBSET: node + # These env vars are inherited from the dotenv reports of the publish-layer jobs + {{- range (ds "runtimes").runtimes }} + {{- if eq .arch "amd64" }} + {{- $runtime.node_version := print (.name | strings.Trim "node") }} + NODEJS_{{ $runtime.node_version }}_VERSION: $NODEJS_{{ $runtime.node_version }}_VERSION + {{- end }} + {{- end }} + needs: {{ range (ds "runtimes").runtimes }} + {{- if eq .arch "amd64" }} + - "publish-layer-sandbox ({{ .name }}): [{{ $e2e_region }}]" + {{- end }} + {{- end }} + +e2e-test-status: + stage: e2e + image: registry.ddbuild.io/images/docker:20.10-py3 + tags: ["arch:amd64"] + timeout: 3h + script: | + GITLAB_API_TOKEN=$(aws ssm get-parameter --region us-east-1 --name "ci.${CI_PROJECT_NAME}.serverless-e2e-gitlab-token" --with-decryption --query "Parameter.Value" --out text) + URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/bridges" + echo "Fetching E2E job status from: $URL" + while true; do + RESPONSE=$(curl -s --header "PRIVATE-TOKEN: ${GITLAB_API_TOKEN}" "$URL") + E2E_JOB_STATUS=$(echo "$RESPONSE" | jq -r '.[] | select(.name=="e2e-test") | .downstream_pipeline.status') + echo -n "E2E job status: $E2E_JOB_STATUS, " + if [ "$E2E_JOB_STATUS" == "success" ]; then + echo "✅ E2E tests completed successfully" + exit 0 + elif [ "$E2E_JOB_STATUS" == "failed" ]; then + echo "❌ E2E tests failed" + exit 1 + elif [ "$E2E_JOB_STATUS" == "running" ]; then + echo "⏳ E2E tests are still running, retrying in 1 minute..." + elif [ "$E2E_JOB_STATUS" == "canceled" ]; then + echo "🚫 E2E tests were canceled" + exit 1 + elif [ "$E2E_JOB_STATUS" == "skipped" ]; then + echo "⏭️ E2E tests were skipped" + exit 0 + else + echo "❓ Unknown E2E test status: $E2E_JOB_STATUS, retrying in 1 minute..." + fi + sleep 60 + done From ac3dec3d7328a30d3505072cc72390c00c703706 Mon Sep 17 00:00:00 2001 From: Rithika Narayan Date: Mon, 2 Feb 2026 13:47:17 -0500 Subject: [PATCH 2/9] typo --- .gitlab/input_files/build.yaml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index 7c1f9c06..af32a614 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -129,7 +129,7 @@ publish layer {{ $environment.name }} ({{ $runtime.name }}): tags: ["arch:amd64"] image: ${CI_DOCKER_TARGET_IMAGE}:${CI_DOCKER_TARGET_VERSION} rules: - - if: '"{{ $environment_name }}" == "sandbox" && $REGION == "{{ $e2e_region }}"' + - if: '"{{ $environment.name }}" == "sandbox" && $REGION == "{{ $e2e_region }}"' when: on_success - if: '"{{ $environment.name }}" =~ /^(sandbox|staging)/' when: manual From 9ce643176749f909b762fba9af73b276f2884a5d Mon Sep 17 00:00:00 2001 From: Rithika Narayan Date: Mon, 2 Feb 2026 13:56:11 -0500 Subject: [PATCH 3/9] more typos --- .gitlab/input_files/build.yaml.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index af32a614..0d62466c 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -217,7 +217,7 @@ e2e-test: variables: LANGUAGES_SUBSET: node # These env vars are inherited from the dotenv reports of the publish-layer jobs - {{- range (ds "runtimes").runtimes }} + {{- range $runtime := (ds "runtimes").runtimes }} {{- if eq .arch "amd64" }} {{- $runtime.node_version := print (.name | strings.Trim "node") }} NODEJS_{{ $runtime.node_version }}_VERSION: $NODEJS_{{ $runtime.node_version }}_VERSION @@ -225,7 +225,7 @@ e2e-test: {{- end }} needs: {{ range (ds "runtimes").runtimes }} {{- if eq .arch "amd64" }} - - "publish-layer-sandbox ({{ .name }}): [{{ $e2e_region }}]" + - "publish-layer-sandbox ({{ $environment.name }}): [{{ $e2e_region }}]" {{- end }} {{- end }} From fe832d617f1b3f0add2202e4b26b6f0a985e6340 Mon Sep 17 00:00:00 2001 From: Rithika Narayan Date: Tue, 3 Feb 2026 15:10:24 -0500 Subject: [PATCH 4/9] another typo --- .gitlab/input_files/build.yaml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index 0d62466c..c4975480 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -217,7 +217,7 @@ e2e-test: variables: LANGUAGES_SUBSET: node # These env vars are inherited from the dotenv reports of the publish-layer jobs - {{- range $runtime := (ds "runtimes").runtimes }} + {{ range $runtime := (ds "runtimes").runtimes }} {{- if eq .arch "amd64" }} {{- $runtime.node_version := print (.name | strings.Trim "node") }} NODEJS_{{ $runtime.node_version }}_VERSION: $NODEJS_{{ $runtime.node_version }}_VERSION From afe6cc77f013c74b397832220a96e6769c3db6b4 Mon Sep 17 00:00:00 2001 From: Rithika Narayan Date: Tue, 3 Feb 2026 15:52:03 -0500 Subject: [PATCH 5/9] reformat --- .gitlab/input_files/build.yaml.tpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index c4975480..12016828 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -215,17 +215,17 @@ e2e-test: project: DataDog/serverless-e2e-tests strategy: depend variables: - LANGUAGES_SUBSET: node - # These env vars are inherited from the dotenv reports of the publish-layer jobs - {{ range $runtime := (ds "runtimes").runtimes }} + LANGUAGES_SUBSET: node + # These env vars are inherited from the dotenv reports of the publish-layer jobs + {{- range (ds "runtimes").runtimes }} {{- if eq .arch "amd64" }} {{- $runtime.node_version := print (.name | strings.Trim "node") }} - NODEJS_{{ $runtime.node_version }}_VERSION: $NODEJS_{{ $runtime.node_version }}_VERSION + NODEJS_{{ .node_version }}_VERSION: $NODEJS_{{ .node_version }}_VERSION {{- end }} {{- end }} needs: {{ range (ds "runtimes").runtimes }} {{- if eq .arch "amd64" }} - - "publish-layer-sandbox ({{ $environment.name }}): [{{ $e2e_region }}]" + - "publish layer sandbox ({{ .name }}): [{{ $e2e_region }}]" {{- end }} {{- end }} From 2f28943a005b7f68dc151384b6891b5f0fe6f854 Mon Sep 17 00:00:00 2001 From: Rithika Narayan Date: Tue, 3 Feb 2026 15:53:32 -0500 Subject: [PATCH 6/9] typo --- .gitlab/input_files/build.yaml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index 12016828..2d478b9d 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -219,7 +219,7 @@ e2e-test: # These env vars are inherited from the dotenv reports of the publish-layer jobs {{- range (ds "runtimes").runtimes }} {{- if eq .arch "amd64" }} - {{- $runtime.node_version := print (.name | strings.Trim "node") }} + {{- .node_version := print (.name | strings.Trim "node") }} NODEJS_{{ .node_version }}_VERSION: $NODEJS_{{ .node_version }}_VERSION {{- end }} {{- end }} From eff51df6ed783ca44b39ed267050b3d88556ec80 Mon Sep 17 00:00:00 2001 From: Rithika Narayan Date: Tue, 3 Feb 2026 15:56:23 -0500 Subject: [PATCH 7/9] remove var --- .gitlab/input_files/build.yaml.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index 2d478b9d..35649393 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -219,7 +219,6 @@ e2e-test: # These env vars are inherited from the dotenv reports of the publish-layer jobs {{- range (ds "runtimes").runtimes }} {{- if eq .arch "amd64" }} - {{- .node_version := print (.name | strings.Trim "node") }} NODEJS_{{ .node_version }}_VERSION: $NODEJS_{{ .node_version }}_VERSION {{- end }} {{- end }} From 3493c7c93d2dc31c406efd2521105b299aa80ac5 Mon Sep 17 00:00:00 2001 From: Rithika Narayan Date: Tue, 3 Feb 2026 16:38:12 -0500 Subject: [PATCH 8/9] remove arch --- .gitlab/input_files/build.yaml.tpl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index 35649393..f47a7776 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -218,15 +218,11 @@ e2e-test: LANGUAGES_SUBSET: node # These env vars are inherited from the dotenv reports of the publish-layer jobs {{- range (ds "runtimes").runtimes }} - {{- if eq .arch "amd64" }} NODEJS_{{ .node_version }}_VERSION: $NODEJS_{{ .node_version }}_VERSION {{- end }} - {{- end }} needs: {{ range (ds "runtimes").runtimes }} - {{- if eq .arch "amd64" }} - "publish layer sandbox ({{ .name }}): [{{ $e2e_region }}]" {{- end }} - {{- end }} e2e-test-status: stage: e2e From 00590559535fd5135e6313b2c994621e04056824 Mon Sep 17 00:00:00 2001 From: Rithika Narayan Date: Tue, 3 Feb 2026 17:09:16 -0500 Subject: [PATCH 9/9] remove status check --- .gitlab/input_files/build.yaml.tpl | 33 ------------------------------ 1 file changed, 33 deletions(-) diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index f47a7776..972da4e8 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -223,36 +223,3 @@ e2e-test: needs: {{ range (ds "runtimes").runtimes }} - "publish layer sandbox ({{ .name }}): [{{ $e2e_region }}]" {{- end }} - -e2e-test-status: - stage: e2e - image: registry.ddbuild.io/images/docker:20.10-py3 - tags: ["arch:amd64"] - timeout: 3h - script: | - GITLAB_API_TOKEN=$(aws ssm get-parameter --region us-east-1 --name "ci.${CI_PROJECT_NAME}.serverless-e2e-gitlab-token" --with-decryption --query "Parameter.Value" --out text) - URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/bridges" - echo "Fetching E2E job status from: $URL" - while true; do - RESPONSE=$(curl -s --header "PRIVATE-TOKEN: ${GITLAB_API_TOKEN}" "$URL") - E2E_JOB_STATUS=$(echo "$RESPONSE" | jq -r '.[] | select(.name=="e2e-test") | .downstream_pipeline.status') - echo -n "E2E job status: $E2E_JOB_STATUS, " - if [ "$E2E_JOB_STATUS" == "success" ]; then - echo "✅ E2E tests completed successfully" - exit 0 - elif [ "$E2E_JOB_STATUS" == "failed" ]; then - echo "❌ E2E tests failed" - exit 1 - elif [ "$E2E_JOB_STATUS" == "running" ]; then - echo "⏳ E2E tests are still running, retrying in 1 minute..." - elif [ "$E2E_JOB_STATUS" == "canceled" ]; then - echo "🚫 E2E tests were canceled" - exit 1 - elif [ "$E2E_JOB_STATUS" == "skipped" ]; then - echo "⏭️ E2E tests were skipped" - exit 0 - else - echo "❓ Unknown E2E test status: $E2E_JOB_STATUS, retrying in 1 minute..." - fi - sleep 60 - done