Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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
313 changes: 151 additions & 162 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ variables:
.test_matrix: &test_matrix
- testJvm: &test_jvms
- "8"
- "11"
- "17"
- "21"
- "semeru11"
- "oracle8"
- "ubuntu17"
- "zulu8"
- "semeru8"
- "ibm8"
- "zulu11"
- "semeru17"

# Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
# These blocks emulate "parallel" by including it in the matrix
Expand Down Expand Up @@ -308,46 +297,46 @@ check_debugger:
variables:
GRADLE_TARGET: ":debuggerCheck"

muzzle:
extends: .gradle_build
needs: [ build_tests ]
stage: tests
parallel: 8
variables:
CACHE_TYPE: inst
script:
- export SKIP_BUILDSCAN="true"
- ./gradlew writeMuzzleTasksToFile $GRADLE_ARGS
- sort workspace/build/muzzleTasks > sortedMuzzleTasks
- split --number=l/$NORMALIZED_NODE_TOTAL --suffix-length=1 --numeric-suffixes sortedMuzzleTasks muzzleSplit
- ./gradlew `cat muzzleSplit${NORMALIZED_NODE_INDEX} | xargs` $GRADLE_ARGS
after_script:
- source .gitlab/gitlab-utils.sh
- gitlab_section_start "collect-reports" "Collecting reports"
- .circleci/collect_reports.sh
- gitlab_section_end "collect-reports"
artifacts:
when: always
paths:
- ./reports
- '.gradle/daemon/*/*.out.log'

muzzle-dep-report:
extends: .gradle_build
needs: [ build_tests ]
stage: tests
variables:
CACHE_TYPE: inst
script:
- export SKIP_BUILDSCAN="true"
- ./gradlew generateMuzzleReport muzzleInstrumentationReport $GRADLE_ARGS
after_script:
- .circleci/collect_muzzle_deps.sh
artifacts:
when: always
paths:
- ./reports
- '.gradle/daemon/*/*.out.log'
#muzzle:
# extends: .gradle_build
# needs: [ build_tests ]
# stage: tests
# parallel: 8
# variables:
# CACHE_TYPE: inst
# script:
# - export SKIP_BUILDSCAN="true"
# - ./gradlew writeMuzzleTasksToFile $GRADLE_ARGS
# - sort workspace/build/muzzleTasks > sortedMuzzleTasks
# - split --number=l/$NORMALIZED_NODE_TOTAL --suffix-length=1 --numeric-suffixes sortedMuzzleTasks muzzleSplit
# - ./gradlew `cat muzzleSplit${NORMALIZED_NODE_INDEX} | xargs` $GRADLE_ARGS
# after_script:
# - source .gitlab/gitlab-utils.sh
# - gitlab_section_start "collect-reports" "Collecting reports"
# - .circleci/collect_reports.sh
# - gitlab_section_end "collect-reports"
# artifacts:
# when: always
# paths:
# - ./reports
# - '.gradle/daemon/*/*.out.log'
#
#muzzle-dep-report:
# extends: .gradle_build
# needs: [ build_tests ]
# stage: tests
# variables:
# CACHE_TYPE: inst
# script:
# - export SKIP_BUILDSCAN="true"
# - ./gradlew generateMuzzleReport muzzleInstrumentationReport $GRADLE_ARGS
# after_script:
# - .circleci/collect_muzzle_deps.sh
# artifacts:
# when: always
# paths:
# - ./reports
# - '.gradle/daemon/*/*.out.log'

# In Gitlab, DD_* variables are set because the build runner is instrumented with Datadog telemetry
# To have a pristine environment for the tests, these variables are saved before the test run and restored afterwards
Expand Down Expand Up @@ -475,117 +464,117 @@ test_base:
- if [ "$testJvm" == "8" ]; then export GRADLE_PARAMS="-PskipFlakyTests -PcheckCoverage"; fi
- !reference [.test_job, script]

test_inst:
extends: .test_job_with_test_agent
variables:
GRADLE_TARGET: ":instrumentationTest"
CACHE_TYPE: "inst"
parallel:
matrix: *test_matrix_6

