Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
17ff796
Add nightly system-tests workflow
nccatoni Feb 18, 2026
10f7eab
Enable push_to_test_optimization
nccatoni Feb 18, 2026
2f73f4b
Pass secrets explicitly to reusable workflow
nccatoni Feb 18, 2026
34d46d2
Only pass TEST_OPTIMIZATION_API_KEY secret
nccatoni Feb 18, 2026
420b281
tmp: add pull_request trigger for testing
nccatoni Feb 18, 2026
1185a36
Set desired_execution_time to 300s
nccatoni Feb 18, 2026
4af9b76
Also pass DD_API_KEY secret
nccatoni Feb 18, 2026
55526dd
ci: add system-tests Test Optimization upload and tracer-release nightly
nccatoni Feb 26, 2026
42bcd97
ci: fix after_script by using upload script directly
nccatoni Feb 26, 2026
50f858b
ci: fix system-tests Test Optimization upload
nccatoni Feb 26, 2026
34f79e3
Run only tracer-release on schedule, it already includes other groups
nccatoni Mar 2, 2026
bafec28
Temporarily run tracer-release on all triggers for testing
nccatoni Mar 2, 2026
578e0b6
Tracer release scenario group on main
nccatoni Mar 5, 2026
4db0655
Test
nccatoni Mar 5, 2026
a65519d
Remove ref argument
nccatoni Mar 5, 2026
b44c4ab
Every day schedule (include weekends)
nccatoni Mar 12, 2026
5159a71
Use upload-junit-to-datadog.sh
nccatoni Mar 12, 2026
85c13ba
Remove github workflow
nccatoni Mar 12, 2026
3c214dc
Test
nccatoni Mar 13, 2026
be1373a
Add tracer-release system tests job on GitLab
nccatoni Mar 13, 2026
a258de8
Merge branch 'master' into add-nightly-system-tests
nccatoni Mar 13, 2026
6b14c2f
Fetch DD_API_KEY from Vault for tracer-release system tests
nccatoni Mar 13, 2026
9d3c4ee
fail when vault call fails
nccatoni Mar 19, 2026
99bd6b0
Fix vault path
nccatoni Mar 19, 2026
922d80d
Using vault CLI
nccatoni Mar 19, 2026
18869c3
Fix tracer-release system tests: use vault CLI and compute PHP-compat…
nccatoni Mar 19, 2026
b0982a7
Use compute-workflow-parameters.py to get PHP-compatible scenarios
nccatoni Mar 19, 2026
f00dc87
Pass all computed scenarios to run.sh without filtering
nccatoni Mar 19, 2026
0a7ccd1
Increase tracer-release system tests timeout to 4h
nccatoni Mar 20, 2026
dbf442b
Run all scenarios regardless of individual failures
nccatoni Mar 20, 2026
e44dc4c
Putting rules back
nccatoni Mar 20, 2026
f67c9a0
Fix JUnit artifact collisions across multiple scenarios
nccatoni Mar 20, 2026
53a128e
Test optim upload fix
nccatoni Mar 23, 2026
965c494
Merge branch 'master' into add-nightly-system-tests
nccatoni Mar 25, 2026
bed5841
Remove debug
nccatoni Mar 25, 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
25 changes: 23 additions & 2 deletions .gitlab/generate-package.php
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,7 @@
# Install Python dependencies
pip install -U pip virtualenv
<?php dockerhub_login() ?>
- /tmp/vault kv get --format=json "kv/k8s/gitlab-runner/dd-trace-php/datadoghq-api-key" 2>/dev/null | python3 -c "import sys,json;print(json.load(sys.stdin)['data']['data']['key'])" > /tmp/.dd-api-key 2>/dev/null || true
- git clone https://github.com/DataDog/system-tests.git
- mv packages/{datadog-setup.php,dd-library-php-*x86_64-linux-gnu.tar.gz} system-tests/binaries
- cd system-tests
Expand All @@ -1244,10 +1245,13 @@
when: always
paths:
- .cache/
after_script:
- DATADOG_API_KEY=$(cat /tmp/.dd-api-key 2>/dev/null) || true
- mkdir -p artifacts && for f in system-tests/logs*/reportJunit.xml; do dir=$(basename $(dirname "$f")); cp "$f" "artifacts/reportJunit_${dir}.xml" 2>/dev/null || true; done
Comment on lines 1238 to +1250
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fetching the API key manually is redundant with the script, isn't it?

Copy link
Author

@nccatoni nccatoni Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The connection to vault fails for the parametric job in the script like in this run. From what I understand it might be due to the vault agent getting killed at some point since it only happens for the longest job

- DATADOG_API_KEY=${DATADOG_API_KEY:-} DD_SERVICE=system-tests DD_JUNIT_XPATH_TAGS="test.codeowners=/testcase/properties/property[@name='test.codeowners']" .gitlab/silent-upload-junit-to-datadog.sh
artifacts:
paths:
- "system-tests/logs_parametric/"
- "system-tests/logs/"
- "system-tests/logs*/"
when: "always"

