Skip to content

Commit

Permalink
Merge pull request #1562 from hanbingleixue/Integration-test
Browse files Browse the repository at this point in the history
Integration test for configuration management
  • Loading branch information
Sherlockhan authored Jul 11, 2024
2 parents fdcda0d + 17be0a7 commit cba1f3d
Show file tree
Hide file tree
Showing 5 changed files with 628 additions and 19 deletions.
48 changes: 48 additions & 0 deletions .github/actions/common/backend/action.yml
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'
62 changes: 62 additions & 0 deletions .github/actions/scenarios/backend/config/action.yml
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
19 changes: 0 additions & 19 deletions .github/actions/scenarios/backend/memory/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/backend_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@ jobs:
export ROOT_PATH=$(pwd)
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh zk
tar -zxf apache-zookeeper-3.6.3-bin.tar.gz
- name: cache 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: download cse
run: |
export ROOT_PATH=$(pwd)
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh cse
- name: cache 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: download nacos
run: |
export ROOT_PATH=$(pwd)
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh nacos210
build-agent-and-cache:
name: build agent and cache
runs-on: ubuntu-latest
Expand Down Expand Up @@ -63,9 +85,13 @@ jobs:
- name: set java version to environment
run: |
echo "javaVersion=8" >> $GITHUB_ENV
- name: start backend common test
uses: ./.github/actions/common/backend
- name: start backend use memory test
uses: ./.github/actions/scenarios/backend/memory
- name: start backend use redis test
uses: ./.github/actions/scenarios/backend/redis
- name: start config manager test
uses: ./.github/actions/scenarios/backend/config


Loading

0 comments on commit cba1f3d

Please sign in to comment.