From 3a3365964e44ef437740e4cc4b097d6928a5d35b Mon Sep 17 00:00:00 2001 From: hanbingleixue Date: Mon, 29 Jul 2024 15:10:20 +0800 Subject: [PATCH] Optimize integration test scripts Signed-off-by: hanbingleixue --- .github/actions/common/agentcore/action.yml | 4 +- .../common/plugin-change-check/action.yml | 57 +++++ .../common/tag-transmission/action.yml | 4 +- .../client-envoy/action.yml | 4 +- .../sermant-only/action.yml | 8 +- .../server-envoy/action.yml | 7 +- .../workflows/agentcore_integration_test.yml | 23 -- .github/workflows/agentcore_service_test.yml | 196 ++++++++++++++++++ .github/workflows/xds_service_test.yml | 88 -------- 9 files changed, 266 insertions(+), 125 deletions(-) create mode 100644 .github/workflows/agentcore_service_test.yml delete mode 100644 .github/workflows/xds_service_test.yml diff --git a/.github/actions/common/agentcore/action.yml b/.github/actions/common/agentcore/action.yml index c064eb22f9..3d7777b4d8 100644 --- a/.github/actions/common/agentcore/action.yml +++ b/.github/actions/common/agentcore/action.yml @@ -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 \ No newline at end of file + key: ${{ runner.os }}-agent-${{ github.run_id }} \ No newline at end of file diff --git a/.github/actions/common/plugin-change-check/action.yml b/.github/actions/common/plugin-change-check/action.yml index 174d8182b0..5894343f47 100644 --- a/.github/actions/common/plugin-change-check/action.yml +++ b/.github/actions/common/plugin-change-check/action.yml @@ -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: @@ -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 @@ -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 @@ -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 \ No newline at end of file diff --git a/.github/actions/common/tag-transmission/action.yml b/.github/actions/common/tag-transmission/action.yml index 550a8de739..23b3da9601 100644 --- a/.github/actions/common/tag-transmission/action.yml +++ b/.github/actions/common/tag-transmission/action.yml @@ -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 \ No newline at end of file + 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 & \ No newline at end of file diff --git a/.github/actions/scenarios/xds-service/xds-service-discovery/client-envoy/action.yml b/.github/actions/scenarios/xds-service/xds-service-discovery/client-envoy/action.yml index 4b55487216..c4ded7b759 100644 --- a/.github/actions/scenarios/xds-service/xds-service-discovery/client-envoy/action.yml +++ b/.github/actions/scenarios/xds-service/xds-service-discovery/client-envoy/action.yml @@ -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: | @@ -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: | diff --git a/.github/actions/scenarios/xds-service/xds-service-discovery/sermant-only/action.yml b/.github/actions/scenarios/xds-service/xds-service-discovery/sermant-only/action.yml index 80907206bb..a3f14afd00 100644 --- a/.github/actions/scenarios/xds-service/xds-service-discovery/sermant-only/action.yml +++ b/.github/actions/scenarios/xds-service/xds-service-discovery/sermant-only/action.yml @@ -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: | @@ -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: | @@ -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: | @@ -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: | diff --git a/.github/actions/scenarios/xds-service/xds-service-discovery/server-envoy/action.yml b/.github/actions/scenarios/xds-service/xds-service-discovery/server-envoy/action.yml index 8f20cd411b..f46e5fa5de 100644 --- a/.github/actions/scenarios/xds-service/xds-service-discovery/server-envoy/action.yml +++ b/.github/actions/scenarios/xds-service/xds-service-discovery/server-envoy/action.yml @@ -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: | @@ -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: | @@ -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: | diff --git a/.github/workflows/agentcore_integration_test.yml b/.github/workflows/agentcore_integration_test.yml index aa2105019f..817f164bb3 100644 --- a/.github/workflows/agentcore_integration_test.yml +++ b/.github/workflows/agentcore_integration_test.yml @@ -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 diff --git a/.github/workflows/agentcore_service_test.yml b/.github/workflows/agentcore_service_test.yml new file mode 100644 index 0000000000..cc527942fa --- /dev/null +++ b/.github/workflows/agentcore_service_test.yml @@ -0,0 +1,196 @@ +name: agentcore servcie integration test +env: + sermantVersion: 1.0.0 +on: + push: + pull_request: + branches: + - '*' + paths: + - 'sermant-agentcore/sermant-agentcore-implement/**' + - 'sermant-agentcore/sermant-agentcore-core/**' + - 'sermant-integration-tests/xds-service-test/**' + - 'sermant-integration-tests/agentcore-test/agentcore-test-application/**' + - 'sermant-integration-tests/agentcore-test/agentcore-integration-test/**' + - 'agentcore_service_test.yml' + - '.github/actions/common/xds-service/**' + - '.github/actions/common/agentcore/**' + - '.github/actions/scenarios/xds-service/**' + - '.github/actions/scenarios/agentcore/dynamic-config/**' + - '.github/actions/common/plugin-change-check/action.yml' + - '.github/actions/common/entry/action.yml' + - '.github/actions/common/exit/action.yml' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.head_ref }} + cancel-in-progress: true +jobs: + set-execution-conditions: + name: set-execution-conditions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 100 + - name: plugin-change-check + id: plugin-change-check + uses: ./.github/actions/common/plugin-change-check + - name: set-outputs + id: set-outputs + run: | + echo "enableDynamicConfigServicAction=${{env.enableDynamicConfigServicAction}}" >> $GITHUB_OUTPUT + echo "enableXdsServicAction=${{env.enableXdsServicAction}}" >> $GITHUB_OUTPUT + outputs: + enableDynamicConfigServicAction: ${{ steps.set-outputs.outputs.enableDynamicConfigServicAction }} + enableXdsServicAction: ${{ steps.set-outputs.outputs.enableXdsServicAction }} + download-midwares-and-cache: + name: download midwares and cache + runs-on: ubuntu-latest + if: needs.set-execution-conditions.outputs.enableDynamicConfigServicAction == 'true' + needs: [ set-execution-conditions ] + steps: + - uses: actions/checkout@v3 + - 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 zookeeper + uses: actions/cache@v3 + with: + path: apache-zookeeper-3.6.3-bin.tar.gz + key: ${{ runner.os }}-apache-zookeeper-3.6.3 + restore-keys: | + ${{ runner.os }}-apache-zookeeper-3.6.3 + - name: download zookeeper + run: | + export ROOT_PATH=$(pwd) + bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh zk + - 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 + if: needs.set-execution-conditions.outputs.enableDynamicConfigServicAction == 'true' || needs.set-execution-conditions.outputs.enableXdsServicAction == 'true' + needs: [set-execution-conditions] + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'adopt' + cache: maven + - name: cache agent + uses: actions/cache@v3 + with: + path: sermant-agent-*/ + key: ${{ runner.os }}-agent-${{ github.run_id }} + - name: cache xds service package + uses: actions/cache@v3 + with: + path: sermant-integration-tests/xds-service-test/product/ + key: ${{ runner.os }}-xds-service-product-${{ github.run_id }} + - name: package agent + run: | + sed -i '/sermant-backend/d' pom.xml + sed -i '/sermant-injector/d' pom.xml + mvn package -DskipTests -Ptest --file pom.xml + cp -r sermant-integration-tests/xds-service-test/product/spring-client/agent sermant-integration-tests/xds-service-test/product/spring-server/ + mkdir -p sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/agentcore-test-plugin/plugin + mkdir -p sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/dynamic-test-first-plugin/plugin + mkdir -p sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/dynamic-test-second-plugin/plugin + mkdir -p sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/dynamic-test-third-plugin/plugin + cp ./sermant-integration-tests/agentcore-test/agentcore-test-plugin/target/agentcore-test-plugin-1.0.0.jar sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/agentcore-test-plugin/plugin/ + cp -r ./sermant-integration-tests/agentcore-test/config sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/agentcore-test-plugin/ + cp ./sermant-integration-tests/agentcore-test/dynamic-test-first-plugin/target/dynamic-test-first-plugin-1.0.0.jar sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/dynamic-test-first-plugin/plugin/ + cp ./sermant-integration-tests/agentcore-test/dynamic-test-second-plugin/target/dynamic-test-second-plugin-1.0.0.jar sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/dynamic-test-second-plugin/plugin/ + cp ./sermant-integration-tests/agentcore-test/dynamic-test-third-plugin/target/dynamic-test-third-plugin-1.0.0.jar sermant-agent-${{ env.sermantVersion }}/agent/pluginPackage/dynamic-test-third-plugin/plugin/ + cp ./sermant-integration-tests/agentcore-test/agentcore-test-application/target/agentcore-test-application-1.0.0-jar-with-dependencies.jar sermant-agent-${{ env.sermantVersion }}/agent/ + sed -i '/plugins:/a \ - agentcore-test-plugin' sermant-agent-${{ env.sermantVersion }}/agent/config/plugins.yaml + test-for-agentcore-dynamic-config: + name: Test for agentcore dynamic config + runs-on: ubuntu-latest + if: needs.set-execution-conditions.outputs.enableDynamicConfigServicAction == 'true' + needs: [ set-execution-conditions, 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-xds-service-discovery-onlysermant: + name: Test for xds service discovery with only sermant + runs-on: ubuntu-latest + if: needs.set-execution-conditions.outputs.enableXdsServicAction == 'true' + needs: [set-execution-conditions, build-agent-and-cache] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 100 + - name: set java version to environment + run: | + echo "javaVersion=8" >> $GITHUB_ENV + - name: xds common operation + uses: ./.github/actions/common/xds-service + - name: xds service discovery + uses: ./.github/actions/scenarios/xds-service/xds-service-discovery/sermant-only + test-for-xds-service-discovery-with-server-envoy: + name: Test for xds service discovery with spring-server using envoy + runs-on: ubuntu-latest + if: needs.set-execution-conditions.outputs.enableXdsServicAction == 'true' + needs: [set-execution-conditions, build-agent-and-cache] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 100 + - name: set java version to environment + run: | + echo "javaVersion=8" >> $GITHUB_ENV + - name: xds common operation + uses: ./.github/actions/common/xds-service + - name: xds service discovery + uses: ./.github/actions/scenarios/xds-service/xds-service-discovery/server-envoy + test-for-xds-service-discovery-with-client-envoy: + name: Test for xds service discovery with spring-client using enovy + runs-on: ubuntu-latest + if: needs.set-execution-conditions.outputs.enableXdsServicAction == 'true' + needs: [set-execution-conditions, build-agent-and-cache] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 100 + - name: set java version to environment + run: | + echo "javaVersion=8" >> $GITHUB_ENV + - name: xds common operation + uses: ./.github/actions/common/xds-service + - name: xds service discovery + uses: ./.github/actions/scenarios/xds-service/xds-service-discovery/client-envoy \ No newline at end of file diff --git a/.github/workflows/xds_service_test.yml b/.github/workflows/xds_service_test.yml deleted file mode 100644 index b57404e41a..0000000000 --- a/.github/workflows/xds_service_test.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: xds integration test -on: - push: - pull_request: - branches: - - '*' - paths: - - 'sermant-agentcore/**' - - 'sermant-integration-tests/xds-service-test/**' - - '.github/workflows/xds_service_test.yml' - - '.github/actions/common/xds-service/**' - - '.github/actions/scenarios/xds-service/**' -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.head_ref }} - cancel-in-progress: true -jobs: - build-agent-and-cache: - name: build agent and cache - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - java-version: '8' - distribution: 'adopt' - cache: maven - - name: cache agent - uses: actions/cache@v3 - with: - path: sermant-agent-*/ - key: ${{ runner.os }}-agent-${{ github.run_id }} - - name: cache xds service package - uses: actions/cache@v3 - with: - path: sermant-integration-tests/xds-service-test/product/ - key: ${{ runner.os }}-xds-service-product-${{ github.run_id }} - - name: package agent - run: | - sed -i '/sermant-backend/d' pom.xml - sed -i '/sermant-injector/d' pom.xml - mvn package -DskipTests -Ptest --file pom.xml - cp -r sermant-integration-tests/xds-service-test/product/spring-client/agent sermant-integration-tests/xds-service-test/product/spring-server/ - test-for-xds-service-discovery-onlysermant: - name: Test for xds service discovery with only sermant - runs-on: ubuntu-latest - needs: [build-agent-and-cache] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 100 - - name: set java version to environment - run: | - echo "javaVersion=8" >> $GITHUB_ENV - - name: xds common operation - uses: ./.github/actions/common/xds-service - - name: xds service discovery - uses: ./.github/actions/scenarios/xds-service/xds-service-discovery/sermant-only - test-for-xds-service-discovery-with-server-envoy: - name: Test for xds service discovery with spring-server using envoy - runs-on: ubuntu-latest - needs: [build-agent-and-cache] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 100 - - name: set java version to environment - run: | - echo "javaVersion=8" >> $GITHUB_ENV - - name: xds common operation - uses: ./.github/actions/common/xds-service - - name: xds service discovery - uses: ./.github/actions/scenarios/xds-service/xds-service-discovery/server-envoy - test-for-xds-service-discovery-with-client-envoy: - name: Test for xds service discovery with spring-client using enovy - runs-on: ubuntu-latest - needs: [build-agent-and-cache] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 100 - - name: set java version to environment - run: | - echo "javaVersion=8" >> $GITHUB_ENV - - name: xds common operation - uses: ./.github/actions/common/xds-service - - name: xds service discovery - uses: ./.github/actions/scenarios/xds-service/xds-service-discovery/client-envoy \ No newline at end of file