Skip to content

Commit cdc72b2

Browse files
authored
ci(system-tests): run serverless system-tests (#15481)
## Description Run datadog-lambda-python system tests in the pipeline of dd-trace-py, to catch changes that would break features inside datadog_lambda early. ## Testing - The system-tests are running in this PR ## Risks ## Additional Notes - This is intended to catch breaking changes at the datadog_lambda <-> ddtrace interface like the one that was introduced in AppSec here: https://github.com/DataDog/dd-trace-py/pull/15042/files#diff-efac5b595a0c43d4ade778f837bb25ed57dc56cba3489358a36edc58b38b0021R330
1 parent fa9501c commit cdc72b2

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

.github/workflows/system-tests.yml

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,57 @@ jobs:
310310
name: logs_parametric
311311
path: artifact.tar.gz
312312

313+
serverless-system-tests-build-layer:
314+
runs-on: ubuntu-latest
315+
needs: [build-wheels]
316+
steps:
317+
- name: Checkout datadog-lambda-python
318+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
319+
with:
320+
persist-credentials: false
321+
repository: "DataDog/datadog-lambda-python"
322+
323+
- name: Download wheel to binaries directory
324+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
325+
with:
326+
name: wheels-cp313-manylinux_x86_64
327+
path: artifacts/
328+
329+
- name: Build datadog_lambda layer
330+
run: |
331+
wheel_path=$(find ./artifacts -name "*.whl" | head -n 1)
332+
sed -i 's|^ddtrace =.*$|ddtrace = { file = "'"$wheel_path"'" }|' pyproject.toml
333+
ARCH=amd64 PYTHON_VERSION=3.13 ./scripts/build_layers.sh
334+
335+
- name: Upload layer artifact
336+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
337+
with:
338+
path: .layers/datadog_lambda_py-amd64-3.13.zip
339+
name: serverless_system_tests_binaries
340+
341+
serverless-system-tests:
342+
needs: [serverless-system-tests-build-layer]
343+
# Automatically managed, use scripts/update-system-tests-version to update
344+
uses: DataDog/system-tests/.github/workflows/system-tests.yml@2eb26336ed43c2db1b7f90fff17ce4f5fc36a12b
345+
secrets: inherit
346+
permissions:
347+
contents: read
348+
packages: write
349+
with:
350+
library: python_lambda
351+
binaries_artifact: serverless_system_tests_binaries
352+
scenarios_groups: lambda_end_to_end
353+
skip_empty_scenarios: true
354+
313355
finished:
314356
name: system-tests finished
315357
runs-on: ubuntu-latest
316-
needs: [parametric, system-tests]
358+
needs: [parametric, system-tests, serverless-system-tests]
317359
if: success() || failure()
318360
steps:
319361
- name: True when everything else succeeded
320-
if: needs.parametric.result == 'success' && needs.system-tests.result == 'success'
362+
if: needs.parametric.result == 'success' && needs.system-tests.result == 'success' && needs.serverless-system-tests.result == 'success'
321363
run: exit 0
322364
- name: Fails if anything else failed
323-
if: needs.parametric.result != 'success' || needs.system-tests.result != 'success'
324-
run: exit 1
365+
if: needs.parametric.result != 'success' || needs.system-tests.result != 'success' || needs.serverless-system-tests.result != 'success'
366+
run: exit 1

scripts/update-system-tests-version.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def update_system_tests_version(latest_version: str):
4848
lines[i] = f"{pre}: '{latest_version}'"
4949
update_ref = False
5050

51+
if lines[i] == f" uses: DataDog/system-tests/.github/workflows/system-tests.yml@{current_version}":
52+
lines[i] = f" uses: DataDog/system-tests/.github/workflows/system-tests.yml@{latest_version}"
53+
5154
with open(system_tests_workflows_path, "w") as file:
5255
file.write("\n".join(lines))
5356

0 commit comments

Comments
 (0)