Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d5d6835
Adding e2e test trigger
rithikanarayan Feb 2, 2026
ac3dec3
typo
rithikanarayan Feb 2, 2026
9ce6431
more typos
rithikanarayan Feb 2, 2026
fe832d6
another typo
rithikanarayan Feb 3, 2026
afe6cc7
reformat
rithikanarayan Feb 3, 2026
2f28943
typo
rithikanarayan Feb 3, 2026
eff51df
remove var
rithikanarayan Feb 3, 2026
3493c7c
remove arch
rithikanarayan Feb 3, 2026
0059055
remove status check
rithikanarayan Feb 3, 2026
25d5258
python test
rithikanarayan Feb 5, 2026
d79eea2
indent
rithikanarayan Feb 5, 2026
cff40c1
fix version
rithikanarayan Feb 5, 2026
6e5bb84
status
rithikanarayan Feb 5, 2026
2f2018c
fix gitlab api token
rithikanarayan Feb 9, 2026
2d01ec6
trying new image for polling job
rithikanarayan Feb 9, 2026
5884352
trying to add auth anywhere
rithikanarayan Feb 9, 2026
12da347
auth anywhere install?
rithikanarayan Feb 9, 2026
dbfd2b0
more auth
rithikanarayan Feb 10, 2026
c752b8a
no ddtool?
rithikanarayan Feb 10, 2026
a949af7
no brew
rithikanarayan Feb 10, 2026
0f5cbb1
remove authanywhere flag
rithikanarayan Feb 10, 2026
90bed39
debugging string indexing
rithikanarayan Feb 10, 2026
830ffcf
No auth?
rithikanarayan Feb 12, 2026
596f799
new audience
rithikanarayan Feb 13, 2026
004646c
mimic code-gen
rithikanarayan Feb 13, 2026
bdf978e
try using staging
rithikanarayan Feb 13, 2026
47c72db
try getting datadog-lambda-js token
rithikanarayan Feb 13, 2026
9a1d010
move script into separate file
rithikanarayan Feb 13, 2026
4f621f8
chmod
rithikanarayan Feb 13, 2026
746a9c3
/bin/authanywhere
rithikanarayan Feb 13, 2026
09c7a16
space
rithikanarayan Feb 13, 2026
62826d1
Removing debug prints
rithikanarayan Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .gitlab/input_files/build.yaml.tpl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -7,6 +9,7 @@ stages:
- test
- sign
- publish
- e2e

default:
retry:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -203,3 +208,27 @@ 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
{{- range (ds "runtimes").runtimes }}
{{- $version := print (.name | strings.Trim "node") }}
NODEJS_{{ $version }}_VERSION: "NODEJS_{{ $version }}_VERSION"
{{- end }}
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/scripts/poll_e2e.sh
45 changes: 45 additions & 0 deletions .gitlab/scripts/poll_e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
curl -OL "binaries.ddbuild.io/dd-source/authanywhere/LATEST/authanywhere-linux-amd64" && mv "authanywhere-linux-amd64" /bin/authanywhere && chmod +x /bin/authanywhere

/bin/authanywhere

BTI_CI_API_TOKEN=$(authanywhere --audience rapid-devex-ci)

BTI_RESPONSE=$(curl --silent --request GET \
--header "$BTI_CI_API_TOKEN" \
--header "Content-Type: application/vnd.api+json" \
"https://bti-ci-api.us1.ddbuild.io/internal/ci/gitlab/token?owner=DataDog&repository=datadog-lambda-js")

GITLAB_TOKEN=$(echo "$BTI_RESPONSE" | jq -r '.token // empty')

if [ -z "$GITLAB_TOKEN" ]; then
echo "Error: Failed to get GitLab token from BTI CI API. Response: $BTI_RESPONSE"
exit 1
fi

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_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
Loading