Skip to content

Commit 28147e1

Browse files
committed
Merge main into Node.js agentless configuration tests
# Conflicts: # manifests/nodejs.yml
2 parents e7d60b1 + 0e6ecde commit 28147e1

73 files changed

Lines changed: 1756 additions & 282 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.

.github/actions/get_target_branch/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ runs:
3333
)
3434
libs = result.stdout.strip().split("|")
3535
libs.append("agent")
36+
libs.append("auto_inject")
3637
3738
text = os.environ["INPUTS_TEXT"]
3839
pattern = re.compile(r"\[([^@\]]+)@([^\]]+)\]", re.IGNORECASE)

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,13 @@ jobs:
116116
# initial-delay-seconds: '300' Don't need this, as the job is executed after system tests
117117
polling-interval-seconds: '60'
118118
max-retries: '120'
119-
# Ignore gitlab jobs that are not K8S_LIB* (K8s lib injection) or *DOC (docker ssi) or *DO5A (docker ssi crashtracking)
119+
# Ignore gitlab jobs that are not K8S_LIB* (K8s lib injection),
120+
# system_tests_run_pipeline_[0-2], *DOC (docker ssi), or *DO5A
121+
# (docker ssi crashtracking).
120122
# https://regex101.com/r/Bo5Kpn/1
121123
# Also ignore the job that waits for the tests to succeed before adding
122124
# to the merge queue.
123125

124126
ignored-name-patterns: |
125-
dd-gitlab/(?!K8S_LIB).*$(?<!DOC)(?<!DO5A)
127+
dd-gitlab/(?!(?:K8S_LIB|system_tests_run_pipeline_[0-2]$)).*$(?<!DOC)(?<!DO5A)
126128
devflow/merge

.github/workflows/compute-workflow-parameters.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,18 @@ jobs:
172172
173173
library_branch = ""
174174
agent_branch = ""
175+
auto_inject_branch = ""
175176
176177
if branch_map_str:
177178
branch_map = json.loads(branch_map_str)
178179
library_branch = branch_map.get(library, "")
179180
agent_branch = branch_map.get("agent", "")
181+
auto_inject_branch = branch_map.get("auto_inject", "")
180182
181183
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
182184
f.write(f"library_branch={library_branch}\n")
183185
f.write(f"agent_branch={agent_branch}\n")
186+
f.write(f"auto_inject_branch={auto_inject_branch}\n")
184187
env:
185188
TARGET_BRANCH_MAP: ${{ inputs._system_tests_library_target_branch_map }}
186189
LIBRARY: ${{ inputs.library }}
@@ -193,6 +196,7 @@ jobs:
193196
env:
194197
LIBRARY_TARGET_BRANCH: "${{ steps.extract_branch.outputs.library_branch }}"
195198
AGENT_TARGET_BRANCH: "${{ steps.extract_branch.outputs.agent_branch }}"
199+
AUTO_INJECT_TARGET_BRANCH: "${{ steps.extract_branch.outputs.auto_inject_branch }}"
196200
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197201

198202
- name: Upload artifact

.github/workflows/nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5151
with:
5252
persist-credentials: false
53-
- uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
53+
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
5454
- name: Print python version
5555
run: |
5656
nix develop --command which python

.gitlab-ci.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ stages:
2020

