Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/actions/common/backend/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,12 @@ runs:
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: install requests
shell: bash
run: |
pip install requests
- name: download agent
uses: actions/cache@v4
with:
path: sermant-agent-*/
key: ${{ runner.os }}-agent-${{ github.run_id }}
26 changes: 24 additions & 2 deletions .github/actions/common/plugin-change-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,14 @@ runs:
id: changed-dubbo-common-action
with:
paths: ./.github/actions/scenarios/dubbo/dubbo-common ./.github/actions/common/dubbo ./.github/workflows/dubbo_integration_test.yml
- uses: ktamas77/has-changed-path@v1.0.3
id: changed-dubbo3-flow-action
with:
paths: ./.github/actions/scenarios/dubbo/flow-dubbo3 ./.github/actions/common/dubbo ./.github/workflows/dubbo_integration_test.yml
- name: env dubbo3-flow-action
shell: bash
run: |
echo "enableDubbo3FlowActionChange=${{ steps.changed-dubbo3-flow-action.outputs.changed }}" >> $GITHUB_ENV
- name: env dubbo-router-action
shell: bash
run: |
Expand Down Expand Up @@ -678,6 +686,13 @@ runs:
echo "enableDubboLane=true" >> $GITHUB_ENV
echo "enableDubbo3Lane=true" >> $GITHUB_ENV
fi
# ==========dubbo3 flow is needed to test?==========
if [ ${{ env.sermantAgentCoreChanged }} == 'true' -o ${{ env.sermantFlowcontrolChanged }} == 'true' -o \
${{ env.enableDubbo3FlowActionChange }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' -o \
${{ env.enableDubboTestChange }} == 'true' ];then
echo "enableDubbo3Flow=true" >> $GITHUB_ENV
fi

# *****************spring_integration_test_1.yml*****************
# ==========graceful is needed to test?==========
Expand Down Expand Up @@ -932,13 +947,13 @@ runs:
# ==========dynamic config service is needed to test?==========
if [ ${{ env.sermantAgentCoreDynamicConfigServiceChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableDynamicConfigServicAction=true" >> $GITHUB_ENV
echo "enableDynamicConfigServiceAction=true" >> $GITHUB_ENV
fi

# ==========xds service is needed to test?==========
if [ ${{ env.sermantAgentCoreXdsServiceChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableXdsServicAction=true" >> $GITHUB_ENV
echo "enableXdsServiceAction=true" >> $GITHUB_ENV
fi

# ==========mq grayscale rocketmq is needed to test?==========
Expand All @@ -947,3 +962,10 @@ runs:
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableMqGrayscaleRocketMqAction=true" >> $GITHUB_ENV
fi

# ==========xds service is needed to test?==========
if [ ${{ env.sermantAgentCoreXdsServiceChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' -o \
${{ env.sermantFlowcontrolChanged }} == 'true'];then
echo "enableXdsFlowControl=true" >> $GITHUB_ENV
fi
4 changes: 4 additions & 0 deletions .github/actions/scenarios/backend/config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ description: "Auto test for Backend"
runs:
using: "composite"
steps:
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/backend-config
- name: start backend with zookeeper
shell: bash
env:
Expand Down
11 changes: 1 addition & 10 deletions .github/actions/scenarios/backend/event/memory/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ description: "Auto test for Backend"
runs:
using: "composite"
steps:
- name: download agent
uses: actions/cache@v4
with:
path: sermant-agent-*/
key: ${{ runner.os }}-agent-${{ github.run_id }}
- name: package dubbo 2.6.0 tests
shell: bash
run: mvn package -Dalibaba.dubbo.version=2.6.0 -DskipTests -P260 --file sermant-integration-tests/dubbo-test/pom.xml
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/backend
log-dir: ./logs/backend-memory
- name: start backend with memory
shell: bash
run: |
Expand All @@ -39,10 +34,6 @@ runs:
shell: bash
run: |
netstat -nlp | grep :28021 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
- name: install requests
shell: bash
run: |
pip install requests
- name: start test
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/scenarios/backend/event/redis/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runs:
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/backend
log-dir: ./logs/backend-redis
- name: install redis
shell: bash
run: |
Expand Down
235 changes: 235 additions & 0 deletions .github/actions/scenarios/backend/external-agent/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
name: "Test external agent management"
description: "Auto test for external agent"
runs:
using: "composite"
steps:
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/backend-external-agent
- name: compile AgentLoader
shell: bash
run: |
cp sermant-integration-tests/scripts/AgentLoader.java ./
javac -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader.java
- name: download opentelemetry agent
uses: actions/cache@v4
with:
path: opentelemetry-javaagent.jar
key: ${{ runner.os }}-opentelemetry-javaagent.jar
restore-keys: |
${{ runner.os }}-opentelemetry-javaagent.jar
- 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: 6894
SERVER_PORT: 8910
MAX_EFFECTIVE_TIME: 20000
run: |
nohup java -jar sermant-agent-${{ env.sermantVersion }}/server/sermant/sermant-backend-${{ env.sermantVersion }}.jar &
sleep 20

- name: start application with sermant agent without external agent
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 \
-Dserver.port=8915 \
-Dagent.config.externalAgent.injection=false \
-Dagent.service.heartbeat.enable=true \
-Dagent.service.gateway.enable=true \
-Devent.enable=true \
-Dgateway.nettyPort=6894 \
-Dheartbeat.interval=5000 \
-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 application start
shell: bash
run: |
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8915/ping 120
- name: test start with sermant agent without external agent
shell: bash
run: |
export TEST_MODE=startWithoutExternalAgent
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
- name: stop application
shell: bash
run: |
netstat -nlp | grep :8915 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
sleep 3
- name: start application with sermant agent and external agent
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 \
-Dserver.port=8916 \
-Dagent.config.externalAgent.injection=true \
-Dagent.config.externalAgent.name=OTEL \
-Dagent.config.externalAgent.file=opentelemetry-javaagent.jar \
-Dagent.service.heartbeat.enable=true \
-Dagent.service.gateway.enable=true \
-Devent.enable=true \
-Dgateway.nettyPort=6894 \
-Dheartbeat.interval=5000 \
-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 application start
shell: bash
run: |
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8916/ping 120
- name: test start with sermant agent and external agent
shell: bash
run: |
export TEST_MODE=startWithExternalAgent
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
- name: stop application
shell: bash
run: |
netstat -nlp | grep :8916 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
sleep 3
- name: start application alone
shell: bash
env:
dynamic.config.serverAddress: 127.0.0.1:2181
dynamic.config.dynamicConfigType: ZOOKEEPER
service.meta.project: TestAgentCore
run: |
nohup java -Dserver.port=8917 \
-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 application start
shell: bash
run: |
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8917/ping 120
sleep 10
- name: dynamic install external agent
shell: bash
run: java -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
command=INSTALL-EXTERNAL-AGENT:OTEL,AGENT_FILE=opentelemetry-javaagent.jar,agent.service.heartbeat.enable=true,agent.service.gateway.enable=true,event.enable=true,gateway.nettyPort=6894,heartbeat.interval=5000
- name: test install external agent by attach in case of sermant agent is not installed
shell: bash
run: |
export TEST_MODE=installByAttach
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
- name: stop application
shell: bash
run: |
netstat -nlp | grep :8917 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
sleep 3
- name: start application with sermant agent without external agent
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 \
-Dserver.port=8918 \
-Dagent.config.externalAgent.injection=false \
-Dagent.service.heartbeat.enable=true \
-Dagent.service.gateway.enable=true \
-Devent.enable=true \
-Dgateway.nettyPort=6894 \
-Dheartbeat.interval=5000 \
-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 application start
shell: bash
run: |
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8918/ping 120
- name: dynamic install external agent
shell: bash
run: java -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
command=INSTALL-EXTERNAL-AGENT:OTEL,AGENT_FILE=opentelemetry-javaagent.jar,agent.service.heartbeat.enable=true,agent.service.gateway.enable=true,event.enable=true,gateway.nettyPort=6894
- name: test install external agent by attach in case of sermant agent is installed
shell: bash
run: |
export TEST_MODE=installByAttach
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
- name: stop application
shell: bash
run: |
netstat -nlp | grep :8918 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
sleep 3
- name: start application alone
shell: bash
env:
dynamic.config.serverAddress: 127.0.0.1:2181
dynamic.config.dynamicConfigType: ZOOKEEPER
service.meta.project: TestAgentCore
run: |
nohup java -Dserver.port=8919 \
-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 application start
shell: bash
run: |
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8919/ping 120
sleep 10
- name: dynamic install external agent
shell: bash
run: java -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
agent.config.externalAgent.injection=true,agent.config.externalAgent.name=OTEL,agent.config.externalAgent.file=opentelemetry-javaagent.jar,agent.service.heartbeat.enable=true,agent.service.gateway.enable=true,event.enable=true,gateway.nettyPort=6894,heartbeat.interval=5000
- name: test install external agent by attach in case of sermant agent is not installalled and has set external agent config
shell: bash
run: |
export TEST_MODE=installByAttach
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
- name: stop application
shell: bash
run: |
netstat -nlp | grep :8919 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
sleep 3
- name: start application with sermant agent without external agent
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 \
-Dserver.port=8920 \
-Dagent.config.externalAgent.injection=false \
-Dagent.service.heartbeat.enable=true \
-Dagent.service.gateway.enable=true \
-Devent.enable=true \
-Dgateway.nettyPort=6894 \
-Dheartbeat.interval=5000 \
-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 application start
shell: bash
run: |
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8920/ping 120
- name: test install external agent by Sermant Backend
shell: bash
run: |
export TEST_MODE=install
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
- name: stop application
shell: bash
run: |
netstat -nlp | grep :8920 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
sleep 3
- name: stop backend
shell: bash
run: |
netstat -nlp | grep :8910 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
- 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@v4
if: ${{ failure() || cancelled() }}
with:
name: (${{ github.job }})-backend-logs
path: |
./*.log
./logs/**
if-no-files-found: warn
retention-days: 2
17 changes: 14 additions & 3 deletions .github/actions/scenarios/backend/hot-plugging/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: "Test the configuration management of Backend"
name: "Test the plugin hot-plugging in Backend"
description: "Auto test for Backend"
runs:
using: "composite"
steps:
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/backend-hot-plugging
- name: compile AgentLoader
shell: bash
run: |
Expand All @@ -27,8 +31,7 @@ runs:
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 &
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: |
Expand Down Expand Up @@ -66,6 +69,14 @@ runs:
run: |
export TEST_MODE=unInstall
python -m unittest ./sermant-integration-tests/scripts/test_backend_hot_plugging.py
- name: stop application
shell: bash
run: |
netstat -nlp | grep :8915 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
- name: stop backend
shell: bash
run: |
netstat -nlp | grep :8910 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
- name: exit
if: always()
uses: ./.github/actions/common/exit
Expand Down
Loading
Loading