-
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 #967 from justforstudy-A/autotest-reactor-v2
【enhance】auto test restruct
- Loading branch information
Showing
29 changed files
with
1,752 additions
and
1,514 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Common operations" | ||
description: "do something common for all test" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
cache: maven | ||
- name: download middlewares | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
apache-zookeeper-*/ | ||
Local-CSE-2.1.3-linux-amd64.zip | ||
key: ${{ runner.os }}-middlewares-${{ github.run_id }} | ||
- name: download agent | ||
uses: actions/cache@v3 | ||
with: | ||
path: sermant-agent-*/ | ||
key: ${{ runner.os }}-agent-${{ github.run_id }} | ||
- name: start zookeeper | ||
shell: bash | ||
run: bash apache-zookeeper-3.6.3-bin/bin/zkServer.sh start apache-zookeeper-3.6.3-bin/conf/zoo_sample.cfg | ||
- name: start cse | ||
shell: bash | ||
run: | | ||
export ROOT_PATH=$(pwd) | ||
bash ./sermant-integration-tests/scripts/startCse.sh | ||
- name: cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: plugin change check | ||
uses: ./.github/actions/common/plugin-change-check |
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,20 @@ | ||
name: "Entrance operations" | ||
description: "do something entrance operations for all test" | ||
inputs: | ||
log-dir: | ||
description: 'Log path for cur workflow' | ||
required: true | ||
default: './logs/default' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: create log dir | ||
shell: bash | ||
run: | | ||
log_dir=${{ inputs.log-dir }} | ||
mkdir -p ${log_dir} | ||
echo "logDir=${log_dir}" >> $GITHUB_ENV | ||
echo "=======check log dir======" | ||
ls -l ${log_dir} | ||
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,26 @@ | ||
name: "Exit operations" | ||
description: "do something exit operations for all test" | ||
inputs: | ||
processor-keyword: | ||
description: 'The keyword associate to processor that you want to kill, if you have one more key word, you can | ||
separate with |,such as rest|feign' | ||
required: false | ||
default: '' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: reset | ||
shell: bash | ||
run: | | ||
echo "tailVersion=" >> $GITHUB_ENV | ||
echo "healthApi=" >> $GITHUB_ENV | ||
echo "logDir=" >> $GITHUB_ENV | ||
keyword='${{ inputs.processor-keyword }}' | ||
if [ $keyword != '' ];then | ||
jps -l | grep -E "${keyword}" | awk '{print $1}' | xargs -n 1 kill -9 | ||
echo "========check process========" | ||
jps -l | ||
fi | ||
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,135 @@ | ||
name: "Plugin change check" | ||
description: "check file change for all plugins" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-sermant-agentcore | ||
with: | ||
paths: sermant-agentcore | ||
- name: env sermant-agentcore | ||
shell: bash | ||
run: | | ||
echo "sermantAgentCoreChanged=${{ steps.changed-sermant-agentcore.outputs.changed }}" >> $GITHUB_ENV | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-sermant-router | ||
with: | ||
paths: sermant-plugins/sermant-router | ||
- name: env sermant-router | ||
shell: bash | ||
run: | | ||
echo "sermantRouterChanged=${{ steps.changed-sermant-router.outputs.changed }}" >> $GITHUB_ENV | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-sermant-flowcontrol | ||
with: | ||
paths: sermant-plugins/sermant-flowcontrol | ||
- name: env sermant-flowcontrol | ||
shell: bash | ||
run: | | ||
echo "sermantFlowcontrolChanged=${{ steps.changed-sermant-flowcontrol.outputs.changed }}" >> $GITHUB_ENV | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-sermant-dynamic-config | ||
with: | ||
paths: sermant-plugins/sermant-dynamic-config | ||
- name: env sermant-sermant-dynamic-config | ||
shell: bash | ||
run: | | ||
echo "sermantDynamicConfigChanged=${{ steps.changed-sermant-dynamic-config.outputs.changed }}" >> $GITHUB_ENV | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-sermant-loadbalancer | ||
with: | ||
paths: sermant-plugins/sermant-loadbalancer | ||
- name: env sermant-sermant-loadbalancer | ||
shell: bash | ||
run: | | ||
echo "sermantLoadbalancerChanged=${{ steps.changed-sermant-loadbalancer.outputs.changed }}" >> $GITHUB_ENV | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-sermant-monitor | ||
with: | ||
paths: sermant-plugins/sermant-monitor | ||
- name: env sermant-sermant-monitor | ||
shell: bash | ||
run: | | ||
echo "sermantMonitorChanged=${{ steps.changed-sermant-monitor.outputs.changed }}" >> $GITHUB_ENV | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-sermant-service-registry | ||
with: | ||
paths: sermant-plugins/sermant-service-registry | ||
- name: env sermant-sermant-service-registry | ||
shell: bash | ||
run: | | ||
echo "sermantServiceRegistryChanged=${{ steps.changed-sermant-service-registry.outputs.changed }}" >> $GITHUB_ENV | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-sermant-springboot-registry | ||
with: | ||
paths: sermant-plugins/sermant-springboot-registry | ||
- name: env sermant-sermant-springboot-registry | ||
shell: bash | ||
run: | | ||
echo "sermantSpringbootRegistryChanged=${{ steps.changed-sermant-springboot-registry.outputs.changed }}" >> $GITHUB_ENV | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-sermant-mq-consumer-deny | ||
with: | ||
paths: sermant-plugins/sermant-mq-consumer-deny | ||
- name: env sermant-sermant-mq-consumer-deny | ||
shell: bash | ||
run: | | ||
echo "sermantMqConsumerDenyChanged=${{ steps.changed-sermant-mq-consumer-deny.outputs.changed }}" >> $GITHUB_ENV | ||
- uses: marceloprado/has-changed-path@v1 | ||
id: changed-workflow-or-test | ||
with: | ||
paths: ./.github/actions ./.github/workflows sermant-integration-tests | ||
- name: statistic scenarios change env | ||
shell: bash | ||
run: | | ||
# *****************dubbo_integration_test.yml***************** | ||
# ==========dubbo router is needed to test?========== | ||
if [ ${{ env.sermantAgentCoreChanged }} == 'true' -o ${{ env.sermantRouterChanged }} == 'true' ];then | ||
echo "enableDubboRouter=true" >> $GITHUB_ENV | ||
fi | ||
# ==========dubbo common is needed to test?========== | ||
if [ ${{ env.sermantAgentCoreChanged }} == 'true' -o \ | ||
${{ env.sermantFlowcontrolChanged }} == 'true' -o \ | ||
${{ env.sermantSpringbootRegistryChanged }} == 'true' -o \ | ||
${{ env.sermantServiceRegistryChanged }} == 'true' -o \ | ||
${{ env.sermantRouterChanged }} == 'true' ];then | ||
echo "enableDubboCommon=true" >> $GITHUB_ENV | ||
fi | ||
# *****************spring_integration_test_1.yml***************** | ||
# ==========graceful is needed to test?========== | ||
if [ ${{ env.sermantAgentCoreChanged }} == 'true' -o ${{ env.sermantServiceRegistryChanged }} == 'true' ];then | ||
echo "enableGraceful=true" >> $GITHUB_ENV | ||
fi | ||
# ==========spring common is needed to test?========== | ||
if [ ${{ env.sermantAgentCoreChanged }} == 'true' -o \ | ||
${{ env.sermantFlowcontrolChanged }} == 'true' -o \ | ||
${{ env.sermantSpringbootRegistryChanged }} == 'true' -o \ | ||
${{ env.sermantServiceRegistryChanged }} == 'true' -o \ | ||
${{ env.sermantRouterChanged }} == 'true' ];then | ||
echo "enableSpringCommon=true" >> $GITHUB_ENV | ||
fi | ||
# ==========dynamic config is needed to test?========== | ||
if [ ${{ env.sermantAgentCoreChanged }} == 'true' -o ${{ env.sermantDynamicConfigChanged }} == 'true' ];then | ||
echo "enableDynamicConfig=true" >> $GITHUB_ENV | ||
fi | ||
# *****************spring_integration_test_2.yml***************** | ||
# ==========spring router is needed to test?========== | ||
if [ ${{ env.sermantAgentCoreChanged }} == 'true' -o ${{ env.sermantRouterChanged }} == 'true' -o \ | ||
${{ env.sermantSpringbootRegistryChanged }} == 'true' ];then | ||
echo "enableSpringRouter=true" >> $GITHUB_ENV | ||
fi | ||
# ==========spring tag router is needed to test?========== | ||
if [ ${{ env.sermantAgentCoreChanged }} == 'true' -o ${{ env.sermantRouterChanged }} == 'true' ];then | ||
echo "enableSpringTagRouter=true" >> $GITHUB_ENV | ||
fi | ||
# all workflow will trigger while workflow changed | ||
if [ ${{ steps.changed-workflow-or-test.outputs.changed }} == 'true' ];then | ||
echo "enableDubboRouter=true" >> $GITHUB_ENV | ||
echo "enableDubboCommon=true" >> $GITHUB_ENV | ||
echo "enableSpringRouter=true" >> $GITHUB_ENV | ||
echo "enableSpringTagRouter=true" >> $GITHUB_ENV | ||
echo "enableDynamicConfig=true" >> $GITHUB_ENV | ||
echo "enableGraceful=true" >> $GITHUB_ENV | ||
fi | ||
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,59 @@ | ||
name: "Common operations" | ||
description: "do something common for all test" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
cache: maven | ||
- name: download zookeeper | ||
uses: actions/cache@v3 | ||
with: | ||
path: apache-zookeeper-3.6.3-bin.tar.gz | ||
key: ${{ runner.os }}-apache-zookeeper-3.6.3 | ||
- name: run zookeeper | ||
shell: bash | ||
run: | | ||
tar -zxf apache-zookeeper-3.6.3-bin.tar.gz | ||
bash apache-zookeeper-3.6.3-bin/bin/zkServer.sh start apache-zookeeper-3.6.3-bin/conf/zoo_sample.cfg | ||
- name: download local cse | ||
uses: actions/cache@v3 | ||
with: | ||
path: Local-CSE-2.1.3-linux-amd64.zip | ||
key: ${{ runner.os }}-local-cse | ||
restore-keys: | | ||
${{ runner.os }}-local-cse | ||
- name: start cse | ||
shell: bash | ||
run: | | ||
export ROOT_PATH=$(pwd) | ||
bash ./sermant-integration-tests/scripts/startCse.sh | ||
- name: download nacos server | ||
uses: actions/cache@v3 | ||
with: | ||
path: nacos-server-1.4.2.tar.gz | ||
key: ${{ runner.os }}-nacos-server-1.4.2 | ||
restore-keys: | | ||
${{ runner.os }}-nacos-server-1.4.2 | ||
- name: start nacos server | ||
shell: bash | ||
run: | | ||
tar -zxf nacos-server-1.4.2.tar.gz | ||
bash nacos/bin/startup.sh -m standalone | ||
- name: cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: download agent | ||
uses: actions/cache@v3 | ||
with: | ||
path: sermant-agent-*/ | ||
key: ${{ runner.os }}-agent-${{ github.run_id }} | ||
- name: plugin change check | ||
uses: ./.github/actions/common/plugin-change-check |
Oops, something went wrong.