Skip to content

Commit 240fc3c

Browse files
Merge branch 'master' into alexeyk/arm64-test
2 parents 8e27f79 + bacdc33 commit 240fc3c

141 files changed

Lines changed: 10135 additions & 10053 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.

.claude/skills/migrate-groovy-to-java/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ When converting Groovy code to Java code, make sure that:
3333
- Replace `injectSysConfig(key, value)` calls with `@WithConfig` when the key and value are static literals. Put it on the test method for per-test config, or on the class when every test needs it. The `dd.` prefix is added automatically — use the bare key (e.g. `"trace.scope.strict.mode"`, not `"dd.trace.scope.strict.mode"`). For dynamic or parameterized values, keep the imperative `WithConfigExtension.injectSysConfig(key, value)` call.
3434
- Keep inline comments
3535
- Migrate the named Spock clauses if they exist as inline comments in the Java unit test
36+
- When Groovy tests navigate a JSON request body through helpers like `asMap()` / `asLong()` / `asList()`, check whether `json-unit-assertj` (`libs.json.unit.assertj`) is already in the module's build file. If it is, add a method that returns the raw JSON string and use `assertThatJson(json).node("some.nested.field").isEqualTo(value)` directly instead of the map traversal.
37+
- Groovy's `[key: val]` map literals use a `LinkedHashMap`. When the test doesn't care about insertion order, use `singletonMap` for a single entry or `HashMap` for two or more. If a helper method builds these maps, add a two-arg overload rather than scattering `new LinkedHashMap<>()` constructions through test bodies.
3638

