Skip to content

Commit 886169b

Browse files
authored
Refactor exploration tests (#8150)
- reuse the library built by previous job - make a job per repo to run exploration tests - upload results logs as artifacts - clone a specific and stable branch of jackson - enable jackson core and databind repos - use a sdkmanrc file for java configuration - run exploration tests automatically when changes in debugger
1 parent a8b33d5 commit 886169b

7 files changed

+59
-36
lines changed

.gitlab/exploration-tests.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,63 @@ build-exploration-tests-image:
1212
- docker push $EXPLORATION_TESTS_IMAGE
1313

1414
.common-exploration-tests: &common-exploration-tests
15+
rules:
16+
- if: '$POPULATE_CACHE'
17+
when: never
18+
- if: $CI_PIPELINE_SOURCE != "schedule"
19+
changes:
20+
paths:
21+
- dd-java-agent/agent-debugger/**/*
22+
compare_to: "master"
23+
when: on_success
24+
- when: manual
25+
allow_failure: true
1526
before_script:
16-
- source $HOME/.sdkman/bin/sdkman-init.sh
17-
- export JAVA_HOME=$JAVA_8_HOME
18-
- ./gradlew :dd-java-agent:shadowJar --no-scan
1927
- cp workspace/dd-java-agent/build/libs/*.jar /exploration-tests/dd-java-agent.jar
2028
- cp dd-java-agent/agent-debugger/exploration-tests/run-exploration-tests.sh /exploration-tests
2129
- cp dd-java-agent/agent-debugger/exploration-tests/exclude_*.txt /exploration-tests
2230
- cp dd-java-agent/agent-debugger/exploration-tests/include_*.txt /exploration-tests
31+
- source $HOME/.sdkman/bin/sdkman-init.sh && cd / && sdk env
2332
- cd /exploration-tests
33+
- java -version
2434
after_script:
25-
- echo "$PROJECT"
26-
- cd $CI_PROJECT_DIR
27-
- cp /exploration-tests/$PROJECT/agent.log ${PROJECT}_agent.log
35+
- cp /exploration-tests/${PROJECT}/agent.log ${PROJECT}_agent.log
2836
- gzip ${PROJECT}_agent.log
2937
- tar czf ${PROJECT}_surefire-reports.tar.gz /exploration-tests/${PROJECT}/target/surefire-reports
3038
- tar czf ${PROJECT}_debugger-dumps.tar.gz /tmp/debugger
3139
stage: exploration-tests
32-
when: manual
3340
tags: [ "runner:main"]
34-
needs: []
3541
image: $EXPLORATION_TESTS_IMAGE
3642
artifacts:
3743
paths:
38-
- ${PROJECT}_agent.log.gz
39-
- ${PROJECT}_surefire-reports.tar.gz
40-
- ${PROJECT}_debugger-dumps.tar.gz
44+
- "*_agent.log.gz"
45+
- "*_surefire-reports.tar.gz"
46+
- "*_debugger-dumps.tar.gz"
4147

4248
exploration-tests-jsoup:
49+
needs: [ build ]
50+
dependencies:
51+
- build
52+
<<: *common-exploration-tests
4353
variables:
4454
PROJECT: jsoup
45-
<<: *common-exploration-tests
4655
script:
47-
- ./run-exploration-tests.sh "$PROJECT" "mvn verify" "include_jsoup.txt" "exclude_jsoup.txt"
48-
56+
- ./run-exploration-tests.sh "$PROJECT" "mvn verify" "include_${PROJECT}.txt" "exclude_${PROJECT}.txt"
4957

5058
exploration-tests-jackson-core:
59+
needs: [ build ]
60+
dependencies:
61+
- build
5162
<<: *common-exploration-tests
5263
variables:
5364
PROJECT: jackson-core
5465
script:
55-
- ./run-exploration-tests.sh "$PROJECT" "./mvnw verify"
66+
- ./run-exploration-tests.sh "$PROJECT" "mvn verify" "include_${PROJECT}.txt" "exclude_${PROJECT}.txt"
5667

5768
exploration-tests-jackson-databind:
69+
needs: [ build ]
70+
dependencies:
71+
- build
5872
<<: *common-exploration-tests
5973
variables:
6074
PROJECT: jackson-databind
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
java=8.0.372-tem
2+
maven=3.8.4

dd-java-agent/agent-debugger/exploration-tests/Dockerfile.exploration-tests

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
11
FROM debian:bookworm-slim
22

3-
ARG JAVA_8_VERSION="8.0.372-tem"
4-
ARG JAVA_11_VERSION="11.0.19-tem"
5-
ARG JAVA_17_VERSION="17.0.7-tem"
6-
ARG JAVA_21_VERSION="21.0.4-tem"
7-
ARG MAVEN_VERSION=3.8.4
8-
93
RUN apt-get update && \
104
DEBIAN_FRONTEND=noninteractive apt-get install -y procps tini build-essential git curl unzip zip && \
115
apt-get -y clean && \
126
rm -rf /var/lib/apt/lists/*
137

148
# install sdkman
9+
COPY .sdkmanrc .
1510
RUN curl -s "https://get.sdkman.io" | bash
1611
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && \
17-
yes | sdk install java $JAVA_8_VERSION && \
18-
yes | sdk install java $JAVA_11_VERSION && \
19-
yes | sdk install java $JAVA_17_VERSION && \
20-
yes | sdk install java $JAVA_21_VERSION && \
21-
yes | sdk install maven $MAVEN_VERSION && \
22-
rm -rf $HOME/.sdkman/archives/* && \
23-
rm -rf $HOME/.sdkman/tmp/*"
24-
ENV JAVA_8_HOME=/root/.sdkman/candidates/java/$JAVA_8_VERSION
25-
ENV JAVA_11_HOME=/root/.sdkman/candidates/java/$JAVA_11_VERSION
26-
ENV JAVA_17_HOME=/root/.sdkman/candidates/java/$JAVA_17_VERSION
27-
ENV JAVA_21_HOME=/root/.sdkman/candidates/java/$JAVA_21_VERSION
12+
sdk env install && \
13+
sdk flush"
2814

2915
RUN mkdir exploration-tests
3016
WORKDIR /exploration-tests
@@ -37,10 +23,13 @@ RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jsoup && mvn verify -
3723

3824

3925
# Jackson
40-
#RUN git clone https://github.com/FasterXML/jackson-core.git
41-
#RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-core && ./mvnw dependency:resolve dependency:resolve-plugins"
42-
#RUN git clone https://github.com/FasterXML/jackson-databind.git
43-
#RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-databind && ./mvnw dependency:resolve dependency:resolve-plugins"
26+
RUN git clone -b 2.16 https://github.com/FasterXML/jackson-core.git
27+
COPY jackson-core_exploration-tests.patch .
28+
# fix tests that are failing because timeout
29+
RUN cd jackson-core && git apply /exploration-tests/jackson-core_exploration-tests.patch
30+
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-core && mvn verify -DskipTests=true"
31+
RUN git clone -b 2.16 https://github.com/FasterXML/jackson-databind.git
32+
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-databind && mvn verify -DskipTests=true"
4433

4534
# Netty
4635
#RUN git clone https://github.com/netty/netty.git
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
com/fasterxml/jackson/databind/BaseTest
2+
com/fasterxml/jackson/databind/type/TypeFactory
3+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com/fasterxml/*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com/fasterxml/*
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/src/test/java/com/fasterxml/jackson/core/json/async/AsyncConcurrencyTest.java b/src/test/java/com/fasterxml/jackson/core/json/async/AsyncConcurrencyTest.java
2+
index 2f7957d1..7a8ea388 100644
3+
--- a/src/test/java/com/fasterxml/jackson/core/json/async/AsyncConcurrencyTest.java
4+
+++ b/src/test/java/com/fasterxml/jackson/core/json/async/AsyncConcurrencyTest.java
5+
@@ -145,7 +145,7 @@ public class AsyncConcurrencyTest extends AsyncTestBase
6+
futures.add(executor.submit(c));
7+
}
8+
executor.shutdown();
9+
- executor.awaitTermination(5, TimeUnit.SECONDS);
10+
+ executor.awaitTermination(10, TimeUnit.SECONDS);
11+
int count = errorCount.get();
12+
13+
if (count > 0) {

0 commit comments

Comments
 (0)