-
Notifications
You must be signed in to change notification settings - Fork 171
ci: upload system-tests results to Test Optimization and add tracer-release nightly #3660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
17ff796
10f7eab
2f73f4b
34d46d2
420b281
1185a36
4af9b76
55526dd
42bcd97
50f858b
34f79e3
bafec28
578e0b6
4db0655
a65519d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name: System Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: {} | ||
| schedule: | ||
| - cron: '00 03 * * 1-5' | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| system-tests: | ||
| uses: DataDog/system-tests/.github/workflows/system-tests.yml@main | ||
| secrets: | ||
| DD_API_KEY: ${{ secrets.DD_API_KEY }} | ||
| TEST_OPTIMIZATION_API_KEY: ${{ secrets.DD_API_KEY }} | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| with: | ||
| library: php | ||
| scenarios_groups: tracer-release | ||
| skip_empty_scenarios: true | ||
| _system_tests_dev_mode: true | ||
| push_to_test_optimization: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1223,6 +1223,45 @@ | |
| when: always | ||
| paths: | ||
| - .cache/ | ||
| after_script: | ||
| - | | ||
| set +e | ||
| echo "=== Uploading system-tests JUnit results to Test Optimization ===" | ||
|
|
||
| # Check that there are JUnit files to upload | ||
| ls system-tests/logs*/reportJunit.xml >/dev/null 2>&1 | ||
| if [ $? -ne 0 ]; then echo "No JUnit XML files found, skipping upload"; exit 0; fi | ||
|
|
||
| # Download datadog-ci standalone binary | ||
| echo "Downloading datadog-ci..." | ||
| curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-x64" -o /tmp/datadog-ci | ||
| if [ $? -ne 0 ]; then echo "Failed to download datadog-ci"; exit 0; fi | ||
| chmod +x /tmp/datadog-ci | ||
|
|
||
| # Download and extract Vault CLI | ||
| echo "Downloading Vault..." | ||
| VAULT_VERSION="1.20.0" | ||
| curl -L --fail "https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip" -o /tmp/vault.zip | ||
| if [ $? -ne 0 ]; then echo "Failed to download Vault"; exit 0; fi | ||
| python3 -c "import zipfile; zipfile.ZipFile('/tmp/vault.zip').extractall('/tmp/')" | ||
| chmod +x /tmp/vault | ||
|
|
||
| # Fetch API key from Vault | ||
| echo "Fetching API key from Vault..." | ||
| VAULT_JSON=$(/tmp/vault kv get --format=json "kv/k8s/gitlab-runner/dd-trace-php/datadoghq-api-key" 2>&1) | ||
| if [ $? -ne 0 ]; then echo "Failed to fetch API key from Vault: $VAULT_JSON"; exit 0; fi | ||
| export DATADOG_API_KEY=$(echo "$VAULT_JSON" | python3 -c "import sys,json; print(json.loads(sys.stdin.read())['data']['data']['key'])") | ||
| export DATADOG_SITE="datadoghq.com" | ||
|
|
||
| # Upload JUnit results | ||
| echo "Uploading JUnit results..." | ||
| /tmp/datadog-ci junit upload \ | ||
| system-tests/logs*/reportJunit.xml \ | ||
|
Comment on lines
+1258
to
+1259
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because this block runs with Useful? React with 👍 / 👎. |
||
| --service system-tests \ | ||
| --env ci \ | ||
| --verbose \ | ||
| --xpath-tag "test.codeowners=/testcase/properties/property[@name='test.codeowners']" | ||
| echo "=== Upload complete ===" | ||
| artifacts: | ||
| paths: | ||
| - "system-tests/logs_parametric/" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job passes
DD_API_KEY/TEST_OPTIMIZATION_API_KEYinto a reusable workflow referenced by mutable@main, so any upstream change onDataDog/system-testsimmediately executes here with access to those secrets. In the event of an upstream compromise or an unintended change, secrets can be exposed without any commit in this repository; pinning to an immutable commit SHA avoids that supply-chain risk.Useful? React with 👍 / 👎.