3739
TableTest usage
3840
Import: `import org.tabletest.junit.TableTest;`

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- Add your completed PR to the merge queue by commenting `/merge`. You can also:
1616
- Customize the commit message associated with the merge with `/merge --commit-message "..."`
1717
- Remove your PR from the merge queue with `/merge -c`
18-
- Skip all merge queue checks with `/merge -f --reason "reason"`; please use this judiciously, as some checks do not run at the PR-level
18+
- Skip all merge queue checks with `/merge -f --reason "reason"`; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
1919
- Get more information in [this doc](https://datadoghq.atlassian.net/wiki/spaces/DEVX/pages/3121612126/MergeQueue)
2020

2121
Jira ticket: [PROJ-IDENT]

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ include:
2323
stages:
2424
- build
2525
- publish
26-
# These benchmarks are intended to replace the legacy benchmarks in the future
2726
- java-spring-petclinic-parallel
2827
- java-spring-petclinic-parallel-slo
2928
- java-startup-parallel
@@ -238,6 +237,7 @@ default:
238237
org.gradle.java.installations.auto-detect=false
239238
org.gradle.java.installations.auto-download=false
240239
org.gradle.java.installations.fromEnv=$JAVA_HOMES
240+
org.gradle.console=colored
241241
EOF
242242
- mkdir -p .gradle
243243
- export GRADLE_USER_HOME=$(pwd)/.gradle
@@ -475,6 +475,7 @@ test_published_artifacts:
475475
- export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms2G -Xmx2G -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
476476
- ./gradlew publishToMavenLocal $GRADLE_ARGS
477477
- cd test-published-dependencies
478+
- printf '\norg.gradle.console=colored\n' >> gradle.properties
478479
- export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms1G -Xmx1G -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
479480
- ./gradlew --version
480481
- ./gradlew check --info $GRADLE_ARGS

.gitlab/benchmarks.yml

Lines changed: 0 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,3 @@
1-
.benchmarks:
2-
stage: benchmarks
3-
timeout: 1h
4-
tags: ["runner:apm-k8s-tweaked-metal"]
5-
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-java-benchmarks
6-
needs: [ "build", "publish-artifacts-to-s3" ]
7-
rules:
8-
- if: '$POPULATE_CACHE'
9-
when: never
10-
- if: '$CI_COMMIT_TAG =~ /^v?[0-9]+\.[0-9]+\.[0-9]+$/'
11-
when: manual
12-
allow_failure: true
13-
- if: '$CI_COMMIT_BRANCH == "master"'
14-
when: on_success
15-
interruptible: false
16-
- if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/'
17-
when: on_success
18-
interruptible: false
19-
- if: '$CI_COMMIT_BRANCH =~ /^gh-readonly-queue\//'
20-
when: on_success
21-
interruptible: false
22-
- when: manual
23-
allow_failure: true
24-
interruptible: true
25-
script:
26-
- export ARTIFACTS_DIR="$(pwd)/reports" && mkdir -p "${ARTIFACTS_DIR}"
27-
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf "https://github.com/DataDog/"
28-
- git clone --branch dd-trace-java/tracer-benchmarks-parallel https://github.com/DataDog/benchmarking-platform.git /platform && cd /platform
29-
artifacts:
30-
name: "reports"
31-
paths:
32-
- reports/
33-
expire_in: 3 months
34-
variables:
35-
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID # The ID of the current project. This ID is unique across all projects on the GitLab instance.
36-
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME # "dd-trace-java"
37-
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built.
38-
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA # The commit revision the project is built for.
39-
40-
benchmarks-startup:
41-
extends: .benchmarks
42-
script:
43-
- !reference [ .benchmarks, script ]
44-
- ./steps/capture-hardware-software-info.sh
45-
- ./steps/run-benchmarks.sh startup
46-
- ./steps/analyze-results.sh startup
47-
48-
benchmarks-load:
49-
extends: .benchmarks
50-
script:
51-
- !reference [ .benchmarks, script ]
52-
- ./steps/capture-hardware-software-info.sh
53-
- ./steps/run-benchmarks.sh load
54-
- ./steps/analyze-results.sh load
55-
56-
benchmarks-dacapo:
57-
extends: .benchmarks
58-
script:
59-
- !reference [ .benchmarks, script ]
60-
- ./steps/capture-hardware-software-info.sh
61-
- ./steps/run-benchmarks.sh dacapo
62-
- ./steps/analyze-results.sh dacapo
63-
64-
benchmarks-post-results:
65-
extends: .benchmarks
66-
tags: ["arch:amd64"]
67-
script:
68-
- !reference [ .benchmarks, script ]
69-
- ./steps/upload-results-to-s3.sh
70-
- ./steps/post-pr-comment.sh
71-
needs:
72-
- job: benchmarks-startup
73-
artifacts: true
74-
- job: benchmarks-load
75-
artifacts: true
76-
- job: benchmarks-dacapo
77-
artifacts: true
78-
79-
check-big-regressions:
80-
extends: .benchmarks
81-
needs:
82-
- job: benchmarks-startup
83-
artifacts: true
84-
- job: benchmarks-dacapo
85-
artifacts: true
86-
when: on_success
87-
tags: ["arch:amd64"]
88-
rules:
89-
- if: '$POPULATE_CACHE'
90-
when: never
91-
- if: '$CI_COMMIT_BRANCH =~ /backport-pr-/'
92-
when: never
93-
- if: '$CI_COMMIT_BRANCH =~ /^(master|release\/)/'
94-
when: never
95-
- if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/'
96-
when: on_success
97-
- if: '$CI_COMMIT_BRANCH =~ /^gh-readonly-queue\//'
98-
when: on_success
99-
- when: manual
100-
allow_failure: true
101-
# ARTIFACTS_DIR /go/src/github.com/DataDog/apm-reliability/dd-trace-java/reports/
102-
# need to convert them
103-
script:
104-
- !reference [ .benchmarks, script ]
105-
- |
106-
for benchmarkType in startup dacapo; do
107-
find "$ARTIFACTS_DIR/$benchmarkType" -name "benchmark-baseline.json" -o -name "benchmark-candidate.json" | while read file; do
108-
relpath="${file#$ARTIFACTS_DIR/$benchmarkType/}"
109-
prefix="${relpath%/benchmark-*}" # Remove the trailing /benchmark-(baseline|candidate).json
110-
prefix="${prefix#./}" # Remove any leading ./
111-
prefix="${prefix//\//-}" # Replace / with -
112-
case "$file" in
113-
*benchmark-baseline.json) type="baseline" ;;
114-
*benchmark-candidate.json) type="candidate" ;;
115-
esac
116-
echo "Moving $file to $ARTIFACTS_DIR/${type}-${prefix}.converted.json"
117-
cp "$file" "$ARTIFACTS_DIR/${type}-${prefix}.converted.json"
118-
done
119-
done
120-
- bp-runner $CI_PROJECT_DIR/.gitlab/benchmarks/bp-runner.fail-on-regression.yml --debug
121-
1221
.dsm-kafka-benchmarks:
1232
stage: benchmarks
1243
rules:

