-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1189 from hanbingleixue/develop
【enhancement】提交离群实例摘除插件的集成测试
- Loading branch information
Showing
37 changed files
with
1,274 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: "Dubbo Removal Test" | ||
description: "Automated testing of outlier instance removal plug-in duddo scenario" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: removal-entry | ||
uses: ./.github/actions/common/entry | ||
with: | ||
log-dir: ./logs/dubbo-removal | ||
- name: package dubbo 2.5.x tests | ||
shell: bash | ||
if: matrix.dubbo-version == '2-5' | ||
run: mvn package -Dalibaba.dubbo.version=2.5.${{ matrix.dubbo-versions }} -DskipTests -P260 --file sermant-integration-tests/dubbo-test/pom.xml | ||
- name: package dubbo 2.6.0 tests | ||
shell: bash | ||
if: matrix.dubbo-version == '2-6' && matrix.dubbo-versions == '0' | ||
run: mvn package -Dalibaba.dubbo.version=2.6.${{ matrix.dubbo-versions }} -DskipTests -P260 --file sermant-integration-tests/dubbo-test/pom.xml | ||
- name: package dubbo 2.6.x tests | ||
shell: bash | ||
if: matrix.dubbo-version == '2-6' && matrix.dubbo-versions != '0' | ||
run: mvn package -Dalibaba.dubbo.version=2.6.${{ matrix.dubbo-versions }} -DskipTests --file sermant-integration-tests/dubbo-test/pom.xml | ||
- name: package dubbo 2.7.x tests | ||
shell: bash | ||
if: matrix.dubbo-version == '2-7' | ||
run: mvn package -Ddubbo.version=2.7.${{ matrix.dubbo-versions }} -DskipTests --file sermant-integration-tests/dubbo-test/pom.xml | ||
- name: start provider service | ||
shell: bash | ||
env: | ||
TIMEOUT: 2000 | ||
SERVER_PORT: 28021 | ||
DUBBO_PROTOCOL_PORT: 28821 | ||
run: | | ||
nohup java -jar sermant-integration-tests/dubbo-test/dubbo-${{ env.projectPath }}-integration-provider/target/dubbo-integration-provider.jar > ${{ env.logDir }}/removal-provider-28021.log 2>&1 & | ||
- name: start provider service | ||
shell: bash | ||
env: | ||
TIMEOUT: 0 | ||
SERVER_PORT: 28022 | ||
DUBBO_PROTOCOL_PORT: 28822 | ||
run: | | ||
nohup java -jar sermant-integration-tests/dubbo-test/dubbo-${{ env.projectPath }}-integration-provider/target/dubbo-integration-provider.jar > ${{ env.logDir }}/removal-provider-28022.log 2>&1 & | ||
- name: start provider service | ||
shell: bash | ||
env: | ||
TIMEOUT: 0 | ||
SERVER_PORT: 28023 | ||
DUBBO_PROTOCOL_PORT: 28823 | ||
run: | | ||
nohup java -jar sermant-integration-tests/dubbo-test/dubbo-${{ env.projectPath }}-integration-provider/target/dubbo-integration-provider.jar > ${{ env.logDir }}/removal-provider-28023.log 2>&1 & | ||
- name: start consumer service | ||
shell: bash | ||
env: | ||
REMOVAL_CONFIG_EXPIRE_TIMES: 60000 | ||
REMOVAL_CONFIG_EXCEPTIONS: "[com.alibaba.dubbo.remoting.TimeoutException, org.apache.dubbo.remoting.TimeoutException, java.util.concurrent.TimeoutException, java.net.SocketTimeoutException]" | ||
REMOVAL_CONFIG_ENABLE_REMOVAL: true | ||
REMOVAL_CONFIG_RECOVERY_TIMES: 30000 | ||
REMOVAL_CONFIG_WINDOWS_TIMES: 1000 | ||
REMOVAL_CONFIG_WINDOWS_NUM: 10 | ||
REMOVAL_CONFIG_RULES: "[{ scaleUpLimit: 0.6, minInstanceNum: 1, errorRate: 0.6 , key: default-rule}]" | ||
SERVER_PORT: 28020 | ||
DUBBO_PROTOCOL_PORT: 28820 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=dubbo-integration-consumer -jar \ | ||
sermant-integration-tests/dubbo-test/dubbo-${{ env.projectPath }}-integration-consumer/target/dubbo-integration-consumer.jar > ${{ env.logDir }}/removal-consumer-28050.log 2>&1 & | ||
- name: waiting for services start | ||
shell: bash | ||
run: | | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:28020/actuator/health 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:28021/actuator/health 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:28022/actuator/health 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:28023/actuator/health 120 | ||
- name: removal test | ||
shell: bash | ||
env: | ||
TEST_TYPE: removal | ||
run: mvn test --file sermant-integration-tests/dubbo-test/pom.xml | ||
- name: exit | ||
if: always() | ||
uses: ./.github/actions/common/exit | ||
with: | ||
processor-keyword: dubbo | ||
- name: upload error log | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ failure() || cancelled() }} | ||
with: | ||
name: removal-(${{ matrix.dubbo-version }}-${{ matrix.dubbo-versions }})-logs | ||
path: | | ||
./*.log | ||
./logs/**/*.log | ||
if-no-files-found: warn | ||
retention-days: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
name: "Spring Removal Test" | ||
description: "Auto test for spring removal for plugin sermant-removal" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: entry | ||
uses: ./.github/actions/common/entry | ||
with: | ||
log-dir: ./logs/spring-removal | ||
- name: 1.5.x config | ||
if: matrix.springBootVersion == '1.5.0.RELEASE' && matrix.springCloudVersion == 'Edgware.SR2' | ||
shell: bash | ||
run: | | ||
echo "tailVersion=-1.5.x" >> $GITHUB_ENV | ||
echo "healthApi=health" >> $GITHUB_ENV | ||
- name: 2.x config | ||
if: matrix.springBootVersion != '1.5.0.RELEASE' | ||
shell: bash | ||
run: | | ||
echo "healthApi=actuator/health" >> $GITHUB_ENV | ||
- name: package common demos | ||
shell: bash | ||
run: | | ||
sed -i 's|<version>${{ env.projectSpringBootVersion }}</version>|<version>${{ matrix.springBootVersion }}</version>|g' sermant-integration-tests/spring-test/pom.xml | ||
mvn package -Dspring.cloud.version=${{ matrix.springCloudVersion }} -Dspring.boot.version=${{ matrix.springBootVersion }} -DskipTests -P common-test${{ env.tailVersion }} --file sermant-integration-tests/spring-test/pom.xml | ||
- name: post config | ||
shell: bash | ||
run: bash ./sermant-integration-tests/scripts/createStrategy.sh all | ||
- name: start feign provider service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
NIWS_LOADBALANCER_AVAILABILITY_FILTERING_RULE_FILTER_CIRCUIT_TRIPPED: false | ||
SERVER_PORT: 8013 | ||
SPRING_APPLICATION_NAME: removal-provider | ||
TIMEOUT: 0 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-provider${{ env.tailVersion }}/target/feign-provider${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-provider.log 2>&1 & | ||
- name: start second feign provider service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
NIWS_LOADBALANCER_AVAILABILITY_FILTERING_RULE_FILTER_CIRCUIT_TRIPPED: false | ||
SERVER_PORT: 8014 | ||
SPRING_APPLICATION_NAME: removal-provider | ||
TIMEOUT: 0 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-provider${{ env.tailVersion }}/target/feign-provider${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-provider2.log 2>&1 & | ||
- name: start third feign provider service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
NIWS_LOADBALANCER_AVAILABILITY_FILTERING_RULE_FILTER_CIRCUIT_TRIPPED: false | ||
SERVER_PORT: 8015 | ||
SPRING_APPLICATION_NAME: removal-provider | ||
TIMEOUT: 2000 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-provider${{ env.tailVersion }}/target/feign-provider${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-provider3.log 2>&1 & | ||
- name: start fourth feign provider service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
NIWS_LOADBALANCER_AVAILABILITY_FILTERING_RULE_FILTER_CIRCUIT_TRIPPED: false | ||
SERVER_PORT: 8016 | ||
SPRING_APPLICATION_NAME: removal-provider | ||
TIMEOUT: 2000 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-provider${{ env.tailVersion }}/target/feign-provider${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-provider4.log 2>&1 & | ||
- name: start feign consumer service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
REMOVAL_CONFIG_EXPIRE_TIMES: 60000 | ||
REMOVAL_CONFIG_EXCEPTIONS: "[com.alibaba.dubbo.remoting.TimeoutException, org.apache.dubbo.remoting.TimeoutException, java.util.concurrent.TimeoutException, java.net.SocketTimeoutException]" | ||
REMOVAL_CONFIG_ENABLE_REMOVAL: true | ||
REMOVAL_CONFIG_RECOVERY_TIMES: 30000 | ||
REMOVAL_CONFIG_WINDOWS_TIMES: 1000 | ||
REMOVAL_CONFIG_WINDOWS_NUM: 10 | ||
REMOVAL_CONFIG_RULES: "[{ scaleUpLimit: 0.6, minInstanceNum: 1, errorRate: 0.6 , key: default-rule}]" | ||
NIWS_LOADBALANCER_AVAILABILITY_FILTERING_RULE_FILTER_CIRCUIT_TRIPPED: false | ||
SERVER_PORT: 8017 | ||
SERMANT_SPRINGBOOT_REGISTRY_LB_MAXRETRY: 0 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-consumer${{ env.tailVersion }}/target/feign-consumer${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-consumer.log 2>&1 & | ||
- name: start resttemplate provider service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
SERVER_PORT: 8018 | ||
TIMEOUT: 0 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-provider/target/rest-provider.jar > ${{ env.logDir }}/rest-provider.log 2>&1 & | ||
- name: start second resttemplate provider service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
SERVER_PORT: 8019 | ||
TIMEOUT: 0 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-provider/target/rest-provider.jar > ${{ env.logDir }}/rest-provider2.log 2>&1 & | ||
- name: start third resttemplate provider service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
SERVER_PORT: 8020 | ||
TIMEOUT: 0 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-provider/target/rest-provider.jar > ${{ env.logDir }}/rest-provider3.log 2>&1 & | ||
- name: start fourth resttemplate provider service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
SERVER_PORT: 8021 | ||
TIMEOUT: 2000 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-provider/target/rest-provider.jar > ${{ env.logDir }}/rest-provider4.log 2>&1 & | ||
- name: start resttemplate consumer service | ||
shell: bash | ||
env: | ||
SERMANT_SPRINGBOOT_REGISTRY_ENABLE_REGISTRY: true | ||
REMOVAL_CONFIG_EXPIRE_TIMES: 60000 | ||
REMOVAL_CONFIG_EXCEPTIONS: "[com.alibaba.dubbo.remoting.TimeoutException, org.apache.dubbo.remoting.TimeoutException, java.util.concurrent.TimeoutException, java.net.SocketTimeoutException]" | ||
REMOVAL_CONFIG_ENABLE_REMOVAL: true | ||
REMOVAL_CONFIG_RECOVERY_TIMES: 30000 | ||
REMOVAL_CONFIG_WINDOWS_TIMES: 1000 | ||
REMOVAL_CONFIG_WINDOWS_NUM: 10 | ||
REMOVAL_CONFIG_RULES: "[{ scaleUpLimit: 0.6, minInstanceNum: 1, errorRate: 0.6 , key: default-rule}]" | ||
NIWS_LOADBALANCER_AVAILABILITY_FILTERING_RULE_FILTER_CIRCUIT_TRIPPED: false | ||
SERVER_PORT: 8022 | ||
SERMANT_SPRINGBOOT_REGISTRY_LB_MAXRETRY: 0 | ||
TIMEOUT: 1000 | ||
run: | | ||
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ | ||
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-consumer/target/rest-consumer.jar > ${{ env.logDir }}/rest-consumer.log 2>&1 & | ||
- name: waiting for services start | ||
shell: bash | ||
run: | | ||
ps -ef | grep java | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8013/${{ env.healthApi }} 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8014/${{ env.healthApi }} 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8015/${{ env.healthApi }} 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8016/${{ env.healthApi }} 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8017/${{ env.healthApi }} 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8018/${{ env.healthApi }} 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8019/${{ env.healthApi }} 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8020/${{ env.healthApi }} 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8021/${{ env.healthApi }} 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8022/${{ env.healthApi }} 120 | ||
- name: integration test module REMOVAL | ||
shell: bash | ||
run: mvn test -Dsermant.integration.test.type=REMOVAL --file sermant-integration-tests/spring-test/pom.xml | ||
- name: exit | ||
if: always() | ||
uses: ./.github/actions/common/exit | ||
with: | ||
processor-keyword: feign|rest | ||
- name: if failure then upload error log | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ failure() || cancelled() }} | ||
with: | ||
name: (${{ github.job }})-graceful-(${{ matrix.springBootVersion }}-${{ matrix.springCloudVersion }})-logs | ||
path: | | ||
./*.log | ||
./logs/** | ||
if-no-files-found: warn | ||
retention-days: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...tion-consumer/src/main/java/com/huaweicloud/integration/controller/RemovalController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
package com.huaweicloud.integration.controller; | ||
|
||
import com.huaweicloud.integration.service.RemovalService; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.annotation.Resource; | ||
|
||
/** | ||
* 离群实例摘除测试接口 | ||
* | ||
* @author zhp | ||
* @since 2023-03-16 | ||
*/ | ||
@RestController | ||
@RequestMapping("/removal") | ||
public class RemovalController { | ||
@Resource(name = "removalService") | ||
private RemovalService removalService; | ||
|
||
/** | ||
* 测试离群实例摘除接口接口 | ||
* | ||
* @return 测试信息 | ||
*/ | ||
@GetMapping("/testReq") | ||
public String testReq() { | ||
return removalService.getPort(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.