Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ inputs:
base_image_java:
description: "The Java Docker image under which this test case will run"
required: false
default: "adoptopenjdk/openjdk8:alpine"
default: "eclipse-temurin:8-jdk"
base_image_tomcat:
description: "The Tomcat Docker image under which this test case will run"
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/plugins-jdk17-test.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Build
uses: ./.github/actions/build
with:
base_image_java: eclipse-temurin:17-alpine
base_image_java: eclipse-temurin:17-jdk
base_image_tomcat: tomcat:8.5-jdk17-openjdk

test:
Expand Down
3 changes: 2 additions & 1 deletion docs/en/setup/service-agent/java-agent/Plugin-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ Every plugin maintained in the main repo requires corresponding test cases as we
2. JDK 8+
3. Docker
4. Docker Compose
5. socat (m1 arm64 required)

## Case Base Image Introduction

The test framework provides `JVM-container` and `Tomcat-container` base images including JDK8 and JDK17. You can choose the best one for your test case. If both are suitable for your case, **`JVM-container` is preferred**.

### JVM-container Image Introduction

[JVM-container](../../../../../test/plugin/containers/jvm-container) uses `adoptopenjdk/openjdk8:alpine-jre` as the base image. `JVM-container` supports JDK8 and JDK17 as well in CI, which inherits `adoptopenjdk/openjdk8:alpine-jre` and `eclipse-temurin:17-alpine`.
[JVM-container](../../../../../test/plugin/containers/jvm-container) uses `eclipse-temurin:8-jdk` as the base image. `JVM-container` supports JDK8 and JDK17 as well in CI, which inherits `eclipse-temurin:8-jdk` and `eclipse-temurin:17-alpine`.
It is supported to custom the base Java docker image by specify `base_image_java`.
The test case project must be packaged as `project-name.zip`, including `startup.sh` and uber jar, by using `mvn clean package`.

Expand Down
5 changes: 3 additions & 2 deletions test/plugin/containers/jvm-container/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.33.0</version>
<version>0.40.2</version>
<configuration>
<images>
<image>
Expand All @@ -52,7 +52,8 @@
<runCmds>
<run>chmod +x /usr/local/skywalking/run.sh</run>
<run>tar -xvf ../tools/skywalking-mock-collector.tar.gz -C ../tools</run>
<run>apk add --no-cache bash curl</run>
<run>apt-get update -y</run>
<run>apt-get install -y unzip</run>
Comment thread
kezhenxu94 marked this conversation as resolved.
</runCmds>
<cmd>["/usr/local/skywalking/run.sh"]</cmd>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ java -jar \
-Xmx256m -Xms256m \
-DcaseName="${SCENARIO_NAME}-${SCENARIO_VERSION}" \
-DtestCasePath=${SCENARIO_HOME}/data/ \
${TOOLS_HOME}/skywalking-validator.jar 1>${LOGS_HOME}/validatolr.out
${TOOLS_HOME}/skywalking-validator.jar &>${LOGS_HOME}/validator.out
status=$?

if [[ $status -eq 0 ]]; then
Expand Down
4 changes: 2 additions & 2 deletions test/plugin/containers/tomcat-container/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.33.0</version>
<version>0.40.2</version>
<configuration>
<images>
<image>
Expand Down Expand Up @@ -74,4 +74,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
7 changes: 6 additions & 1 deletion test/plugin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ scenarios_home="${home}/scenarios"
num_of_testcases=

container_image_version="1.0.0"
base_image_java="adoptopenjdk/openjdk8:alpine"
base_image_java="eclipse-temurin:8-jdk"
base_image_tomcat="tomcat:8.5-jdk8-openjdk"
jacoco_version="${JACOCO_VERSION:-0.8.6}"

Expand Down Expand Up @@ -151,6 +151,11 @@ agent_home_selector() {
start_stamp=`date +%s`
parse_commandline "$@"

if [[ $(uname) == 'Darwin' ]] && [[ $(uname -m) == 'arm64' ]]; then
socat TCP-LISTEN:2375,range=127.0.0.1/32,reuseaddr,fork UNIX-CLIENT:/var/run/docker.sock > /dev/null 2>&1 &
export DOCKER_HOST=tcp://127.0.0.1:2375
fi

if [[ "$cleanup" == "on" ]]; then
do_cleanup
[[ -z "${scenario_name}" ]] && exit 0
Expand Down