.gitlab/benchmarks/bp-runner.fail-on-regression.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitlab/collect-result/JUnitReport.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,35 @@ void tagSyntheticFailures() {
114114
}
115115
}
116116

117+
/// Tags every attempt of a retried test except the final one with `skip`, so Test Optimization
118+
/// counts only the decisive (last) attempt and ignores intermediate retries.
119+
///
120+
/// Gradle's Develocity test-retry plugin re-runs a failing test and appends each attempt to the
121+
/// same per-class JUnit report as another `<testcase>` with an identical `classname#name`. The
122+
/// plugin stops retrying once a test passes or retries are exhausted, so the last such element in
123+
/// document order is the decisive attempt and every earlier duplicate is tagged `skip`.
124+
///
125+
/// **Must run before {@link #normalizeStableTestNames()}.** Keys are matched on raw names so two
126+
/// genuinely distinct tests whose names differ only in an unstable token (e.g. `localhost:12345`
127+
/// vs `localhost:23456`, which normalization collapses to `localhost:PORT`) are not mistaken for
128+
/// retries of each other.
129+
///
130+
/// Tagging uses the same `addFinalStatusProperty` path as {@link #tagFinalStatuses()}, which then
131+
/// leaves the already-tagged earlier attempts untouched and assigns the natural pass/fail status
132+
/// only to the final attempt.
133+
void tagRetriedAttempts() {
134+
var attemptsByKey = new LinkedHashMap<String, List<Element>>();
135+
for (var testcase : testcases()) {
136+
var key = testcase.getAttribute("classname") + "#" + testcase.getAttribute("name");
137+
attemptsByKey.computeIfAbsent(key, ignored -> new ArrayList<>()).add(testcase);
138+
}
139+
for (var attempts : attemptsByKey.values()) {
140+
for (var i = 0; i < attempts.size() - 1; i++) {
141+
addFinalStatusProperty(attempts.get(i), "skip", MissingPropertiesPlacement.FIRST_CHILD);
142+
}
143+
}
144+
}
145+
117146
void tagFinalStatuses() {
118147
for (var testcase : testcases()) {
119148
if (hasFinalStatusProperty(testcase)) {

.gitlab/collect-result/ResultCollector.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ private void collect(Path sourceXml) throws Exception {
4646
var sourceFile = sourceFileResolver.resolve(sourceXml);
4747
var report = JUnitReport.parse(sourceXml);
4848
var reportChangedBeforeFinalStatus = report.addFileAttribute(sourceFile);
49+
// Before normalization: retried attempts are matched on raw classname#name (see
50+
// JUnitReport#tagRetriedAttempts) so distinct tests sharing a normalized name are not collapsed.
51+
report.tagRetriedAttempts();
4952
reportChangedBeforeFinalStatus |= report.normalizeStableTestNames();
5053
report.tagSyntheticFailures();
5154
report.tagFinalStatuses();

benchmark/Dockerfile

Lines changed: 0 additions & 103 deletions
This file was deleted.

benchmark/README.MD

Lines changed: 0 additions & 29 deletions
This file was deleted.

benchmark/benchmarks.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)