Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rocketmq gray plugin workflow test #1660

Merged
merged 1 commit into from
Jan 6, 2025
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
59 changes: 59 additions & 0 deletions .github/actions/common/mq-grayscale/rocketmq/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "Rocketmq Message Gray Common operations"
description: "Do something common for rocketmq message gray"
runs:
using: "composite"
steps:
- name: Set up JDK ${{ env.javaVersion }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.javaVersion }}
distribution: 'adopt'
cache: maven
- name: download agent
uses: actions/cache@v4
with:
path: sermant-agent-*/
key: ${{ runner.os }}-agent-${{ github.run_id }}
- name: get cse from cache
uses: actions/cache@v4
with:
path: Local-CSE-2.1.3-linux-amd64.zip
key: ${{ runner.os }}-local-cse
restore-keys: |
${{ runner.os }}-local-cse
- name: start cse
shell: bash
run: |
export ROOT_PATH=$(pwd)
bash ./sermant-integration-tests/scripts/startCse.sh
- name: get rocketmq from cache
uses: actions/cache@v4
with:
path: rocketmq-all-5.1.4-bin-release.zip
key: ${{ runner.os }}-rocketmq-all-5.1.4-bin-release
restore-keys: |
${{ runner.os }}-rocketmq-all-5.1.4-bin-release
- name: start rocketmq server
shell: bash
run: |
unzip rocketmq-all-5.1.4-bin-release.zip
sed -i 's/if \[\[ "$JAVA_MAJOR_VERSION" -lt "9" \]\]/if [ "$JAVA_MAJOR_VERSION" -lt "9" ]/g' rocketmq-all-5.1.4-bin-release/bin/runserver.sh
sed -i 's/-Xms4g -Xmx4g -Xmn2g/-Xms1g -Xmx1g -Xmn1g/g' rocketmq-all-5.1.4-bin-release/bin/runserver.sh
sed -i '22i enablePropertyFilter = true' rocketmq-all-5.1.4-bin-release/conf/broker.conf
nohup bash rocketmq-all-5.1.4-bin-release/bin/mqnamesrv &
- name: start rocketmq broker
shell: bash
run: |
sed -i 's/-Xms8g -Xmx8g -Xmn4g/-Xms1g -Xmx1g -Xmn1g/g' rocketmq-all-5.1.4-bin-release/bin/runbroker.sh
nohup bash rocketmq-all-5.1.4-bin-release/bin/mqbroker -n localhost:9876 -c rocketmq-all-5.1.4-bin-release/conf/broker.conf &
- name: cache dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/rocketmq-grayscale/common
23 changes: 23 additions & 0 deletions .github/actions/common/plugin-change-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,22 @@ runs:
shell: bash
run: |
echo "crossthreadTagTransmissionChanged=${{ steps.changed-tag-transmission-crossthread.outputs.changed }}" >> $GITHUB_ENV
- uses: ktamas77/[email protected]
id: changed-mq-grayscale-rocketmq
with:
paths: sermant-plugins/sermant-mq-grayscale/mq-config-common
sermant-plugins/sermant-mq-grayscale/mq-config-service
sermant-plugins/sermant-mq-grayscale/mq-grayscale-rocketmq-plugin
sermant-integration-tests/mq-grayscale-rocketmq-test/grayscale-rocketmq-consumer-demo
sermant-integration-tests/mq-grayscale-rocketmq-test/grayscale-rocketmq-producer-demo
sermant-integration-tests/mq-grayscale-rocketmq-test/grayscale-rocketmq-integration-test
./.github/workflows/message_gray_integration_test.yml
./.github/actions/common/mq-grayscale/rocketmq
./.github/actions/scenarios/mq-grayscale/rocketmq
- name: env mq-grayscale-rocketmq
shell: bash
run: |
echo "mqGrayscaleRocketMqChanged=${{ steps.changed-mq-grayscale-rocketmq.outputs.changed }}" >> $GITHUB_ENV
- uses: ktamas77/[email protected]
id: changed-dubbo-router-action
with:
Expand Down Expand Up @@ -924,3 +940,10 @@ runs:
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableXdsServicAction=true" >> $GITHUB_ENV
fi