test_inst_latest:
extends: .test_job_with_test_agent
variables:
GRADLE_TARGET: ":instrumentationLatestDepTest"
CACHE_TYPE: "latestDep"
parallel:
matrix:
- testJvm: ["8", "17", "21" ]
# Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
# This emulates "parallel" by including it in the matrix
CI_SPLIT: [ "1/6", "2/6", "3/6", "4/6", "5/6", "6/6"]

test_flaky:
extends: .test_job_with_test_agent
variables:
GRADLE_PARAMS: "-PrunFlakyTests"
CACHE_TYPE: "base"
testJvm: "8"
CONTINUE_ON_FAILURE: "true"
rules:
- *master_only
- if: $RUN_FLAKY_TESTS == "true"
when: on_success
parallel:
matrix:
- GRADLE_TARGET: [":baseTest", ":smokeTest", ":debuggerTest"]
# Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
# This emulates "parallel" by including it in the matrix
CI_SPLIT: [ "1/4", "2/4", "3/4", "4/4" ]

test_flaky_inst:
extends: .test_job
variables:
GRADLE_TARGET: ":instrumentationTest"
GRADLE_PARAMS: "-PrunFlakyTests"
CACHE_TYPE: "inst"
testJvm: "8"
CONTINUE_ON_FAILURE: "true"
rules:
- *master_only
- if: $RUN_FLAKY_TESTS == "true"
when: on_success
parallel: 6

test_profiling:
extends: .test_job
variables:
GRADLE_TARGET: ":profilingTest"
CACHE_TYPE: "profiling"
parallel:
matrix: *test_matrix

# specific jvms list for debugger project because J9-based JVMs have issues with local vars
# so need to test at least against one J9-based JVM
test_debugger:
extends: .test_job
variables:
GRADLE_TARGET: ":debuggerTest"
CACHE_TYPE: "base"
DEFAULT_TEST_JVMS: /^(8|11|17|21|semeru8)$/
parallel:
matrix: *test_matrix

test_smoke:
extends: .test_job
variables:
GRADLE_TARGET: "stageMainDist :smokeTest"
GRADLE_PARAMS: "-PskipFlakyTests"
CACHE_TYPE: "smoke"
parallel:
matrix: *test_matrix_2

test_ssi_smoke:
extends: .test_job
rules: *master_only
variables:
GRADLE_TARGET: "stageMainDist :smokeTest"
CACHE_TYPE: "smoke"
DD_INJECT_FORCE: "true"
DD_INJECTION_ENABLED: "tracer"
parallel:
matrix: *test_matrix_2

test_smoke_graalvm:
extends: .test_job
tags: [ "arch:amd64" ]
variables:
GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test"
CACHE_TYPE: "smoke"
CI_NO_SPLIT: "true"
NON_DEFAULT_JVMS: "true"
parallel:
matrix:
- testJvm: ["graalvm17", "graalvm21"]

