Skip to content

Commit

Permalink
rocketmq禁消费集成测试脚本
Browse files Browse the repository at this point in the history
Signed-off-by: daizhenyu <[email protected]>
  • Loading branch information
daizhenyu committed Jan 15, 2024
1 parent 9cc6a63 commit fa60ebc
Show file tree
Hide file tree
Showing 23 changed files with 735 additions and 175 deletions.
3 changes: 2 additions & 1 deletion .github/actions/common/mq-consume-prohibition/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ runs:
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/mq-consume-prohibition/common
log-dir: ./logs/mq-consume-prohibition/common
key: ${{ runner.os }}-agent-${{ github.run_id }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: "MQ Consume Prohibition Plugin rocketmq Test"
description: "Auto test for mq consume prohibition by rocketmq with one topic"
runs:
using: composite
steps:
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/mq-consume-prohibition/rocketmq-one-topic
- name: get rocketmq from cache
uses: actions/cache@v3
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/-Xms4g -Xmx4g -Xmn2g/-Xms1g -Xmx1g -Xmn1g/g' rocketmq-all-5.1.4-bin-release/bin/runserver.sh
sed -i 's/-Xms4g -Xmx4g/-Xms1g -Xmx1g/g' rocketmq-all-5.1.4-bin-release/bin/runserver.sh
nohup bash rocketmq-all-5.1.4-bin-release/bin/mqnamesrv &
- name: start rocketmq broker
shell: bash
run: |
sed -i 's/-Xms8g -Xmx8g/-Xms1g -Xmx1g/g' rocketmq-all-5.1.4-bin-release/bin/runbroker.sh
sed -i 's/-Xmn4g/-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 &
- name: package demos
shell: bash
run: |
mvn package -Drocketmq-client.version=${{ matrix.rocketMqVersion }} -DskipTests -Procketmq-one-topic-test --file \
sermant-integration-tests/mq-consume-prohibition-test/pom.xml
- name: start rocketmq producer demo
shell: bash
run: |
nohup java -jar \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-producer-demo/target/rocketmq-producer-demo.jar > ${{ env.logDir }}/rocketmq-producer.log 2>&1 &
- name: start rocketmq push consumer demo
shell: bash
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
-Dsermant_log_dir=${{ env.logDir }}/rocketmq-push-consumer \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-consumer-push-demo/target/rocketmq-consumer-push-demo.jar > ${{ env.logDir }}/rocketmq-push-consumer.log 2>&1 &
- name: start rocketmq pull subscribe consumer demo
shell: bash
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
-Dsermant_log_dir=${{ env.logDir }}/rocketmq-pull-subscribe-consumer \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-consumer-pull-subscribe-demo/target/rocketmq-consumer-pull-subscribe-demo.jar > ${{ env.logDir }}/rocketmq-pull-subscribe-consumer.log 2>&1 &
- name: start rocketmq pull assign consumer demo
shell: bash
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
-Dsermant_log_dir=${{ env.logDir }}/rocketmq-pull-assign-consumer \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-consumer-pull-assign-demo/target/rocketmq-consumer-pull-assign-demo.jar > ${{ env.logDir }}/rocketmq-pull-assignconsumer.log 2>&1 &
- name: waiting for services start
shell: bash
run: |
ps -ef | grep java
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9059/checkStatus 120
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9056/checkStatus 120
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9058/checkStatus 120
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9057/checkStatus 120
- name: test rocketmq
shell: bash
run: |
mvn test -Dmq.consume.prohibition.integration.test.type=ROCKETMQ_ONE_TOPIC --file \
sermant-integration-tests/mq-consume-prohibition-test/mq-consume-prohibition-integration-test/pom.xml
- name: exit
if: always()
uses: ./.github/actions/common/exit
with:
processor-keyword: rocketmq
- name: if failure then upload error log
uses: actions/upload-artifact@v3
if: ${{ failure() || cancelled() }}
with:
name: (${{ github.job }})-mq-consume-prohibition-rocketmq-one-topic-(${{ matrix.rocketMqVersion }}-logs
path: |
./*.log
./logs/**
if-no-files-found: warn
retention-days: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: "MQ Consume Prohibition Plugin rocketmq Test"
description: "Auto test for mq consume prohibition by rocketmq with two consumer"
runs:
using: composite
steps:
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/mq-consume-prohibition/rocketmq-two-consumer
- name: get rocketmq from cache
uses: actions/cache@v3
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/-Xms4g -Xmx4g -Xmn2g/-Xms1g -Xmx1g -Xmn1g/g' rocketmq-all-5.1.4-bin-release/bin/runserver.sh
sed -i 's/-Xms4g -Xmx4g/-Xms1g -Xmx1g/g' rocketmq-all-5.1.4-bin-release/bin/runserver.sh
nohup bash rocketmq-all-5.1.4-bin-release/bin/mqnamesrv &
- name: start rocketmq broker
shell: bash
run: |
sed -i 's/-Xms8g -Xmx8g/-Xms1g -Xmx1g/g' rocketmq-all-5.1.4-bin-release/bin/runbroker.sh
sed -i 's/-Xmn4g/-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 &
- name: package demos
shell: bash
run: |
mvn package -Drocketmq-client.version=${{ matrix.rocketMqVersion }} -DskipTests -Procketmq-two-consumer-test --file \
sermant-integration-tests/mq-consume-prohibition-test/pom.xml
- name: start rocketmq producer demo
shell: bash
run: |
nohup java -jar \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-producer-demo/target/rocketmq-producer-demo.jar > ${{ env.logDir }}/rocketmq-producer.log 2>&1 &
- name: start first rocketmq push consumer demo
shell: bash
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
-Dsermant_log_dir=${{ env.logDir }}/rocketmq-push-consumer \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-consumer-push-demo/target/rocketmq-consumer-push-demo.jar > ${{ env.logDir }}/rocketmq-push-consumer-first.log 2>&1 &
- name: start second rocketmq push consumer demo
shell: bash
run: |
nohup java -jar -Dserver.port=9060 \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-consumer-push-demo/target/rocketmq-consumer-push-demo.jar > ${{ env.logDir }}/rocketmq-push-consumer-second.log 2>&1 &
- name: start rocketmq pull subscribe consumer demo
shell: bash
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
-Dsermant_log_dir=${{ env.logDir }}/rocketmq-pull-subscribe-consumer \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-consumer-pull-subscribe-demo/target/rocketmq-consumer-pull-subscribe-demo.jar > ${{ env.logDir }}/rocketmq-pull-subscribe-consumer-first.log 2>&1 &
- name: start rocketmq pull subscribe consumer demo
shell: bash
run: |
nohup java -jar -Dserver.port=9056 \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-consumer-pull-subscribe-demo/target/rocketmq-consumer-pull-subscribe-demo.jar > ${{ env.logDir }}/rocketmq-pull-subscribe-consumer-second.log 2>&1 &
- name: waiting for services start
shell: bash
run: |
ps -ef | grep java
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9060/checkStatus 120
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9059/checkStatus 120
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9058/checkStatus 120
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9057/checkStatus 120
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9056/checkStatus 120
- name: test rocketmq
shell: bash
run: |
mvn test -Dmq.consume.prohibition.integration.test.type=ROCKETMQ_TWO_CONSUMER --file \
sermant-integration-tests/mq-consume-prohibition-test/mq-consume-prohibition-integration-test/pom.xml
- name: exit
if: always()
uses: ./.github/actions/common/exit
with:
processor-keyword: rocketmq
- name: if failure then upload error log
uses: actions/upload-artifact@v3
if: ${{ failure() || cancelled() }}
with:
name: (${{ github.job }})-mq-consume-prohibition-rocketmq-two-consumer-(${{ matrix.rocketMqVersion }}-logs
path: |
./*.log
./logs/**
if-no-files-found: warn
retention-days: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: "MQ Consume Prohibition Plugin rocketmq Test"
description: "Auto test for mq consume prohibition by rocketmq with two topic"
runs:
using: composite
steps:
- name: entry
uses: ./.github/actions/common/entry
with:
log-dir: ./logs/mq-consume-prohibition/rocketmq-two-topic
- name: get rocketmq from cache
uses: actions/cache@v3
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/-Xms4g -Xmx4g -Xmn2g/-Xms1g -Xmx1g -Xmn1g/g' rocketmq-all-5.1.4-bin-release/bin/runserver.sh
sed -i 's/-Xms4g -Xmx4g/-Xms1g -Xmx1g/g' rocketmq-all-5.1.4-bin-release/bin/runserver.sh
nohup bash rocketmq-all-5.1.4-bin-release/bin/mqnamesrv &
- name: start rocketmq broker
shell: bash
run: |
sed -i 's/-Xms8g -Xmx8g/-Xms1g -Xmx1g/g' rocketmq-all-5.1.4-bin-release/bin/runbroker.sh
sed -i 's/-Xmn4g/-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 &
- name: package demos
shell: bash
run: |
mvn package -Drocketmq-client.version=${{ matrix.rocketMqVersion }} -DskipTests -Procketmq-two-topic-test --file \
sermant-integration-tests/mq-consume-prohibition-test/pom.xml
- name: start rocketmq producer demo
shell: bash
run: |
nohup java -jar \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-producer-demo/target/rocketmq-producer-demo.jar > ${{ env.logDir }}/rocketmq-producer.log 2>&1 &
- name: start rocketmq push consumer demo
shell: bash
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
-Dsermant_log_dir=${{ env.logDir }}/rocketmq-push-consumer \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-consumer-push-demo/target/rocketmq-consumer-push-demo.jar > ${{ env.logDir }}/rocketmq-push-consumer.log 2>&1 &
- name: start rocketmq pull subscribe consumer demo
shell: bash
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
-Dsermant_log_dir=${{ env.logDir }}/rocketmq-pull-subscribe-consumer \
sermant-integration-tests/mq-consume-prohibition-test/rocketmq-consumer-pull-subscribe-demo/target/rocketmq-consumer-pull-subscribe-demo.jar > ${{ env.logDir }}/rocketmq-pull-subscribe-consumer.log 2>&1 &
- name: waiting for services start
shell: bash
run: |
ps -ef | grep java
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9059/checkStatus 120
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9058/checkStatus 120
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9057/checkStatus 120
- name: test rocketmq
shell: bash
run: |
mvn test -Dmq.consume.prohibition.integration.test.type=ROCKETMQ_TWO_TOPIC --file \
sermant-integration-tests/mq-consume-prohibition-test/mq-consume-prohibition-integration-test/pom.xml
- name: exit
if: always()
uses: ./.github/actions/common/exit
with:
processor-keyword: rocketmq
- name: if failure then upload error log
uses: actions/upload-artifact@v3
if: ${{ failure() || cancelled() }}
with:
name: (${{ github.job }})-mq-consume-prohibition-rocketmq-two-topic-(${{ matrix.rocketMqVersion }}-logs
path: |
./*.log
./logs/**
if-no-files-found: warn
retention-days: 2
89 changes: 82 additions & 7 deletions .github/workflows/mq_consume_prohibition_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ on:
- 'sermant-agentcore/**'
- 'sermant-integration-tests/mq-consume-prohibition-test/**'
- 'sermant-plugins/sermant-mq-consume-prohibition/**'
- '.github/workflows/mq-consume-prohibition_integration_test.yml'
- '.github/actions/scenarios/mq-consume-prohibition/**'
- '.github/workflows/mq_consume_prohibition_integration_test.yml'
- '.github/actions/common/mq-consume-prohibition/**'
- '.github/actions/scenarios/mq-consume-prohibition/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.head_ref }}
cancel-in-progress: true
Expand All @@ -36,14 +36,14 @@ jobs:
- name: cache rocketmq
uses: actions/cache@v3
with:
path: rocketmq-all-4.8.0-bin-release.zip
key: ${{ runner.os }}-rocketmq-all-4.8.0-bin-release
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-4.8.0-bin-release
${{ runner.os }}-rocketmq-all-5.1.4-bin-release
- name: download rocketmq
run: |
export ROOT_PATH=$(pwd)
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh rocketmq
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh rocketmq514
- name: cache kafka
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -111,4 +111,79 @@ jobs:
- name: common operations
uses: ./.github/actions/common/mq-consume-prohibition
- name: mq-consume-prohibition test for kafkaVersion=${{ matrix.kafkaVersion }}
uses: ./.github/actions/scenarios/mq-consume-prohibition/kafka
uses: ./.github/actions/scenarios/mq-consume-prohibition/kafka
test-for-rocketmq-one-topic:
name: Test for rocketmq consumer with one topic
runs-on: ubuntu-latest
needs: [build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
include:
- rocketMqVersion: "4.6.1"
- rocketMqVersion: "4.7.1"
- rocketMqVersion: "4.8.0"
- rocketMqVersion: "4.9.7"
- rocketMqVersion: "5.0.0"
- rocketMqVersion: "5.1.4"
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/mq-consume-prohibition
- name: mq-consume-prohibition-rocketmq test for rocketMqVersion=${{ matrix.rocketMqVersion }}
uses: ./.github/actions/scenarios/mq-consume-prohibition/rocketmq/rocketmq-one-topic
test-for-rocketmq-two-topic:
name: Test for rocketmq consumer with two topic
runs-on: ubuntu-latest
needs: [build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
include:
- rocketMqVersion: "4.6.1"
- rocketMqVersion: "4.7.1"
- rocketMqVersion: "4.8.0"
- rocketMqVersion: "4.9.7"
- rocketMqVersion: "5.0.0"
- rocketMqVersion: "5.1.4"
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/mq-consume-prohibition
- name: mq-consume-prohibition test for rocketMqVersion=${{ matrix.rocketMqVersion }}
uses: ./.github/actions/scenarios/mq-consume-prohibition/rocketmq/rocketmq-two-topic
test-for-rocketmq-two-consumer:
name: Test for rocketmq consumer with two consumer
runs-on: ubuntu-latest
needs: [build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
include:
- rocketMqVersion: "4.6.1"
- rocketMqVersion: "4.7.1"
- rocketMqVersion: "4.8.0"
- rocketMqVersion: "4.9.7"
- rocketMqVersion: "5.0.0"
- rocketMqVersion: "5.1.4"
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/mq-consume-prohibition
- name: mq-consume-prohibition test for rocketMqVersion=${{ matrix.rocketMqVersion }}
uses: ./.github/actions/scenarios/mq-consume-prohibition/rocketmq/rocketmq-two-consumer
Loading

0 comments on commit fa60ebc

Please sign in to comment.