You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/06/30 02:49:54 UTC

[servicecomb-toolkit] branch master updated: [SCB-1334] Enable the Travis CI of the servicecomb-toolkit

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

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-toolkit.git


The following commit(s) were added to refs/heads/master by this push:
     new 020a05e  [SCB-1334] Enable the Travis CI of the servicecomb-toolkit
020a05e is described below

commit 020a05e392aaa3587277ac2d1cf62718507f027a
Author: MabinGo <bi...@huawei.com>
AuthorDate: Sat Jun 29 15:40:26 2019 +0800

    [SCB-1334] Enable the Travis CI of the servicecomb-toolkit
    
    Signed-off-by: MabinGo <bi...@huawei.com>
---
 .travis.yml                                        |  28 +++++
 cli/pom.xml                                        |   2 -
 codegen/pom.xml                                    |   1 -
 common/pom.xml                                     |   3 +-
 docgen/pom.xml                                     |   1 -
 .../coverage-aggregate}/pom.xml                    |  91 ++++++++---------
 integration-tests/pom.xml                          |  36 +++++++
 pom.xml                                            | 113 +++++++++++++++++++++
 scripts/test.sh                                    |  47 +++++++++
 toolkit-maven-plugin/pom.xml                       |   4 +-
 10 files changed, 268 insertions(+), 58 deletions(-)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..f044614
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,28 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+sudo: required
+
+cache:
+  directories:
+  - "$HOME/.m2"
+
+language: java
+
+install: true
+
+script: ./scripts/test.sh
diff --git a/cli/pom.xml b/cli/pom.xml
index f5b88bf..e6a6464 100755
--- a/cli/pom.xml
+++ b/cli/pom.xml
@@ -49,7 +49,6 @@
     <dependency>
       <groupId>org.apache.servicecomb.toolkit</groupId>
       <artifactId>codegen</artifactId>
-      <version>${project.version}</version>
     </dependency>
 
     <dependency>
@@ -62,7 +61,6 @@
     <dependency>
       <groupId>org.apache.servicecomb.toolkit</groupId>
       <artifactId>docgen</artifactId>
-      <version>${project.version}</version>
     </dependency>
 
     <dependency>
diff --git a/codegen/pom.xml b/codegen/pom.xml
index 7bb289d..001014a 100755
--- a/codegen/pom.xml
+++ b/codegen/pom.xml
@@ -40,7 +40,6 @@
     <dependency>
       <groupId>org.apache.servicecomb.toolkit</groupId>
       <artifactId>core</artifactId>
-      <version>${project.version}</version>
     </dependency>
 
     <dependency>
diff --git a/common/pom.xml b/common/pom.xml
index 38829a4..5dc0b75 100755
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -26,13 +26,12 @@
   </parent>
   <modelVersion>4.0.0</modelVersion>
 
-  <artifactId>toolkit-common</artifactId>
+  <artifactId>common</artifactId>
 
   <dependencies>
     <dependency>
       <groupId>org.apache.servicecomb.toolkit</groupId>
       <artifactId>core</artifactId>
-      <version>${project.version}</version>
     </dependency>
 
     <dependency>
diff --git a/docgen/pom.xml b/docgen/pom.xml
index b397a65..bf28a1e 100755
--- a/docgen/pom.xml
+++ b/docgen/pom.xml
@@ -43,7 +43,6 @@
     <dependency>
       <groupId>org.apache.servicecomb.toolkit</groupId>
       <artifactId>core</artifactId>
-      <version>${project.version}</version>
     </dependency>
 
     <dependency>
diff --git a/docgen/pom.xml b/integration-tests/coverage-aggregate/pom.xml
old mode 100755
new mode 100644
similarity index 51%
copy from docgen/pom.xml
copy to integration-tests/coverage-aggregate/pom.xml
index b397a65..15cdf73
--- a/docgen/pom.xml
+++ b/integration-tests/coverage-aggregate/pom.xml
@@ -20,73 +20,66 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <parent>
-    <artifactId>toolkit</artifactId>
+    <artifactId>integration-tests</artifactId>
     <groupId>org.apache.servicecomb.toolkit</groupId>
     <version>0.1.0-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
 
-  <artifactId>docgen</artifactId>
-
-  <repositories>
-    <repository>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-      <id>jcenter-releases</id>
-      <name>jcenter</name>
-      <url>http://jcenter.bintray.com</url>
-    </repository>
-  </repositories>
+  <artifactId>coverage-aggregate</artifactId>
 
   <dependencies>
     <dependency>
       <groupId>org.apache.servicecomb.toolkit</groupId>
-      <artifactId>core</artifactId>
-      <version>${project.version}</version>
+      <artifactId>cli</artifactId>
     </dependency>
 
     <dependency>
-      <groupId>org.apache.servicecomb</groupId>
-      <artifactId>swagger-generator-core</artifactId>
-      <version>1.2.0</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.checkerframework</groupId>
-          <artifactId>checker-compat-qual</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>com.google.guava</groupId>
-          <artifactId>listenablefuture</artifactId>
-        </exclusion>
-      </exclusions>
+      <groupId>org.apache.servicecomb.toolkit</groupId>
+      <artifactId>codegen</artifactId>
     </dependency>
 
     <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-lang3</artifactId>
-      <version>3.4</version>
+      <groupId>org.apache.servicecomb.toolkit</groupId>
+      <artifactId>common</artifactId>
     </dependency>
 
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.12</version>
-      <scope>test</scope>
+      <groupId>org.apache.servicecomb.toolkit</groupId>
+      <artifactId>core</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>org.apache.servicecomb.toolkit</groupId>
+      <artifactId>docgen</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.servicecomb.toolkit</groupId>
+      <artifactId>toolkit-maven-plugin</artifactId>
+    </dependency>
   </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.1</version>