2121
variables:
2222
TEST: 1
23-
# TEMPORARY: rollout-control allowlist for system-tests-param LIBRARIES filter.
24-
E2E_SUPPORTED_LANGUAGES: "python"
2523
# dd-repo-tools mirror_images.py (pinned). Used by the mirror_images_* jobs.
2624
MIRROR_IMAGES_URL: "https://binaries.ddbuild.io/dd-repo-tools/default/ca/385a670d8fafd57f8c3c9872823aa8dcd65b53cc/mirror_images.py"
2725
# Destination registry for mirrored CI images.
@@ -352,26 +350,6 @@ system_tests_param:
352350
elif key == 'scenarios_groups': print('export SCENARIO_GROUPS=' + shlex.quote(str(val)))
353351
" > set_vars.sh
354352
source set_vars.sh
355-
- |
356-
if [ "$CI_COMMIT_BRANCH" != "main" ] || [ "$CI_PIPELINE_SOURCE" = "schedule" ]; then
357-
export LIBRARIES=""
358-
fi
359-
# TEMPORARY: filter LIBRARIES via E2E_SUPPORTED_LANGUAGES (space-separated allowlist)
360-
# used to control rollout, to be removed once rollout is complete.
361-
- |
362-
if [ -n "${E2E_SUPPORTED_LANGUAGES:-}" ]; then
363-
echo "Filtering LIBRARIES with E2E_SUPPORTED_LANGUAGES='$E2E_SUPPORTED_LANGUAGES'"
364-
filtered=""
365-
for lib in $LIBRARIES; do
366-
for allowed in $E2E_SUPPORTED_LANGUAGES; do
367-
if [ "$lib" = "$allowed" ]; then
368-
filtered="${filtered:+$filtered }$lib"
369-
break
370-
fi
371-
done
372-
done
373-
export LIBRARIES="$filtered"
374-
fi
375353
- export EXCLUDED_SCENARIOS='DEBUGGER_EXPRESSION_LANGUAGE,APM_TRACING_E2E_SINGLE_SPAN,APM_TRACING_E2E_OTEL,OTEL_COLLECTOR_E2E'
376354
- export SYSTEM_TESTS_PUSH_TO_TEST_OPTIMIZATION=true
377355

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Having trouble? Reach out on slack: [#apm-shared-testing](https://dd.enterprise.slack.com/archives/C025TJ4RZ8X)
44

5-
System-tests is a black-box testing workbench for Datadog tracer libraries. It runs the **same tests** against every tracer implementation -- Java, Node.js, Python, PHP, Ruby, C++, .NET, Go, and Rust -- so shared features stay consistent across languages.
5+
System-tests is a black-box testing workbench for Datadog tracer libraries. It runs the **same tests** against every tracer implementation -- Java, Node.js, Python, PHP, Ruby, C, C++, .NET, Go, and Rust -- so shared features stay consistent across languages.
66

77
Key principles:
88

@@ -15,7 +15,7 @@ You need **bash**, **Docker** (20.10+), and **Python 3.12**.
1515

1616
```bash
1717
# 1. Build images for the language you want to test
18-
./build.sh python # or: java, nodejs, ruby, php, dotnet, golang
18+
./build.sh python # or: c, java, nodejs, ruby, php, dotnet, golang
1919

2020
# 2. Run the tests
2121
./run.sh # run all default tests

build.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@ set -eu
33

44
ATTEMPT=${SYSTEM_TEST_BUILD_ATTEMPTS:=1}
55
BUILD_TIMEOUT=${SYSTEM_TEST_BUILD_TIMEOUT:=600} # Default 10 minutes per attempt
6+
TIMEOUT_COMMAND=$(command -v timeout || command -v gtimeout || true)
67

78
for (( i=1; i<=$ATTEMPT; i++ ))
89
do
910
echo "== Run build script (attempt $i on $ATTEMPT) with timeout ${BUILD_TIMEOUT}s =="
1011

1112
# Temporarily disable exit on error to capture the exit code
1213
set +e
13-
timeout "$BUILD_TIMEOUT" ./utils/build/build.sh "$@"
14+
if [[ -n "$TIMEOUT_COMMAND" ]]; then
15+
"$TIMEOUT_COMMAND" "$BUILD_TIMEOUT" ./utils/build/build.sh "$@"
16+
else
17+
echo "No timeout command found; running the build without a per-attempt timeout"
18+
./utils/build/build.sh "$@"
19+
fi
1420
exit_code=$?
1521
set -e
1622

docs/CI/system-tests-ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## CI Workflow: Github Actions
22

3-
Our System-tests repository is fully integrated with Github Actions, which helps us build, execute and report tests results automatically.
3+
Our System-tests repository uses GitHub Actions to build, execute, and report most test results automatically. Native C end-to-end coverage runs in GitLab CI on DinD runners.
44

55
The System-tests repository contains **one main workflow**: `ci.yml`. It is triggered in these cases:
66

docs/edit/manifest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ When executed locally, tests run against the latest version of dd-trace by defau
2121
Each component has its own manifest file in the `manifests/` directory.
2222

2323
### Library Manifests
24+
- `manifests/c.yml` - C library
2425
- `manifests/cpp.yml` - C++ library
2526
- `manifests/cpp_httpd.yml` - C++ Apache httpd module
2627
- `manifests/cpp_kong.yml` - C++ Kong module

docs/execute/binaries.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,36 @@ There are three ways to run system-tests with a custom node tracer.
138138
## PHP library
139139
140140
- Place `datadog-setup.php` and `dd-library-php-[X.Y.Z+commitsha]-*-linux-gnu.tar.gz` in `/binaries` folder
141-
- You can download the `.tar.gz` from the `package extension: [arm64, aarch64-unknown-linux-gnu]` (or the `amd64` if you're not on ARM) job artifacts (from the `package-trigger` sub-pipeline), from a CI run of your branch.
141+
- You can download the `.tar.gz` from the `package extension: [arm64, aarch64-unknown-linux-gnu]` (or the `amd64` if you're not on ARM) job artifacts (from the `package-trigger` sub-pipeline of dd-trace-php's `gitlab.ddbuild.io`), from a CI run of your branch.
142+
- **Via the browser:** open the pipeline for your branch, drill into the `package-trigger`
143+
child pipeline, open the `package extension: [...]` job, and download its artifacts.
144+
- **Via `glab` (for agents/CLI use):** the one-liners `glab ci artifact`/`glab job artifact`
145+
only search the *top-level* pipeline's jobs, so they never find `package extension: [...]`
146+
(it lives in the `package-trigger` **child** pipeline) — they just hang instead of failing
147+
fast. Walk the GitLab API by hand instead (project is `DataDog/apm-reliability/dd-trace-php`,
148+
project ID `355`; see [GitLab CLI setup](../ai/ai-tools-integration-guide.md#gitlab-cli-glab)).
149+
These calls must target `gitlab.ddbuild.io` explicitly via `--hostname`, since `glab`'s
150+
default host may point elsewhere:
151+
```bash
152+
# 1. Find the top-level pipeline for your commit
153+
glab api --hostname gitlab.ddbuild.io "/projects/355/pipelines?sha=<commit-sha>"
154+
155+
# 2. List that pipeline's trigger bridges, find package-trigger's downstream_pipeline.id
156+
glab api --hostname gitlab.ddbuild.io "/projects/355/pipelines/<pipeline-id>/bridges"
157+
158+
# 3. Find the job's numeric id in that child pipeline (paginate with &page=N if needed)
159+
glab api --hostname gitlab.ddbuild.io "/projects/355/pipelines/<child-pipeline-id>/jobs?per_page=100"
160+
161+
# 4. Download the job's artifacts zip (large; can take a few minutes). `--output` selects
162+
# glab's own response format (json/ndjson), not a file path, so redirect stdout instead.
163+
glab api --hostname gitlab.ddbuild.io "/projects/355/jobs/<job-id>/artifacts" > artifacts.zip
164+
165+
# 5. Pull out just the tarball you need, matching your host/container architecture
166+
# (<arch> is aarch64 or x86_64, matching `uname -m` inside the PHP weblog container)
167+
unzip -p artifacts.zip "packages/dd-library-php-<version>-<arch>-linux-gnu.tar.gz" \
168+
> binaries/dd-library-php-<version>-<arch>-linux-gnu.tar.gz
169+
```
142170
- The `datadog-setup.php` can be copied from the dd-trace-php repository root.
143-
- Copy it in the binaries folder
144171
145172
Then run the tests from the repo root folder:
146173
@@ -155,6 +182,12 @@ Then run the tests from the repo root folder:
155182
],
156183
```
157184
185+
> :note: **Keep `binaries/` clean between runs**
186+
> Only one PHP tarball should be present in `binaries/` at a time — a stale one left over from an earlier test causes `install_ddtrace.sh`'s "multiple dd-library-php tarballs found" error.
187+
> This can also happen even when `binaries/` on the host is clean: the PHP base image (`apache-mod.base.Dockerfile`, tagged e.g. `datadog/system-tests:apache-mod-8.2.base-v1`) bakes in whatever was in `binaries/` at the time it was built, and it's only rebuilt if the tag is missing locally.
188+
> If a stale tarball was baked into the base image, every later build adds a second tarball on top of it. Fix by removing the base image and letting it rebuild:
189+
> - `docker rmi datadog/system-tests:<variant>.base-v1`
190+
158191
## Python library
159192
160193
Use one of the four options:

0 commit comments

Comments
 (0)