Skip to content

Commit

Permalink
Optimize integration test scripts
Browse files Browse the repository at this point in the history
Signed-off-by: hanbingleixue <hanbingleixue@hotmail.com>
  • Loading branch information
hanbingleixue committed Jul 29, 2024
1 parent 1a1da4a commit 3a33659
Show file tree
Hide file tree
Showing 9 changed files with 266 additions and 125 deletions.
4 changes: 1 addition & 3 deletions .github/actions/common/agentcore/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,4 @@ runs:
uses: actions/cache@v3
with:
path: sermant-agent-*/
key: ${{ runner.os }}-agent-${{ github.run_id }}
- name: plugin change check
uses: ./.github/actions/common/plugin-change-check
key: ${{ runner.os }}-agent-${{ github.run_id }}
57 changes: 57 additions & 0 deletions .github/actions/common/plugin-change-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,33 @@ runs:
shell: bash
run: |
echo "sermantAgentCoreChanged=${{ steps.changed-sermant-agentcore.outputs.changed }}" >> $GITHUB_ENV
- uses: marceloprado/has-changed-path@v1.0.1
id: changed-sermant-agentcore-dynamic-config
with:
paths: sermant-agentcore/sermant-agentcore-implement/src/main/java/io/sermant/implement/service/dynamicconfig
sermant-agentcore/sermant-agentcore-core
sermant-integration-tests/agentcore-test/agentcore-test-application
sermant-integration-tests/agentcore-test/agentcore-integration-test
./.github/workflows/agentcore_service_test.yml
./.github/actions/common/agentcore
./.github/actions/scenarios/agentcore/dynamic-config
- name: env sermant-agentcore-dynamic-config
shell: bash
run: |
echo "sermantAgentCoreDynamicConfigServiceChanged=${{ steps.changed-sermant-agentcore-dynamic-config.outputs.changed }}" >> $GITHUB_ENV
- uses: marceloprado/has-changed-path@v1.0.1
id: changed-sermant-agentcore-xds
with:
paths: sermant-agentcore/sermant-agentcore-implement/src/main/java/io/sermant/implement/service/xds
sermant-agentcore/sermant-agentcore-core
sermant-integration-tests/xds-service-test
./.github/workflows/agentcore_service_test.yml
./.github/actions/common/xds-service
./.github/actions/scenarios/xds-service
- name: env sermant-agentcore-xds
shell: bash
run: |
echo "sermantAgentCoreXdsServiceChanged=${{ steps.changed-sermant-agentcore-xds.outputs.changed }}" >> $GITHUB_ENV
- uses: marceloprado/has-changed-path@v1.0.1
id: changed-sermant-router
with:
Expand Down Expand Up @@ -746,48 +773,56 @@ runs:
# ==========mongodb DataBase Write Prohibition is needed to test?==========
if [ ${{ env.mongodbDataBaseWriteProhibitionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableMongodbDataBaseWriteProhibitionAction=true" >> $GITHUB_ENV
fi
# ==========mysql DataBase Write Prohibition is needed to test?==========
if [ ${{ env.mysqlDataBaseWriteProhibitionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableMysqlDataBaseWriteProhibitionAction=true" >> $GITHUB_ENV
fi
# ==========opengauss DataBase Write Prohibition is needed to test?==========
if [ ${{ env.opengaussDataBaseWritePprohibitionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableOpengaussDataBaseWriteProhibitionAction=true" >> $GITHUB_ENV
fi
# ==========opengauss And Postgresql DataBase Write Prohibition is needed to test?==========
if [ ${{ env.opengaussAndPostgresqlDataBaseWritePprohibitionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableOpengaussAndPostgresqlDataBaseWriteProhibitionAction=true" >> $GITHUB_ENV
fi
# ==========kafka consume Prohibition is needed to test?==========
if [ ${{ env.kafkaConsumeProhibitionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableKafkaConsumeProhibitionAction=true" >> $GITHUB_ENV
fi
# ==========rocketmq consume Prohibition is needed to test?==========
if [ ${{ env.rocketmqConsumeProhibitionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableRocketmqConsumeProhibitionAction=true" >> $GITHUB_ENV
fi
# ==========alibaba Dubbo Tag Transmission is needed to test?==========
if [ ${{ env.alibabaDubboTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableAlibabaDubboTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========apache Dubbo Tag Transmission is needed to test?==========
if [ ${{ env.apacheDubboTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableApacheDubboTagTransmissionAction=true" >> $GITHUB_ENV
fi
Expand All @@ -800,6 +835,7 @@ runs:
# ==========httpclientV3 Tag Transmission is needed to test?==========
if [ ${{ env.httpclientV3TagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableHttpclientV3TagTransmissionAction=true" >> $GITHUB_ENV
fi
Expand All @@ -812,54 +848,75 @@ runs:
# ==========tomcat Tag Transmission is needed to test?==========
if [ ${{ env.tomcatTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableTomcatTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========jetty Tag Transmission is needed to test?==========
if [ ${{ env.jettyTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableJettyTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========kafka Tag Transmission is needed to test?==========
if [ ${{ env.kafkaTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableKafkaTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========okhttp Tag Transmission is needed to test?==========
if [ ${{ env.okhttpTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableOkhttpTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========rocketmq Tag Transmission is needed to test?==========
if [ ${{ env.rocketmqTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableRocketmqTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========servicecomb Tag Transmission is needed to test?==========
if [ ${{ env.servicecombTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableServicecombTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========sofarpc Tag Transmission is needed to test?==========
if [ ${{ env.sofarpcTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableSofarpcTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========config Tag Transmission is needed to test?==========
if [ ${{ env.configTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableConfigTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========crossthread Tag Transmission is needed to test?==========
if [ ${{ env.crossthreadTagTransmissionChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableCrossthreadTagTransmissionAction=true" >> $GITHUB_ENV
fi
# ==========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
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
fi
4 changes: 1 addition & 3 deletions .github/actions/common/tag-transmission/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,4 @@ runs:
- name: start common httpserver
shell: bash
run: |
nohup java -jar sermant-integration-tests/tag-transmission-test/httpserver-common-demo/target/httpserver-common-demo.jar > ${{ env.logDir }}/httpserver-common-demo.log 2>&1 &
- name: plugin change check
uses: ./.github/actions/common/plugin-change-check
nohup java -jar sermant-integration-tests/tag-transmission-test/httpserver-common-demo/target/httpserver-common-demo.jar > ${{ env.logDir }}/httpserver-common-demo.log 2>&1 &
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
run: |
kubectl apply -f sermant-integration-tests/xds-service-test/script/discovery/spring-server-sermant-xds-open.yaml
kubectl wait --for=condition=ready pod -l app=spring-server --timeout=10s
sleep 5s
sleep 10s
- name: test one server
shell: bash
run: |
Expand All @@ -35,7 +35,7 @@ runs:
shell: bash
run: |
kubectl delete -f sermant-integration-tests/xds-service-test/script/discovery/spring-server-sermant-xds-open.yaml
sleep 3s
sleep 10s
- name: test the number of spring-server instances changes from 1 to 0
shell: bash
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ runs:
kubectl wait --for=condition=ready pod -l app=spring-client --timeout=10s
kubectl wait --for=condition=ready pod -l app=spring-server --timeout=10s
kubectl port-forward svc/spring-client 8080:8080 &
sleep 10s
- name: test one server
shell: bash
run: |
Expand All @@ -32,7 +33,7 @@ runs:
shell: bash
run: |
kubectl delete -f sermant-integration-tests/xds-service-test/script/discovery/spring-server.yaml
sleep 3s
sleep 10s
- name: test the number of spring-server instances changes from 1 to 0
shell: bash
run: |
Expand All @@ -43,7 +44,7 @@ runs:
run: |
kubectl apply -f sermant-integration-tests/xds-service-test/script/discovery/spring-server-2-replicas.yaml
kubectl wait --for=condition=ready pod -l app=spring-server --timeout=10s
sleep 2s
sleep 10s
- name: test the number of spring-server instances changes from 0 to 2
shell: bash
run: |
Expand All @@ -62,11 +63,12 @@ runs:
shell: bash
run: |
kubectl delete -f sermant-integration-tests/xds-service-test/script/discovery/spring-client-sermant-xds-open.yaml
sleep 5s
sleep 10s
kubectl apply -f sermant-integration-tests/xds-service-test/script/discovery/spring-client-sermant-xds-subscribe-secure.yaml
kubectl wait --for=condition=ready pod -l app=spring-client --timeout=10s
pkill -f "kubectl port-forward svc/spring-client"
kubectl port-forward svc/spring-client 8080:8080 &
sleep 10s
- name: test sermant xds service use security mode
shell: bash
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ runs:
shell: bash
run: |
kubectl label namespace default istio-injection=enabled
sleep 5s
sleep 10s
kubectl apply -f sermant-integration-tests/xds-service-test/script/discovery/spring-server.yaml
kubectl wait --for=condition=ready pod -l app=spring-server --timeout=10s
sleep 10s
- name: test one server
shell: bash
run: |
Expand All @@ -34,7 +35,7 @@ runs:
shell: bash
run: |
kubectl delete -f sermant-integration-tests/xds-service-test/script/discovery/spring-server.yaml
sleep 3s
sleep 10s
- name: test the number of spring-server instances changes from 1 to 0
shell: bash
run: |
Expand All @@ -45,7 +46,7 @@ runs:
run: |
kubectl apply -f sermant-integration-tests/xds-service-test/script/discovery/spring-server-2-replicas.yaml
kubectl wait --for=condition=ready pod -l app=spring-server --timeout=10s
sleep 2s
sleep 10s
- name: test the number of spring-server instances changes from 0 to 2
shell: bash
run: |
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/agentcore_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,29 +105,6 @@ jobs:
uses: ./.github/actions/common/agentcore
- name: start agentcore common test
uses: ./.github/actions/scenarios/agentcore/common
test-for-agentcore-dynamic-config:
name: Test for agentcore dynamic config
runs-on: ubuntu-latest
needs: [build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
include:
- serviceAddress: "127.0.0.1:8848"
dynamicConfigType: "NACOS"
- serviceAddress: "127.0.0.1:2181"
dynamicConfigType: "ZOOKEEPER"
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100
- name: set java version to environment
run: |
echo "javaVersion=8" >> $GITHUB_ENV
- name: common operations
uses: ./.github/actions/common/agentcore
- name: test dynamic config for ${{ matrix.dynamicConfigType }}
uses: ./.github/actions/scenarios/agentcore/dynamic-config
test-for-agentcore-dynamic:
name: Test for agentcore dynamic
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit 3a33659

Please sign in to comment.