-
Notifications
You must be signed in to change notification settings - Fork 173
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 #1562 from hanbingleixue/Integration-test
Integration test for configuration management
- Loading branch information
Showing
5 changed files
with
628 additions
and
19 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,48 @@ | ||
name: "Common operations" | ||
description: "do something common for Backend Test" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK ${{ env.javaVersion }} | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: ${{ env.javaVersion }} | ||
distribution: 'adopt' | ||
cache: maven | ||
- name: download middlewares | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
apache-zookeeper-*/ | ||
key: ${{ runner.os }}-middlewares-${{ 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: 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-2.1.0.tar.gz | ||
key: ${{ runner.os }}-nacos-server-2.1.0 | ||
restore-keys: | | ||
${{ runner.os }}-nacos-server-2.1.0 | ||
- name: start nacos server | ||
shell: bash | ||
run: | | ||
tar -zxf nacos-server-2.1.0.tar.gz | ||
bash nacos/bin/startup.sh -m standalone | ||
- name: Set up python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.10' |
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,62 @@ | ||
name: "Test the configuration management of Backend" | ||
description: "Auto test for Backend" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: start backend with zookeeper | ||
shell: bash | ||
env: | ||
DYNAMIC_CONFIG_SERVERADDRESS: 127.0.0.1:2181 | ||
DYNAMIC_CONFIG_DYNAMICCONFIGTYPE: ZOOKEEPER | ||
DYNAMIC_CONFIG_ENABLE: true | ||
NETTY_PORT: 6889 | ||
SERVER_PORT: 8901 | ||
run: | | ||
nohup java -jar sermant-agent-${{ env.sermantVersion }}/server/sermant/sermant-backend-${{ env.sermantVersion }}.jar & | ||
- name: start backend with kie | ||
shell: bash | ||
env: | ||
DYNAMIC_CONFIG_SERVERADDRESS: 127.0.0.1:30110 | ||
DYNAMIC_CONFIG_DYNAMICCONFIGTYPE: KIE | ||
DYNAMIC_CONFIG_ENABLE: true | ||
NETTY_PORT: 6890 | ||
SERVER_PORT: 8902 | ||
run: | | ||
nohup java -jar sermant-agent-${{ env.sermantVersion }}/server/sermant/sermant-backend-${{ env.sermantVersion }}.jar & | ||
- name: start backend with nacos | ||
shell: bash | ||
env: | ||
DYNAMIC_CONFIG_SERVERADDRESS: 127.0.0.1:8848 | ||
DYNAMIC_CONFIG_DYNAMICCONFIGTYPE: NACOS | ||
DYNAMIC_CONFIG_ENABLE: true | ||
NETTY_PORT: 6891 | ||
SERVER_PORT: 8903 | ||
run: | | ||
nohup java -jar sermant-agent-${{ env.sermantVersion }}/server/sermant/sermant-backend-${{ env.sermantVersion }}.jar & | ||
- name: waiting for backend start | ||
shell: bash | ||
run: | | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8901/sermant/event/webhooks 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8902/sermant/event/webhooks 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8903/sermant/event/webhooks 120 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8848/nacos/v2/console/namespace/list 20 | ||
- name: start test | ||
shell: bash | ||
run: | | ||
python -m unittest ./sermant-integration-tests/scripts/test_configuration_management_of_backend.py | ||
- name: stop backend | ||
shell: bash | ||
run: | | ||
netstat -nlp | grep :8901 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill | ||
netstat -nlp | grep :8902 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill | ||
netstat -nlp | grep :8903 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill | ||
- name: if failure then upload error log | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ failure() || cancelled() }} | ||
with: | ||
name: (${{ github.job }})-backend-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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,25 +3,6 @@ description: "Auto test for Backend" | |
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK ${{ env.javaVersion }} | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: ${{ env.javaVersion }} | ||
distribution: 'adopt' | ||
cache: maven | ||
- name: Set up python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.10' | ||
- name: download middlewares | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
apache-zookeeper-*/ | ||
key: ${{ runner.os }}-middlewares-${{ 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: download agent | ||
uses: actions/cache@v3 | ||
with: | ||
|
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.