Skip to content

Commit

Permalink
Support plugin tests on arm64/v8(aarm) platforms (apache#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
lujiajing1126 authored Nov 8, 2022
1 parent 70b3e88 commit 1ef7cb4
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
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
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Release Notes.
8.14.0
------------------


* Polish test framework to support `arm64/v8` platforms

#### Documentation

Expand Down
2 changes: 1 addition & 1 deletion docs/en/setup/service-agent/java-agent/Plugin-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The test framework provides `JVM-container` and `Tomcat-container` base images i

### 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-jdk`.
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
6 changes: 4 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,9 @@
<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>
<run>rm -rf /var/lib/apt/lists/*</run>
</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 1>${LOGS_HOME}/validator.out
status=$?

if [[ $status -eq 0 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion 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
12 changes: 10 additions & 2 deletions 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 @@ -148,6 +148,14 @@ agent_home_selector() {
_agent_home=${target_agent_home}
}

remove_dir() {
dir=$1
if [[ "${os}" == "Darwin" ]]; then
find ${dir} -type d -exec chmod -a "$(whoami) deny delete" {} \;
fi
rm -rf $dir
}

start_stamp=`date +%s`
parse_commandline "$@"

Expand Down Expand Up @@ -257,7 +265,7 @@ do
bash ${case_work_base}/scenario.sh $debug_mode 1>${case_work_logs_dir}/${testcase_name}.log
status=$?
if [[ $status == 0 ]]; then
[[ -z $debug_mode ]] && rm -rf ${case_work_base}
[[ -z $debug_mode ]] && remove_dir ${case_work_base}
else
exitWithMessage "Testcase ${testcase_name} failed!"
fi
Expand Down

0 comments on commit 1ef7cb4

Please sign in to comment.