forked from sermant-io/Sermant
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration testing with added hot plugging functionality
Signed-off-by: hanbingleixue <[email protected]>
- Loading branch information
1 parent
fb8b875
commit 93c2df1
Showing
28 changed files
with
2,627 additions
and
2,272 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,81 @@ | ||
name: "Test the configuration management of Backend" | ||
description: "Auto test for Backend" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: compile AgentLoader | ||
shell: bash | ||
run: | | ||
cp sermant-integration-tests/scripts/AgentLoader.java ./ | ||
javac -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader.java | ||
- 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: 6893 | ||
SERVER_PORT: 8910 | ||
run: | | ||
nohup java -jar sermant-agent-${{ env.sermantVersion }}/server/sermant/sermant-backend-${{ env.sermantVersion }}.jar & | ||
sleep 20 | ||
- name: start applications | ||
shell: bash | ||
env: | ||
dynamic.config.serverAddress: 127.0.0.1:2181 | ||
dynamic.config.dynamicConfigType: ZOOKEEPER | ||
service.meta.project: TestAgentCore | ||
run: | | ||
nohup java -jar \ | ||
sermant-agent-${{ env.sermantVersion }}/agent/agentcore-test-application-1.0.0-jar-with-dependencies.jar > ${{ env.logDir | ||
}}/agentcore-test.log 2>&1 & | ||
- name: waiting for agentcore services start | ||
shell: bash | ||
run: | | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8915/ping 120 | ||
- name: (install agent) modify plugins file | ||
shell: bash | ||
run: | | ||
sed -i '/dynamic-test-first-plugin/d' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
sed -i '/dynamic-test-second-plugin/d' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
sed -i '/ passive:/a \ - dynamic-test-first-plugin' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
sed -i '/ passive:/a \ - dynamic-test-second-plugin' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
- name: dynamic install agent | ||
shell: bash | ||
run: java -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \ | ||
agent.service.hot.plugging.service.enable=true,agent.service.heartbeat.enable=true,agent.service.gateway.enable=true,event.enable=true,gateway.nettyPort=6893 | ||
- name: Sleep for 5 Seconds | ||
shell: bash | ||
run: sleep 20 | ||
- name: test install plugin | ||
shell: bash | ||
run: | | ||
export TEST_MODE=install | ||
python -m unittest ./sermant-integration-tests/scripts/test_backend_hot_plugging.py | ||
- name: test update plugin | ||
shell: bash | ||
run: | | ||
export TEST_MODE=update | ||
rm -rf sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/dynamic-test-first-plugin/plugin/dynamic-test-first-plugin-1.0.0.jar | ||
cp ./sermant-integration-tests/dynamic-test-first-plugin-v2/target/dynamic-test-first-plugin-2.0.0.jar sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/dynamic-test-first-plugin/plugin/ | ||
python -m unittest ./sermant-integration-tests/scripts/test_backend_hot_plugging.py | ||
- name: test uninstall plugin | ||
shell: bash | ||
run: | | ||
export TEST_MODE=unInstall | ||
python -m unittest ./sermant-integration-tests/scripts/test_backend_hot_plugging.py | ||
- name: exit | ||
if: always() | ||
uses: ./.github/actions/common/exit | ||
with: | ||
processor-keyword: agentcore|backend | ||
- 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 |
---|---|---|
@@ -1,58 +1,58 @@ | ||
name: Unit test and code coverage | ||
on: [push, pull_request] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
java_version: [8] | ||
os: [ubuntu-latest] | ||
permissions: | ||
checks: write | ||
contents: write | ||
pull-requests: write | ||
statuses: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ matrix.java_version }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.java_version }} | ||
distribution: 'adopt' | ||
cache: maven | ||
- name: Cache Maven packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: download sc | ||
run: | | ||
curl -o apache-servicecomb-service-center-2.1.0-linux-amd64.tar.gz -L https://github.com/apache/servicecomb-service-center/releases/download/v2.1.0/apache-servicecomb-service-center-2.1.0-linux-amd64.tar.gz | ||
tar -zxf apache-servicecomb-service-center-2.1.0-linux-amd64.tar.gz | ||
sh apache-servicecomb-service-center-2.1.0-linux-amd64/start-service-center.sh | ||
- name: download zookeeper | ||
run: | | ||
curl -o apache-zookeeper-3.6.3-bin.tar.gz -L https://archive.apache.org/dist/zookeeper/zookeeper-3.6.3/apache-zookeeper-3.6.3-bin.tar.gz | ||
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 nacos | ||
run: | | ||
curl -o nacos-server-2.1.0.tar.gz -L https://github.com/alibaba/nacos/releases/download/2.1.0/nacos-server-2.1.0.tar.gz | ||
tar -zxf nacos-server-2.1.0.tar.gz | ||
bash nacos/bin/startup.sh -m standalone | ||
- name: Build with Maven | ||
run: mvn test | ||
- name: Generate code coverage report | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: ${{ github.workspace }}/report/target/jacoco/jacoco.xml | ||
flags: unittests | ||
fail_ci_if_error: true # optional (default = false) | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
#name: Unit test and code coverage | ||
#on: [push, pull_request] | ||
#concurrency: | ||
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.head_ref }} | ||
# cancel-in-progress: true | ||
#jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# java_version: [8] | ||
# os: [ubuntu-latest] | ||
# permissions: | ||
# checks: write | ||
# contents: write | ||
# pull-requests: write | ||
# statuses: write | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# - name: Set up JDK ${{ matrix.java_version }} | ||
# uses: actions/setup-java@v3 | ||
# with: | ||
# java-version: ${{ matrix.java_version }} | ||
# distribution: 'adopt' | ||
# cache: maven | ||
# - name: Cache Maven packages | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: ~/.m2 | ||
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
# restore-keys: ${{ runner.os }}-m2 | ||
# - name: download sc | ||
# run: | | ||
# curl -o apache-servicecomb-service-center-2.1.0-linux-amd64.tar.gz -L https://github.com/apache/servicecomb-service-center/releases/download/v2.1.0/apache-servicecomb-service-center-2.1.0-linux-amd64.tar.gz | ||
# tar -zxf apache-servicecomb-service-center-2.1.0-linux-amd64.tar.gz | ||
# sh apache-servicecomb-service-center-2.1.0-linux-amd64/start-service-center.sh | ||
# - name: download zookeeper | ||
# run: | | ||
# curl -o apache-zookeeper-3.6.3-bin.tar.gz -L https://archive.apache.org/dist/zookeeper/zookeeper-3.6.3/apache-zookeeper-3.6.3-bin.tar.gz | ||
# 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 nacos | ||
# run: | | ||
# curl -o nacos-server-2.1.0.tar.gz -L https://github.com/alibaba/nacos/releases/download/2.1.0/nacos-server-2.1.0.tar.gz | ||
# tar -zxf nacos-server-2.1.0.tar.gz | ||
# bash nacos/bin/startup.sh -m standalone | ||
# - name: Build with Maven | ||
# run: mvn test | ||
# - name: Generate code coverage report | ||
# uses: codecov/codecov-action@v4 | ||
# with: | ||
# files: ${{ github.workspace }}/report/target/jacoco/jacoco.xml | ||
# flags: unittests | ||
# fail_ci_if_error: true # optional (default = false) | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
Oops, something went wrong.