"System Tests: [default]":
Expand All @@ -1268,6 +1272,23 @@
script:
- ./run.sh $TESTSUITE

"System Tests: [tracer-release]":
extends: .system_tests
timeout: 4h
rules:
- if: $CI_COMMIT_REF_NAME == "master"
when: on_success
- if: $CI_PIPELINE_SOURCE == "schedule"
when: on_success
- when: manual
allow_failure: true
script:
- curl -sfL "https://releases.hashicorp.com/vault/1.20.0/vault_1.20.0_linux_amd64.zip" -o /tmp/vault.zip && unzip -q /tmp/vault.zip -d /tmp && chmod +x /tmp/vault && rm -f /tmp/vault.zip
- DD_API_KEY=$(/tmp/vault kv get --format=json "kv/k8s/gitlab-runner/dd-trace-php/datadoghq-api-key" | python3 -c "import sys,json;print(json.load(sys.stdin)['data']['data']['key'])") || { echo "Failed to fetch DD_API_KEY from Vault"; exit 1; }
- export DD_API_KEY
- SCENARIOS=$(PYTHONPATH=. venv/bin/python utils/scripts/compute-workflow-parameters.py php -g tracer_release -f json | python3 -c "import sys,json;d=json.load(sys.stdin);s=set();[s.update(v['scenarios']) for v in d.values() if isinstance(v,dict) and 'scenarios' in v];print(' '.join(sorted(s)))")
- FAILED=""; for S in $SCENARIOS; do echo "=== Running $S ==="; ./run.sh $S || FAILED="$FAILED $S"; done; if [ -n "$FAILED" ]; then echo "Failed scenarios:$FAILED"; exit 1; fi

"System Tests: [parametric]":
extends: .system_tests
variables:
Expand Down
21 changes: 14 additions & 7 deletions .gitlab/upload-junit-to-datadog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eo pipefail

export DATADOG_SITE="datadoghq.com"
export DD_ENV="ci"
export DD_SERVICE="dd-trace-php-tests"
export DD_SERVICE="${DD_SERVICE:-dd-trace-php-tests}"
export VAULT_SECRET_PATH="kv/k8s/gitlab-runner/dd-trace-php/datadoghq-api-key"
export VAULT_VERSION="1.20.0"

Expand Down Expand Up @@ -103,7 +103,7 @@ if ! command -v vault &> /dev/null; then
fi

echo "Extracting Vault..."
if ! unzip -q "${vault_zip}" -d /tmp; then
if ! unzip -o -q "${vault_zip}" -d /tmp; then
echo "Warning: Failed to extract Vault. Skipping JUnit upload." >&2
exit 0
fi
Expand Down Expand Up @@ -142,9 +142,10 @@ export DATADOG_API_KEY
# Determine which datadog-ci method to use
datadog_ci_cmd=""

# Prefer npm/npx if available
if command -v npx &> /dev/null || command -v npm &> /dev/null; then
echo "Using npx to run datadog-ci"
# Prefer npm/npx if available and node version is recent enough (>=16)
node_version="$(node --version 2>/dev/null | sed 's/^v//' | cut -d. -f1)"
if [ -n "$node_version" ] && [ "$node_version" -ge 16 ] 2>/dev/null && { command -v npx &> /dev/null || command -v npm &> /dev/null; }; then
echo "Using npx to run datadog-ci (node v${node_version})"
datadog_ci_cmd="npx --yes @datadog/datadog-ci"
else
# Fall back to standalone binary if npm/npx not available
Expand Down Expand Up @@ -212,10 +213,16 @@ if [[ -n "${TAGS}" ]]; then
tags_args="--tags ${TAGS}"
fi

# Build xpath-tag arguments if DD_JUNIT_XPATH_TAGS is set
xpath_tags_args=""
if [[ -n "${DD_JUNIT_XPATH_TAGS:-}" ]]; then
xpath_tags_args="--xpath-tag ${DD_JUNIT_XPATH_TAGS}"
fi

echo "Current directory: $(pwd)"
echo "Running command: ${datadog_ci_cmd} junit upload --service \"${DD_SERVICE}\" --max-concurrency 20 --verbose --tags git.repository_url:https://github.com/DataDog/dd-trace-php ${tags_args} ${files_array[*]}"
echo "Running command: ${datadog_ci_cmd} junit upload --service \"${DD_SERVICE}\" --max-concurrency 20 --verbose --tags git.repository_url:https://github.com/DataDog/dd-trace-php ${tags_args} ${xpath_tags_args} ${files_array[*]}"

if ! ${datadog_ci_cmd} junit upload --service "${DD_SERVICE}" --max-concurrency 20 --verbose --tags "git.repository_url:https://github.com/DataDog/dd-trace-php" ${tags_args} "${files_array[@]}"; then
if ! ${datadog_ci_cmd} junit upload --service "${DD_SERVICE}" --max-concurrency 20 --verbose --tags "git.repository_url:https://github.com/DataDog/dd-trace-php" ${tags_args} ${xpath_tags_args} "${files_array[@]}"; then
echo "Warning: Failed to upload JUnit files" >&2
exit 0
fi
Expand Down
Loading