-        <configuration>
-          <source>1.8</source>
-          <target>1.8</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
+
+  <profiles>
+    <profile>
+      <id>jacoco</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.jacoco</groupId>
+            <artifactId>jacoco-maven-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>post-integration-test</phase>
+                <goals>
+                  <goal>report-aggregate</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+</project>
\ No newline at end of file
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
new file mode 100644
index 0000000..c90ae58
--- /dev/null
+++ b/integration-tests/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>toolkit</artifactId>
+    <groupId>org.apache.servicecomb.toolkit</groupId>
+    <version>0.1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>integration-tests</artifactId>
+  <packaging>pom</packaging>
+  <modules>
+    <module>coverage-aggregate</module>
+  </modules>
+
+
+</project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index bb76b6e..2877d0e 100755
--- a/pom.xml
+++ b/pom.xml
@@ -48,9 +48,108 @@
     <module>common</module>
     <module>toolkit-maven-plugin</module>
     <module>core</module>
+    <module>integration-tests</module>
   </modules>
 
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.servicecomb.toolkit</groupId>
+        <artifactId>cli</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.servicecomb.toolkit</groupId>
+        <artifactId>codegen</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.servicecomb.toolkit</groupId>
+        <artifactId>common</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.servicecomb.toolkit</groupId>
+        <artifactId>core</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.servicecomb.toolkit</groupId>
+        <artifactId>docgen</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.servicecomb.toolkit</groupId>
+        <artifactId>toolkit-maven-plugin</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
   <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.eluder.coveralls</groupId>
+          <artifactId>coveralls-maven-plugin</artifactId>
+          <version>4.3.0</version>
+          <configuration>
+            <jacocoReports>
+              <jacocoReport>
+                ${project.basedir}/integration-tests/coverage-aggregate/target/site/jacoco-aggregate/jacoco.xml
+              </jacocoReport>
+            </jacocoReports>
+          </configuration>
+        </plugin>
+
+        <plugin>
+          <groupId>org.jacoco</groupId>
+          <artifactId>jacoco-maven-plugin</artifactId>
+          <version>0.7.8</version>
+          <executions>
+            <execution>
+              <id>default-prepare-agent</id>
+              <goals>
+                <goal>prepare-agent</goal>
+              </goals>
+              <configuration>
+                <destFile>${project.build.directory}/jacoco.exec</destFile>
+              </configuration>
+            </execution>
+            <execution>
+              <id>default-prepare-agent-integration</id>
+              <phase>pre-integration-test</phase>
+              <goals>
+                <goal>prepare-agent-integration</goal>
+              </goals>
+              <configuration>
+                <destFile>${project.build.directory}/jacoco-it.exec</destFile>
+                <propertyName>jacoco.failsafe.argLine</propertyName>
+              </configuration>
+            </execution>
+            <execution>
+              <id>default-report</id>
+              <goals>
+                <goal>report</goal>
+              </goals>
+            </execution>
+            <execution>
+              <id>default-report-integration</id>
+              <goals>
+                <goal>report-integration</goal>
+              </goals>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+
+
     <plugins>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
@@ -119,4 +218,18 @@
     </plugins>
   </build>
 
+  <profiles>
+    <profile>
+      <id>jacoco</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.jacoco</groupId>
+            <artifactId>jacoco-maven-plugin</artifactId>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>
diff --git a/scripts/test.sh b/scripts/test.sh
new file mode 100755
index 0000000..9bdbf81
--- /dev/null
+++ b/scripts/test.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+#bin/sh
+
+##Check if the commit is tagged commit or not
+TAGGEDCOMMIT=$(git tag -l --contains HEAD)
+if [ "$TAGGEDCOMMIT" == "" ]; then
+    TAGGEDCOMMIT=false
+else
+    TAGGEDCOMMIT=true
+fi
+echo $TAGGEDCOMMIT
+
+if [ "$TAGGEDCOMMIT" == "true" ]; then
+	echo "Skipping the installation as it is tagged commit"
+else
+	mvn apache-rat:check
+	if [ $? != 0 ]; then
+		echo "${red}Rat check failed.${reset}"
+		exit 1
+	fi
+	
+	echo "Running the unit tests and integration tests here!"
+	##mvn clean install -Pjacoco coveralls:report
+	mvn clean install -Pjacoco
+if [ $? == 0 ]; then
+	echo "${green}Installation Success..${reset}"
+else
+	echo "${red}Installation or Test Cases failed, please check the above logs for more details.${reset}"
+	exit 1
+fi
+fi
diff --git a/toolkit-maven-plugin/pom.xml b/toolkit-maven-plugin/pom.xml
index 0bcb3bc..b46c38e 100755
--- a/toolkit-maven-plugin/pom.xml
+++ b/toolkit-maven-plugin/pom.xml
@@ -32,7 +32,6 @@
     <dependency>
       <groupId>org.apache.servicecomb.toolkit</groupId>
       <artifactId>docgen</artifactId>
-      <version>${project.version}</version>
     </dependency>
 
     <dependency>
@@ -61,8 +60,7 @@
 
     <dependency>
       <groupId>org.apache.servicecomb.toolkit</groupId>
-      <artifactId>toolkit-common</artifactId>
-      <version>${project.version}</version>
+      <artifactId>common</artifactId>
     </dependency>
 
     <!-- for test -->