-
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.
AgentCore的prematin启动和agentmain启动测试、动态配置zk测试、配置加载测试
- Loading branch information
1 parent
3ebe342
commit 3707923
Showing
26 changed files
with
865 additions
and
28 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,66 @@ | ||
name: "Agent-core Agentmain Startup Test" | ||
description: "Auto test for agent-core agentmain startup" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: entry | ||
uses: ./.github/actions/common/entry | ||
with: | ||
log-dir: ./logs/agentcore-test/agentmain | ||
- name: compile AgentLoader | ||
shell: bash | ||
run: | | ||
cp sermant-integration-tests/scripts/AgentLoader.java ./ | ||
javac -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader.java | ||
- 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 '/dynamic-test-third-plugin/d' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
sed -i '/plugins:/a \ - dynamic-test-first-plugin' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
sed -i '/ active:/a \ - dynamic-test-second-plugin' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
sed -i '/ passive:/a \ - dynamic-test-third-plugin' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
- name: start backend with memory | ||
shell: bash | ||
run: | | ||
nohup java -jar sermant-agent-${{ env.sermantVersion }}/server/sermant/sermant-backend-${{ env.sermantVersion }}.jar & | ||
- 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 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8900/sermant/event/webhooks 120 | ||
- name: (install agent) dynamic install agent | ||
shell: bash | ||
run: java -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar | ||
- name: Sleep for 5 Seconds | ||
shell: bash | ||
run: sleep 5 | ||
- name: test agentmain startup | ||
shell: bash | ||
run: mvn test -Dagentcore.test.type=AGENTMAIN_STARTUP --file sermant-integration-tests/agentcore-test/agentcore-integration-test/pom.xml | ||
- name: exit | ||
if: always() | ||
uses: ./.github/actions/common/exit | ||
with: | ||
processor-keyword: agentcore | ||
- name: if failure then upload error log | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ failure() || cancelled() }} | ||
with: | ||
name: agentcore-test-agentmain-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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: "Agent-core Common Test" | ||
description: "Auto test for agent-core common" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: entry | ||
uses: ./.github/actions/common/entry | ||
with: | ||
log-dir: ./logs/agentcore-test/common | ||
- name: modify config | ||
shell: bash | ||
run: | | ||
sed -i 's/service\.meta\.application=default/service.meta.application=testApplication/' sermant-agent-${{ env.sermantVersion }}/agent/config/config.properties | ||
- 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 -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar -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: agentcore test config load start | ||
shell: bash | ||
run: mvn test -Dagentcore.test.type=CONFIG_LOAD --file sermant-integration-tests/agentcore-test/agentcore-integration-test/pom.xml | ||
- name: exit | ||
if: always() | ||
uses: ./.github/actions/common/exit | ||
with: | ||
processor-keyword: agentcore | ||
- name: if failure then upload error log | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ failure() || cancelled() }} | ||
with: | ||
name: agentcore-test-common-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: "Agent-core Premain Startup Test" | ||
description: "Auto test for agent-core premain startup" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: entry | ||
uses: ./.github/actions/common/entry | ||
with: | ||
log-dir: ./logs/agentcore-test/premain | ||
- 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 '/plugins:/a \ - dynamic-test-first-plugin' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
sed -i '/ active:/a \ - dynamic-test-second-plugin' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml | ||
- name: start backend with memory | ||
shell: bash | ||
run: | | ||
nohup java -jar sermant-agent-${{ env.sermantVersion }}/server/sermant/sermant-backend-${{ env.sermantVersion }}.jar & | ||
- 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 -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar -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 | ||
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8900/sermant/event/webhooks 120 | ||
- name: test premain startup | ||
shell: bash | ||
run: mvn test -Dagentcore.test.type=PREMAIN_STARTUP --file sermant-integration-tests/agentcore-test/agentcore-integration-test/pom.xml | ||
- name: exit | ||
if: always() | ||
uses: ./.github/actions/common/exit | ||
with: | ||
processor-keyword: agentcore | ||
- name: if failure then upload error log | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ failure() || cancelled() }} | ||
with: | ||
name: agentcore-test-premain-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
Oops, something went wrong.