Skip to content

Commit

Permalink
Optimized message gray plugin workflow test case
Browse files Browse the repository at this point in the history
Signed-off-by: chengyouling <[email protected]>
  • Loading branch information
chengyouling committed Jan 15, 2025
1 parent ffbdcd6 commit bd35f60
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 50 deletions.
4 changes: 4 additions & 0 deletions .github/actions/scenarios/mq-grayscale/rocketmq/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ runs:
dynamic.config.dynamicConfigType: KIE
dynamic.config.serverAddress: 127.0.0.1:30110
SERVICE_META_ENVIRONMENT: development
SERVICE_META_SERVICE: ${{ matrix.test-model }}
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 &
Expand All @@ -26,6 +27,7 @@ runs:
dynamic.config.serverAddress: 127.0.0.1:30110
SERVICE_META_ENVIRONMENT: development
SERVICE_META_VERSION: 1.0.1
SERVICE_META_SERVICE: ${{ matrix.test-model }}
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 &
Expand All @@ -35,6 +37,7 @@ runs:
dynamic.config.dynamicConfigType: KIE
dynamic.config.serverAddress: 127.0.0.1:30110
SERVICE_META_ENVIRONMENT: development
SERVICE_META_SERVICE: ${{ matrix.test-model }}
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 &
Expand All @@ -46,6 +49,7 @@ runs:
dynamic.config.serverAddress: 127.0.0.1:30110
SERVICE_META_ENVIRONMENT: development
SERVICE_META_VERSION: 1.0.1
SERVICE_META_SERVICE: ${{ matrix.test-model }}
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 &
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/message_gray_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
name: Test for pull base only for auto rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-plugin-false]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['AUTO_ONLY_BASE']
Expand All @@ -143,7 +143,7 @@ jobs:
name: Test for pull base only for auto exclude rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-auto-only-base]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['AUTO_EXC_ONLY_BASE']
Expand All @@ -164,7 +164,7 @@ jobs:
name: Test for pull base gray for auto rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-auto-exc-only-base]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['AUTO_BASE_GRAY_PULL']
Expand All @@ -185,7 +185,7 @@ jobs:
name: Test for pull base gray for auto rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-auto-exc-only-base]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['AUTO_BASE_GRAY_LITE_PULL']
Expand All @@ -206,7 +206,7 @@ jobs:
name: Test for pull base gray for auto rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-auto-exc-only-base]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['AUTO_BASE_GRAY_PUSH']
Expand All @@ -227,7 +227,7 @@ jobs:
name: Test for pull base gray for auto exclude rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-auto-base-gray]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['AUTO_EXC_BASE_GRAY']
Expand All @@ -248,7 +248,7 @@ jobs:
name: Test for pull base only for base rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-auto-exc-base-gray]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['BASE_ONLY_BASE']
Expand All @@ -269,7 +269,7 @@ jobs:
name: Test for pull base only for base exclude rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-base-only-base]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['BASE_EXC_ONLY_BASE']
Expand All @@ -290,7 +290,7 @@ jobs:
name: Test for pull base gray for base rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-base-exc-only-base]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['BASE_BASE_GRAY']
Expand All @@ -311,7 +311,7 @@ jobs:
name: Test for pull base gray for base exclude rule
runs-on: ubuntu-latest
if: needs.set-execution-conditions.outputs.enableMqGrayscaleRocketMqAction=='true'
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache, test-for-base-base-gray]
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache]
strategy:
matrix:
test-model: ['BASE_EXC_BASE_GRAY']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void testPluginEnabledFalseConsumeMessage() throws InterruptedException {

private void testPluginEnabledFalsePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PULL);
Thread.sleep(50000);
Thread.sleep(150000);
String baseResult = getPullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -69,7 +69,7 @@ private void testPluginEnabledFalsePull() throws InterruptedException {

private void testPluginEnabledFalseLitePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_LITE_PULL);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getLitePullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -79,7 +79,7 @@ private void testPluginEnabledFalseLitePull() throws InterruptedException {

private void testPluginEnabledFalsePush() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PUSH);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getPushBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand Down Expand Up @@ -108,7 +108,7 @@ public void testAutoOnlyBaseConsumeMessage() throws InterruptedException {

private void testAutoOnlyBasePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PULL);
Thread.sleep(50000);
Thread.sleep(150000);
String baseResult = getPullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -118,7 +118,7 @@ private void testAutoOnlyBasePull() throws InterruptedException {

private void testAutoOnlyBaseLitePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_LITE_PULL);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getLitePullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -128,7 +128,7 @@ private void testAutoOnlyBaseLitePull() throws InterruptedException {

private void testAutoOnlyBasePush() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PUSH);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getPushBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -149,7 +149,7 @@ public void testAutoExcOnlyBaseConsumeMessage() throws InterruptedException {

private void testAutoExcOnlyBasePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PULL);
Thread.sleep(50000);
Thread.sleep(150000);
String baseResult = getPullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -159,7 +159,7 @@ private void testAutoExcOnlyBasePull() throws InterruptedException {

private void testAutoExcOnlyBaseLitePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_LITE_PULL);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getLitePullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -169,7 +169,7 @@ private void testAutoExcOnlyBaseLitePull() throws InterruptedException {

private void testAutoExcOnlyBasePush() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PUSH);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getPushBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -193,7 +193,7 @@ public void testAutoBaseGrayConsumeMessage() throws InterruptedException {
public void testAutoBaseGrayPull() throws InterruptedException {
createGrayscaleConfig("AUTO", "");
initAndProduceMessage(true, CONSUMER_TYPE_PULL);
Thread.sleep(50000);
Thread.sleep(150000);
String grayResult = getPullGrayResult();
int grayGrayCount = parseGrayMessageCount(grayResult);
String baseResult = getPullBaseResult();
Expand All @@ -206,7 +206,7 @@ public void testAutoBaseGrayPull() throws InterruptedException {
public void testAutoBaseGrayLitePull() throws InterruptedException {
createGrayscaleConfig("AUTO", "");
initAndProduceMessage(true, CONSUMER_TYPE_LITE_PULL);
Thread.sleep(180000);
Thread.sleep(200000);
String grayResult = getLitePullGrayResult();
int grayBaseCount = parseBaseMessageCount(grayResult);
int grayGrayCount = parseGrayMessageCount(grayResult);
Expand All @@ -221,7 +221,7 @@ public void testAutoBaseGrayLitePull() throws InterruptedException {
public void testAutoBaseGrayPush() throws InterruptedException {
createGrayscaleConfig("AUTO", "");
initAndProduceMessage(true, CONSUMER_TYPE_PUSH);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getPushBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -244,7 +244,7 @@ public void testAutoExcBaseGrayConsumeMessage() throws InterruptedException {

private void testAutoExcBaseGrayPull() throws InterruptedException {
initAndProduceMessage(true, CONSUMER_TYPE_PULL);
Thread.sleep(50000);
Thread.sleep(150000);
String grayResult = getPullGrayResult();
int grayBaseCount = parseBaseMessageCount(grayResult);
int grayGrayCount = parseGrayMessageCount(grayResult);
Expand All @@ -257,7 +257,7 @@ private void testAutoExcBaseGrayPull() throws InterruptedException {

private void testAutoExcBaseGrayLitePull() throws InterruptedException {
initAndProduceMessage(true, CONSUMER_TYPE_LITE_PULL);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getLitePullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -270,7 +270,7 @@ private void testAutoExcBaseGrayLitePull() throws InterruptedException {

private void testAutoExcBaseGrayPush() throws InterruptedException {
initAndProduceMessage(true, CONSUMER_TYPE_PUSH);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getPushBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -294,7 +294,7 @@ public void testBaseOnlyBaseConsumeMessage() throws InterruptedException {

private void testBaseOnlyBasePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PULL);
Thread.sleep(50000);
Thread.sleep(150000);
String baseResult = getPullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -304,7 +304,7 @@ private void testBaseOnlyBasePull() throws InterruptedException {

private void testBaseOnlyBaseLitePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_LITE_PULL);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getLitePullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -314,7 +314,7 @@ private void testBaseOnlyBaseLitePull() throws InterruptedException {

private void testBaseOnlyBasePush() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PUSH);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getPushBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -335,7 +335,7 @@ public void testBaseExcOnlyBaseConsumeMessage() throws InterruptedException {

private void testBaseExcOnlyBasePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PULL);
Thread.sleep(50000);
Thread.sleep(150000);
String baseResult = getPullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -345,7 +345,7 @@ private void testBaseExcOnlyBasePull() throws InterruptedException {

private void testBaseExcOnlyBaseLitePull() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_LITE_PULL);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getLitePullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -355,7 +355,7 @@ private void testBaseExcOnlyBaseLitePull() throws InterruptedException {

private void testBaseExcOnlyBasePush() throws InterruptedException {
initAndProduceMessage(false, CONSUMER_TYPE_PUSH);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getPushBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -376,7 +376,7 @@ public void testBaseBaseGrayConsumeMessage() throws InterruptedException {

private void testBaseBaseGrayPull() throws InterruptedException {
initAndProduceMessage(true, CONSUMER_TYPE_PULL);
Thread.sleep(50000);
Thread.sleep(150000);
String baseResult = getPullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -389,7 +389,7 @@ private void testBaseBaseGrayPull() throws InterruptedException {

private void testBaseBaseGrayLitePull() throws InterruptedException {
initAndProduceMessage(true, CONSUMER_TYPE_LITE_PULL);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getLitePullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -402,7 +402,7 @@ private void testBaseBaseGrayLitePull() throws InterruptedException {

private void testBaseBaseGrayPush() throws InterruptedException {
initAndProduceMessage(true, CONSUMER_TYPE_PUSH);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getPushBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -426,7 +426,7 @@ public void testBaseExcBaseGrayConsumeMessage() throws InterruptedException {

private void testBaseExcBaseGrayPull() throws InterruptedException {
initAndProduceMessage(true, CONSUMER_TYPE_PULL);
Thread.sleep(50000);
Thread.sleep(150000);
String baseResult = getPullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -439,7 +439,7 @@ private void testBaseExcBaseGrayPull() throws InterruptedException {

private void testBaseExcBaseGrayLitePull() throws InterruptedException {
initAndProduceMessage(true, CONSUMER_TYPE_LITE_PULL);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getLitePullBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand All @@ -452,7 +452,7 @@ private void testBaseExcBaseGrayLitePull() throws InterruptedException {

private void testBaseExcBaseGrayPush() throws InterruptedException {
initAndProduceMessage(true, CONSUMER_TYPE_PUSH);
Thread.sleep(180000);
Thread.sleep(200000);
String baseResult = getPushBaseResult();
int baseBaseCount = parseBaseMessageCount(baseResult);
int baseGrayCount = parseGrayMessageCount(baseResult);
Expand Down Expand Up @@ -532,6 +532,8 @@ private void clearCacheCount(boolean isGrayInstanceInit) {
}

private void createGrayscaleConfig(String consumeMode, String excludeTag) {
String testModel = System.getProperty("grayscale.rocketmq.integration.test.type");
kieClient.updateServiceNameLabels(testModel);
String CONTENT = "enabled: true\n"
+ "grayscale:\n"
+ " - consumerGroupTag: gray\n"
Expand Down
Loading

0 comments on commit bd35f60

Please sign in to comment.