test_smoke_semeru8_debugger:
extends: .test_job
tags: [ "arch:amd64" ]
variables:
GRADLE_TARGET: "stageMainDist dd-smoke-tests:debugger-integration-tests:test"
CACHE_TYPE: "smoke"
NON_DEFAULT_JVMS: "true"
testJvm: "semeru8"
#test_inst:
# extends: .test_job_with_test_agent
# variables:
# GRADLE_TARGET: ":instrumentationTest"
# CACHE_TYPE: "inst"
# parallel:
# matrix: *test_matrix_6
#
#test_inst_latest:
# extends: .test_job_with_test_agent
# variables:
# GRADLE_TARGET: ":instrumentationLatestDepTest"
# CACHE_TYPE: "latestDep"
# parallel:
# matrix:
# - testJvm: ["8", "17", "21" ]
# # Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
# # This emulates "parallel" by including it in the matrix
# CI_SPLIT: [ "1/6", "2/6", "3/6", "4/6", "5/6", "6/6"]
#
#test_flaky:
# extends: .test_job_with_test_agent
# variables:
# GRADLE_PARAMS: "-PrunFlakyTests"
# CACHE_TYPE: "base"
# testJvm: "8"
# CONTINUE_ON_FAILURE: "true"
# rules:
# - *master_only
# - if: $RUN_FLAKY_TESTS == "true"
# when: on_success
# parallel:
# matrix:
# - GRADLE_TARGET: [":baseTest", ":smokeTest", ":debuggerTest"]
# # Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
# # This emulates "parallel" by including it in the matrix
# CI_SPLIT: [ "1/4", "2/4", "3/4", "4/4" ]
#
#test_flaky_inst:
# extends: .test_job
# variables:
# GRADLE_TARGET: ":instrumentationTest"
# GRADLE_PARAMS: "-PrunFlakyTests"
# CACHE_TYPE: "inst"
# testJvm: "8"
# CONTINUE_ON_FAILURE: "true"
# rules:
# - *master_only
# - if: $RUN_FLAKY_TESTS == "true"
# when: on_success
# parallel: 6
#
#test_profiling:
# extends: .test_job
# variables:
# GRADLE_TARGET: ":profilingTest"
# CACHE_TYPE: "profiling"
# parallel:
# matrix: *test_matrix
#
## specific jvms list for debugger project because J9-based JVMs have issues with local vars
## so need to test at least against one J9-based JVM
#test_debugger:
# extends: .test_job
# variables:
# GRADLE_TARGET: ":debuggerTest"
# CACHE_TYPE: "base"
# DEFAULT_TEST_JVMS: /^(8|11|17|21|semeru8)$/
# parallel:
# matrix: *test_matrix
#
#test_smoke:
# extends: .test_job
# variables:
# GRADLE_TARGET: "stageMainDist :smokeTest"
# GRADLE_PARAMS: "-PskipFlakyTests"
# CACHE_TYPE: "smoke"
# parallel:
# matrix: *test_matrix_2
#
#test_ssi_smoke:
# extends: .test_job
# rules: *master_only
# variables:
# GRADLE_TARGET: "stageMainDist :smokeTest"
# CACHE_TYPE: "smoke"
# DD_INJECT_FORCE: "true"
# DD_INJECTION_ENABLED: "tracer"
# parallel:
# matrix: *test_matrix_2
#
#test_smoke_graalvm:
# extends: .test_job
# tags: [ "arch:amd64" ]
# variables:
# GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test"
# CACHE_TYPE: "smoke"
# CI_NO_SPLIT: "true"
# NON_DEFAULT_JVMS: "true"
# parallel:
# matrix:
# - testJvm: ["graalvm17", "graalvm21"]
#
#test_smoke_semeru8_debugger:
# extends: .test_job
# tags: [ "arch:amd64" ]
# variables:
# GRADLE_TARGET: "stageMainDist dd-smoke-tests:debugger-integration-tests:test"
# CACHE_TYPE: "smoke"
# NON_DEFAULT_JVMS: "true"
# testJvm: "semeru8"

deploy_to_profiling_backend:
stage: publish
Expand Down
7 changes: 7 additions & 0 deletions dd-java-agent/instrumentation/javax-xml/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ repositories {
}
}

configurations.all {
// shut up about broken xml-api pom relocation
resolutionStrategy {
force 'xml-apis:xml-apis:1.4.01'
}
}

dependencies {
testRuntimeOnly project(':dd-java-agent:instrumentation:iast-instrumenter')
testImplementation group: 'xalan', name: 'xalan', version: '2.7.0'
Expand Down
7 changes: 7 additions & 0 deletions dd-java-agent/instrumentation/owasp-esapi-2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ muzzle {
}
}

configurations.all {
// shut up about broken xml-api pom relocation
resolutionStrategy {
force 'xml-apis:xml-apis:1.4.01'
}
}

apply from: "$rootDir/gradle/java.gradle"
apply plugin: 'call-site-instrumentation'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ public static void agentmain(final String agentArgs, final Instrumentation inst)
try {
initTelemetry = createInitializationTelemetry();
} catch (Throwable t) {
System.err.println(
"Failed to initialize JSON initTelemetry: "
+ t.getClass().getName()
+ ", msg="
+ t.getMessage());

t.printStackTrace(System.err);

initTelemetry = BootstrapInitializationTelemetry.noOpInstance();
}
try {
Expand All @@ -81,7 +89,9 @@ public static void agentmain(final String agentArgs, final Instrumentation inst)
ex.printStackTrace();
} finally {
try {
System.err.println("DEBUG: init telemetry finish: " + initTelemetry.getClass().getName());
initTelemetry.finish();
System.err.println("DEBUG: init telemetry finish done");
} catch (Throwable t) {
// safeguard - ignore
}
Expand Down
Loading