diff --git a/.gitlab/generate-package.php b/.gitlab/generate-package.php index 63a6c1da76..56cf1e91e5 100644 --- a/.gitlab/generate-package.php +++ b/.gitlab/generate-package.php @@ -1238,6 +1238,9 @@ when: always paths: - .cache/ + after_script: + - mkdir -p artifacts && cp system-tests/logs*/reportJunit.xml artifacts/ 2>/dev/null || true + - 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/" @@ -1262,6 +1265,19 @@ script: - ./run.sh $TESTSUITE +"System Tests: [tracer-release]": + extends: .system_tests + # rules: + # - if: $CI_COMMIT_REF_NAME == "master" + # when: on_success + # - if: $CI_PIPELINE_SOURCE == "schedule" + # when: on_success + # - when: manual + # allow_failure: true + script: + - export DD_API_KEY=$(curl -s -H "X-Vault-Token:$VAULT_TOKEN" "$VAULT_ADDR/v1/kv/data/k8s/gitlab-runner/dd-trace-php/datadoghq-api-key" | python3 -c "import sys,json;print(json.load(sys.stdin)['data']['data']['key'])") + - ./run.sh TRACER_RELEASE_SCENARIOS + "System Tests: [parametric]": extends: .system_tests variables: diff --git a/.gitlab/upload-junit-to-datadog.sh b/.gitlab/upload-junit-to-datadog.sh index 9bc785eeea..4fc5da43f9 100755 --- a/.gitlab/upload-junit-to-datadog.sh +++ b/.gitlab/upload-junit-to-datadog.sh @@ -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" @@ -212,10 +212,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