Skip to content
Permalink
Browse files
Add external zk case configurations (#209)
  • Loading branch information
kylixs committed Jan 4, 2021
1 parent 94d7678 commit 363f454aceed339fe7f08948bef577de8dd212a4
Showing 10 changed files with 154 additions and 142 deletions.
@@ -0,0 +1,24 @@
# 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.

from: app-external-zookeeper.yml

props:
project_name: dubbo-samples-generic-call
project_dir: dubbo-samples-generic-call-provider
main_class: org.apache.dubbo.samples.generic.call.GenericCallProvider
dubbo_port: 20880

@@ -0,0 +1,23 @@
# 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.

from: app-external-zookeeper.yml

props:
project_name: dubbo-samples-servicelevel-override
main_class: org.apache.dubbo.samples.governance.BasicProvider
dubbo_port: 20880

@@ -0,0 +1,23 @@
# 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.

from: app-external-zookeeper.yml

props:
project_name: dubbo-samples-monitor
main_class: org.apache.dubbo.samples.monitor.BasicProvider
dubbo_port: 20880

@@ -32,28 +32,43 @@
<dubbo.version>2.7.7</dubbo.version>
<spring.version>4.3.16.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>
<jib-maven-plugin.version>1.2.0</jib-maven-plugin.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
<image.name>${project.artifactId}:${dubbo.version}</image.name>
<java-image.name>openjdk:8</java-image.name>
<dubbo.port>20890</dubbo.port>
<zookeeper.port>2181</zookeeper.port>
<main-class>org.apache.dubbo.samples.monitor.BasicProvider</main-class>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-bom</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
</dependency>

@@ -67,133 +82,11 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>dubbo-integration-test</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-maven-address-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<goals>
<goal>local-address</goal>
</goals>
<configuration>
<localAddress>dubbo-local-address</localAddress>
</configuration>
<phase>initialize</phase>
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<configuration>
<from>
<image>${java-image.name}</image>
</from>
<to>
<image>${image.name}</image>
</to>
<container>
<mainClass>${main-class}</mainClass>
<environment>
<DUBBO_IP_TO_REGISTRY>${dubbo-local-address}</DUBBO_IP_TO_REGISTRY>
</environment>
<jvmFlags>
<jvmFlag>-Dzookeeper.address=${dubbo-local-address}</jvmFlag>
</jvmFlags>
</container>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>dockerBuild</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
<configuration>
<images>
<image>
<name>zookeeper:latest</name>
<run>
<ports>
<port>${zookeeper.port}:${zookeeper.port}</port>
</ports>
</run>
</image>
<image>
<name>${image.name}</name>
<run>
<ports>
<port>${dubbo.port}:${dubbo.port}</port>
</ports>
<wait>
<log>dubbo service started</log>
</wait>
</run>
</image>
</images>
</configuration>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<zookeeper.address>${dubbo-local-address}</zookeeper.address>
</systemPropertyVariables>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- For jdk 11 above JavaEE annotation -->
<profile>
<id>javax.annotation</id>
@@ -29,7 +29,7 @@

<dubbo:registry address="zookeeper://${zookeeper.address:127.0.0.1}:2181"/>

<dubbo:protocol name="dubbo" port="20890"/>
<dubbo:protocol name="dubbo" port="20880"/>

<bean id="demoService" class="org.apache.dubbo.samples.monitor.impl.DemoServiceImpl"/>

@@ -0,0 +1,24 @@
# 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.

from: app-external-zookeeper.yml

props:
project_name: dubbo-samples-protostuff
project_dir: dubbo-samples-protostuff-provider
main_class: org.dubbo.samples.protostuff.provider.ProviderApp
dubbo_port: 20880

@@ -0,0 +1,23 @@
# 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.

from: app-external-zookeeper.yml

props:
project_name: dubbo-samples-sentinel
main_class: org.apache.samples.sentinel.FooProviderBootstrap
dubbo_port: 20880

@@ -27,13 +27,14 @@
props:
# project_name: dubbo-samples-xxx
# main_class: org.apache.dubbo.samples.xxx.XxxProviderBootstrap
project_dir: .
zookeeper_port: 2181
dubbo_port: 20880

services:
${project_name}:
type: app
basedir: .
basedir: ${project_dir}
mainClass: ${main_class}
systemProps:
- zookeeper.address=${project_name}
@@ -45,7 +46,7 @@ services:

${project_name}-test:
type: test
basedir: .
basedir: ${project_dir}
tests:
- "**/*IT.class"
systemProps:
@@ -27,6 +27,7 @@
props:
# project_name: dubbo-samples-xxx
# main_class: org.apache.dubbo.samples.xxx.XxxProviderBootstrap
project_dir: .
dubbo_port: 20880
zookeeper_version: latest

@@ -36,7 +37,7 @@ services:

${project_name}:
type: app
basedir: .
basedir: ${project_dir}
mainClass: ${main_class}
systemProps:
- zookeeper.address=zookeeper
@@ -49,7 +50,7 @@ services:

${project_name}-test:
type: test
basedir: .
basedir: ${project_dir}
tests:
- "**/*IT.class"
systemProps:
@@ -161,11 +161,11 @@ function process_case() {
fi

#check build
echo "$log_prefix Checking project artifacts .."
if [ ! -d "$project_home/target" ]; then
echo "$log_prefix $TEST_FAILURE: Missing artifacts" | tee -a $testResultFile
return 1
fi
# echo "$log_prefix Checking project artifacts .."
# if [ ! -d "$project_home/target" ]; then
# echo "$log_prefix $TEST_FAILURE: Missing artifacts" | tee -a $testResultFile
# return 1
# fi

# generate case configuration
mkdir -p $scenario_home/logs

0 comments on commit 363f454

Please sign in to comment.