Skip to content
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

Refactor exploration tests #8150

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
44 changes: 29 additions & 15 deletions .gitlab/exploration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,63 @@ build-exploration-tests-image:
- docker push $EXPLORATION_TESTS_IMAGE

.common-exploration-tests: &common-exploration-tests
rules:
- if: '$POPULATE_CACHE'
when: never
- if: $CI_PIPELINE_SOURCE != "schedule"
changes:
paths:
- dd-java-agent/agent-debugger/**/*
compare_to: "master"
when: on_success
- when: manual
allow_failure: true
before_script:
- source $HOME/.sdkman/bin/sdkman-init.sh
- export JAVA_HOME=$JAVA_8_HOME
- ./gradlew :dd-java-agent:shadowJar --no-scan
- cp workspace/dd-java-agent/build/libs/*.jar /exploration-tests/dd-java-agent.jar
- cp dd-java-agent/agent-debugger/exploration-tests/run-exploration-tests.sh /exploration-tests
- cp dd-java-agent/agent-debugger/exploration-tests/exclude_*.txt /exploration-tests
- cp dd-java-agent/agent-debugger/exploration-tests/include_*.txt /exploration-tests
- source $HOME/.sdkman/bin/sdkman-init.sh && cd / && sdk env
- cd /exploration-tests
- java -version
after_script:
- echo "$PROJECT"
- cd $CI_PROJECT_DIR
- cp /exploration-tests/$PROJECT/agent.log ${PROJECT}_agent.log
- cp /exploration-tests/${PROJECT}/agent.log ${PROJECT}_agent.log
- gzip ${PROJECT}_agent.log
- tar czf ${PROJECT}_surefire-reports.tar.gz /exploration-tests/${PROJECT}/target/surefire-reports
- tar czf ${PROJECT}_debugger-dumps.tar.gz /tmp/debugger
stage: exploration-tests
when: manual
tags: [ "runner:main"]
needs: []
image: $EXPLORATION_TESTS_IMAGE
artifacts:
paths:
- ${PROJECT}_agent.log.gz
- ${PROJECT}_surefire-reports.tar.gz
- ${PROJECT}_debugger-dumps.tar.gz
- "*_agent.log.gz"
- "*_surefire-reports.tar.gz"
- "*_debugger-dumps.tar.gz"

exploration-tests-jsoup:
needs: [ build ]
dependencies:
- build
<<: *common-exploration-tests
variables:
PROJECT: jsoup
<<: *common-exploration-tests
script:
- ./run-exploration-tests.sh "$PROJECT" "mvn verify" "include_jsoup.txt" "exclude_jsoup.txt"

- ./run-exploration-tests.sh "$PROJECT" "mvn verify" "include_${PROJECT}.txt" "exclude_${PROJECT}.txt"

exploration-tests-jackson-core:
needs: [ build ]
dependencies:
- build
<<: *common-exploration-tests
variables:
PROJECT: jackson-core
script:
- ./run-exploration-tests.sh "$PROJECT" "./mvnw verify"
- ./run-exploration-tests.sh "$PROJECT" "mvn verify" "include_${PROJECT}.txt" "exclude_${PROJECT}.txt"

exploration-tests-jackson-databind:
needs: [ build ]
dependencies:
- build
<<: *common-exploration-tests
variables:
PROJECT: jackson-databind
Expand Down
2 changes: 2 additions & 0 deletions dd-java-agent/agent-debugger/exploration-tests/.sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
java=8.0.372-tem
maven=3.8.4
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
FROM debian:bookworm-slim

ARG JAVA_8_VERSION="8.0.372-tem"
ARG JAVA_11_VERSION="11.0.19-tem"
ARG JAVA_17_VERSION="17.0.7-tem"
ARG JAVA_21_VERSION="21.0.4-tem"
ARG MAVEN_VERSION=3.8.4

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y procps tini build-essential git curl unzip zip && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*

# install sdkman
COPY .sdkmanrc .
RUN curl -s "https://get.sdkman.io" | bash
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && \
yes | sdk install java $JAVA_8_VERSION && \
yes | sdk install java $JAVA_11_VERSION && \
yes | sdk install java $JAVA_17_VERSION && \
yes | sdk install java $JAVA_21_VERSION && \
yes | sdk install maven $MAVEN_VERSION && \
rm -rf $HOME/.sdkman/archives/* && \
rm -rf $HOME/.sdkman/tmp/*"
ENV JAVA_8_HOME=/root/.sdkman/candidates/java/$JAVA_8_VERSION
ENV JAVA_11_HOME=/root/.sdkman/candidates/java/$JAVA_11_VERSION
ENV JAVA_17_HOME=/root/.sdkman/candidates/java/$JAVA_17_VERSION
ENV JAVA_21_HOME=/root/.sdkman/candidates/java/$JAVA_21_VERSION
sdk env install && \
sdk flush"

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


# Jackson
#RUN git clone https://github.com/FasterXML/jackson-core.git
#RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-core && ./mvnw dependency:resolve dependency:resolve-plugins"
#RUN git clone https://github.com/FasterXML/jackson-databind.git
#RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-databind && ./mvnw dependency:resolve dependency:resolve-plugins"
RUN git clone -b 2.16 https://github.com/FasterXML/jackson-core.git
COPY jackson-core_exploration-tests.patch .
# fix tests that are failing because timeout
RUN cd jackson-core && git apply /exploration-tests/jackson-core_exploration-tests.patch
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-core && mvn verify -DskipTests=true"
RUN git clone -b 2.16 https://github.com/FasterXML/jackson-databind.git
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-databind && mvn verify -DskipTests=true"

# Netty
#RUN git clone https://github.com/netty/netty.git
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
com/fasterxml/jackson/databind/BaseTest
com/fasterxml/jackson/databind/type/TypeFactory

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com/fasterxml/*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com/fasterxml/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
index 2f7957d1..7a8ea388 100644
--- a/src/test/java/com/fasterxml/jackson/core/json/async/AsyncConcurrencyTest.java
+++ b/src/test/java/com/fasterxml/jackson/core/json/async/AsyncConcurrencyTest.java
@@ -145,7 +145,7 @@ public class AsyncConcurrencyTest extends AsyncTestBase
futures.add(executor.submit(c));
}
executor.shutdown();
- executor.awaitTermination(5, TimeUnit.SECONDS);
+ executor.awaitTermination(10, TimeUnit.SECONDS);
int count = errorCount.get();

if (count > 0) {
Loading