You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2021/03/28 05:46:09 UTC

[skywalking] 01/01: Remove binary files and download them in CI process instead

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch chore/remove-binary-files
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit d44e8ddbbc602277c2356d3fe80e1306ee526d30
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Sun Mar 28 13:45:43 2021 +0800

    Remove binary files and download them in CI process instead
---
 .gitignore                  |   1 +
 test/e2e/e2e-test/pom.xml   |  26 ++++++++++++++++++++++++++
 test/e2e/pom.xml            |   1 +
 test/jacoco/jacocoagent.jar | Bin 281989 -> 0 bytes
 test/jacoco/jacococli.jar   | Bin 551134 -> 0 bytes
 test/plugin/run.sh          |  14 +++++++++++---
 6 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 181769e..c442cb7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@ OALLexer.tokens
 /test/jacoco/classes
 /test/jacoco/*.exec
 oap-server/oal-grammar/**/gen/
+test/jacoco
diff --git a/test/e2e/e2e-test/pom.xml b/test/e2e/e2e-test/pom.xml
index d0d79da..ffdea09 100755
--- a/test/e2e/e2e-test/pom.xml
+++ b/test/e2e/e2e-test/pom.xml
@@ -74,4 +74,30 @@
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>${maven-antrun-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <id>download-jars</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <target>
+                                <mkdir dir="${project.basedir}/../../jacoco"/>
+                                <get dest="${project.basedir}/../../jacoco/jacocoagent.jar" src="https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.6/org.jacoco.agent-0.8.6-runtime.jar"/>
+                                <get dest="${project.basedir}/../../jacoco/jacococli.jar" src="https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.6/org.jacoco.cli-0.8.6.jar"/>
+                            </target>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
diff --git a/test/e2e/pom.xml b/test/e2e/pom.xml
index e395998..6371c82 100644
--- a/test/e2e/pom.xml
+++ b/test/e2e/pom.xml
@@ -71,6 +71,7 @@
         <maven-failsafe-plugin.version>2.22.0</maven-failsafe-plugin.version>
         <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
         <maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
+        <maven-antrun-plugin.version>3.0.0</maven-antrun-plugin.version>
 
         <testcontainers.version>1.15.1</testcontainers.version>
     </properties>
diff --git a/test/jacoco/jacocoagent.jar b/test/jacoco/jacocoagent.jar
deleted file mode 100644
index 3d840bc..0000000
Binary files a/test/jacoco/jacocoagent.jar and /dev/null differ
diff --git a/test/jacoco/jacococli.jar b/test/jacoco/jacococli.jar
deleted file mode 100644
index 20ba974..0000000
Binary files a/test/jacoco/jacococli.jar and /dev/null differ
diff --git a/test/plugin/run.sh b/test/plugin/run.sh
index ba44620..7e6748a 100755
--- a/test/plugin/run.sh
+++ b/test/plugin/run.sh
@@ -32,6 +32,10 @@ num_of_testcases=
 
 image_version="jdk8-1.0.0"
 
+if [[ $(uname) == "Darwin" ]]; then
+    SP=" "
+fi
+
 print_help() {
     echo  "Usage: run.sh [OPTION] SCENARIO_NAME"
     echo -e "\t-f, --force_build \t\t do force to build Plugin-Test tools and images"
@@ -141,10 +145,10 @@ if [[ ! -d ${agent_home} ]]; then
     ${mvnw} --batch-mode -f ${home}/../../pom.xml -Pagent -DskipTests clean package
 fi
 # if it fails last time, relevant information will be deleted
-sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
+sed -i"${SP}"'' "#<sourceDirectory>scenarios#$scenario_name</sourceDirectory>#d" ./pom.xml
 # add scenario_name into plugin/pom.xml
 echo check code with the checkstyle-plugin
-sed -i '/<\/sourceDirectories>/i <sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>' ./pom.xml
+sed -i"${SP}"'' "#</sourceDirectories>#i <sourceDirectory>scenarios#$scenario_name</sourceDirectory>" ./pom.xml
 
 if [[ "$force_build" == "on" ]]; then
     profile=
@@ -152,7 +156,7 @@ if [[ "$force_build" == "on" ]]; then
     ${mvnw} --batch-mode -f ${home}/pom.xml clean package -DskipTests ${profile}
 fi
 # remove scenario_name into plugin/pom.xml
-sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
+sed -i"${SP}"'' "#<sourceDirectory>scenarios/$scenario_name</sourceDirectory>#d" ./pom.xml
 
 workspace="${home}/workspace/${scenario_name}"
 [[ -d ${workspace} ]] && rm -rf $workspace
@@ -181,6 +185,10 @@ if [[ -n "${running_mode}" ]]; then
     agent_home_selector ${running_mode} ${with_plugins}
 fi
 
+mkdir -p "${jacoco_home}"
+ls "${jacoco_home}"/jacocoagent.jar || curl -Lso "${jacoco_home}"/jacocoagent.jar https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.6/org.jacoco.agent-0.8.6-runtime.jar
+ls "${jacoco_home}"/jacocoacli.jar || curl -Lso "${jacoco_home}"/jacocoacli.jar https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.6/org.jacoco.cli-0.8.6.jar
+
 supported_versions=`grep -v -E "^$|^#" ${supported_version_file}`
 for version in ${supported_versions}
 do