# ==========mq grayscale rocketmq is needed to test?==========
if [ ${{ env.mqGrayscaleRocketMqChanged }} == 'true' -o \
${{ env.sermantAgentCoreChanged }} == 'true' -o \
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
echo "enableMqGrayscaleRocketMqAction=true" >> $GITHUB_ENV
fi
86 changes: 86 additions & 0 deletions .github/actions/scenarios/mq-grayscale/rocketmq/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: "RocketMq Grayscale Test"
description: "Auto test for rocketMq grayscale"
runs:
using: "composite"
steps:
- name: package rocketmq grayscale tests
shell: bash
run: mvn package -Drocketmq-client.version=${{ matrix.rocketMqClientVersion }} -DskipTests --file sermant-integration-tests/mq-grayscale-rocketmq-test/pom.xml
- name: echo test model
shell: bash
run: |
echo "=======test-model======"-${{ matrix.test-model }}
- name: start base producer service
shell: bash
env:
dynamic.config.dynamicConfigType: KIE
dynamic.config.serverAddress: 127.0.0.1:30110
SERVICE_META_ENVIRONMENT: development
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=grayscale-rocketmq-producer -jar \
sermant-integration-tests/mq-grayscale-rocketmq-test/grayscale-rocketmq-producer-demo/target/grayscale-rocketmq-producer-demo.jar > ${{ env.logDir }}/${{ matrix.rocketMqClientVersion }}-rocketmq-producer-base.log 2>&1 &
- name: start gray producer service
shell: bash
env:
dynamic.config.dynamicConfigType: KIE
dynamic.config.serverAddress: 127.0.0.1:30110
SERVICE_META_ENVIRONMENT: development
SERVICE_META_VERSION: 1.0.1
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=grayscale-rocketmq-producer -Dserver.port=9040 -jar \
sermant-integration-tests/mq-grayscale-rocketmq-test/grayscale-rocketmq-producer-demo/target/grayscale-rocketmq-producer-demo.jar > ${{ env.logDir }}/${{ matrix.rocketMqClientVersion }}-rocketmq-producer-gray.log 2>&1 &
- name: start base consumer service
shell: bash
env:
dynamic.config.dynamicConfigType: KIE
dynamic.config.serverAddress: 127.0.0.1:30110
SERVICE_META_ENVIRONMENT: development
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=grayscale-rocketmq-consumer -jar \
sermant-integration-tests/mq-grayscale-rocketmq-test/grayscale-rocketmq-consumer-demo/target/grayscale-rocketmq-consumer-demo.jar > ${{ env.logDir }}/${{ matrix.rocketMqClientVersion }}-rocketmq-consumer-base.log 2>&1 &
- name: start gray consumer service
shell: bash
if: matrix.test-model == 'AUTO_BASE_GRAY_PULL' || matrix.test-model == 'AUTO_BASE_GRAY_LITE_PULL' || matrix.test-model == 'AUTO_BASE_GRAY_PUSH' || matrix.test-model == 'AUTO_EXC_BASE_GRAY' || matrix.test-model == 'BASE_BASE_GRAY' || matrix.test-model == 'BASE_EXC_BASE_GRAY'
env:
dynamic.config.dynamicConfigType: KIE
dynamic.config.serverAddress: 127.0.0.1:30110
SERVICE_META_ENVIRONMENT: development
SERVICE_META_VERSION: 1.0.1
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=grayscale-rocketmq-consumer -Dserver.port=9010 -jar \
sermant-integration-tests/mq-grayscale-rocketmq-test/grayscale-rocketmq-consumer-demo/target/grayscale-rocketmq-consumer-demo.jar > ${{ env.logDir }}/${{ matrix.rocketMqClientVersion }}-rocketmq-consumer-gray.log 2>&1 &
- name: waiting for service start for only base
shell: bash
if: matrix.test-model != 'AUTO_BASE_GRAY_PULL' && matrix.test-model != 'AUTO_BASE_GRAY_LITE_PULL' && matrix.test-model != 'AUTO_BASE_GRAY_PUSH' && matrix.test-model != 'AUTO_EXC_BASE_GRAY' && matrix.test-model != 'BASE_BASE_GRAY' && matrix.test-model != 'BASE_EXC_BASE_GRAY'
run: |
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9030/actuator/health 200
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9040/actuator/health 200
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9000/actuator/health 200
- name: waiting for service start for base and gray
shell: bash
if: matrix.test-model == 'AUTO_BASE_GRAY_PULL' || matrix.test-model == 'AUTO_BASE_GRAY_LITE_PULL' || matrix.test-model == 'AUTO_BASE_GRAY_PUSH' || matrix.test-model == 'AUTO_EXC_BASE_GRAY' || matrix.test-model == 'BASE_BASE_GRAY' || matrix.test-model == 'BASE_EXC_BASE_GRAY'
run: |
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9030/actuator/health 200
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9040/actuator/health 200
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9000/actuator/health 200
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9010/actuator/health 200
- name: test message grayscale rocketmq
shell: bash
run: |
mvn test -Dgrayscale.rocketmq.integration.test.type=${{ matrix.test-model }} --file \
sermant-integration-tests/mq-grayscale-rocketmq-test/grayscale-rocketmq-integration-test/pom.xml
- name: exit
if: always()
uses: ./.github/actions/common/exit
with:
processor-keyword: grayscale-rocketmq
- name: if failure then upload error log
uses: actions/upload-artifact@v3
if: ${{ failure() || cancelled() }}
with:
name: (test-for-grayscale-rocketmq)-(${{ matrix.test-model }}})-logs
path: |
./*.log
./logs/**/*.log
if-no-files-found: warn
retention-days: 2
Loading
Loading