This is an automated email from the ASF dual-hosted git repository.

jianbin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new d30041551d test: Enable Nacos integration tests when nacosCaseEnabled 
is true (#7610)
d30041551d is described below

commit d30041551d67f072d5900909cb6aac8f47c9a7bf
Author: xiaosheng <[email protected]>
AuthorDate: Wed Sep 3 09:48:22 2025 +0800

    test: Enable Nacos integration tests when nacosCaseEnabled is true (#7610)
---
 .github/workflows/build.yml                                    |  2 +-
 changes/en-us/2.x.md                                           |  1 +
 changes/zh-cn/2.x.md                                           |  2 ++
 .../java/io/seata/config/extend/TestConfigFromExtendSPI.java   |  5 ++---
 .../test/java/org/apache/seata/config/nacos/NacosMockTest.java | 10 ++--------
 5 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 675528b4e3..184d8b4a9c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -81,7 +81,7 @@ jobs:
         if: matrix.java == '8'
         run: |
           ./mvnw -T 4C clean test \
-                 -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true 
\
+                 -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true 
-DnacosCaseEnabled=true \
                  -e -B \
                  
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
 \
                  -Dorg.slf4j.simpleLogger.log.net.sourceforge.pmd=error;
diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 5513c87fd5..c1b6719f1a 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -61,6 +61,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7540](https://github.com/seata/seata/pull/7540)] fix port of mock server
 - [[#7580](https://github.com/seata/seata/pull/7580)]  fix the exception 
caused by the disorder of test case execution order
 - [[#7584](https://github.com/apache/incubator-seata/pull/7584)] deflake 
ConsulConfigurationTest#testInitSeataConfig with short await/retry to absorb CI 
timing delay
+- [[#7610](https://github.com/apache/incubator-seata/pull/7610)] Enable Nacos 
integration tests when nacosCaseEnabled is true
 
 ### refactor:
 
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 12f55eec46..49db4360c8 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -60,6 +60,8 @@
 - [[#7578](https://github.com/seata/seata/pull/7578)]  
zstd解压由jni改为ZstdInputStream
 - [[#7580](https://github.com/seata/seata/pull/7580)]  修复测试用例顺序错乱导致的异常
 - [[#7584](https://github.com/seata/seata/pull/7584)] 修复 
ConsulConfigurationTest#testInitSeataConfig 在 CI 中由于等待/重试时间过短导致的不稳定问题
+- [[#7610](https://github.com/apache/incubator-seata/pull/7610)] 
当nacosCaseEnabled为true时启用nacos集成测试
+
 
 ### refactor:
 
diff --git 
a/config/seata-config-nacos/src/test/java/io/seata/config/extend/TestConfigFromExtendSPI.java
 
b/config/seata-config-nacos/src/test/java/io/seata/config/extend/TestConfigFromExtendSPI.java
index 9090d567bb..692963e7d1 100644
--- 
a/config/seata-config-nacos/src/test/java/io/seata/config/extend/TestConfigFromExtendSPI.java
+++ 
b/config/seata-config-nacos/src/test/java/io/seata/config/extend/TestConfigFromExtendSPI.java
@@ -31,14 +31,14 @@ import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledOnOs;
-import org.junit.jupiter.api.condition.OS;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 
 import java.security.SecureRandom;
 import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+@EnabledIfSystemProperty(named = "nacosCaseEnabled", matches = "true")
 public class TestConfigFromExtendSPI {
 
     private static Config FILE_CONFIG;
@@ -60,7 +60,6 @@ public class TestConfigFromExtendSPI {
     }
 
     @Test
-    @EnabledOnOs(OS.LINUX)
     public void testGetConfigProperties() throws Exception {
         Assertions.assertNotNull(configService);
         Configuration configuration = ConfigurationFactory.getInstance();
diff --git 
a/config/seata-config-nacos/src/test/java/org/apache/seata/config/nacos/NacosMockTest.java
 
b/config/seata-config-nacos/src/test/java/org/apache/seata/config/nacos/NacosMockTest.java
index 448ddc8b02..b1f6e2b9d1 100644
--- 
a/config/seata-config-nacos/src/test/java/org/apache/seata/config/nacos/NacosMockTest.java
+++ 
b/config/seata-config-nacos/src/test/java/org/apache/seata/config/nacos/NacosMockTest.java
@@ -32,8 +32,7 @@ import org.junit.jupiter.api.MethodOrderer;
 import org.junit.jupiter.api.Order;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestMethodOrder;
-import org.junit.jupiter.api.condition.EnabledOnOs;
-import org.junit.jupiter.api.condition.OS;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 
 import java.lang.reflect.UndeclaredThrowableException;
 import java.time.Duration;
@@ -42,6 +41,7 @@ import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+@EnabledIfSystemProperty(named = "nacosCaseEnabled", matches = "true")
 @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
 public class NacosMockTest {
     private static ConfigService configService;
@@ -69,7 +69,6 @@ public class NacosMockTest {
     }
 
     @Test
-    @EnabledOnOs(OS.LINUX)
     @Order(1)
     public void getInstance() {
         Assertions.assertNotNull(configService);
@@ -78,7 +77,6 @@ public class NacosMockTest {
     }
 
     @Test
-    @EnabledOnOs(OS.LINUX)
     @Order(2)
     public void getConfig() {
         Configuration configuration = ConfigurationFactory.getInstance();
@@ -143,7 +141,6 @@ public class NacosMockTest {
     }
 
     @Test
-    @EnabledOnOs(OS.LINUX)
     @Order(3)
     public void putConfigIfAbsent() {
         Configuration configuration = ConfigurationFactory.getInstance();
@@ -153,7 +150,6 @@ public class NacosMockTest {
     }
 
     @Test
-    @EnabledOnOs(OS.LINUX)
     @Order(4)
     public void removeConfig() {
         Configuration configuration = ConfigurationFactory.getInstance();
@@ -162,7 +158,6 @@ public class NacosMockTest {
     }
 
     @Test
-    @EnabledOnOs(OS.LINUX)
     @Order(5)
     public void putConfig() {
         Configuration configuration = ConfigurationFactory.getInstance();
@@ -173,7 +168,6 @@ public class NacosMockTest {
     }
 
     @Test
-    @EnabledOnOs(OS.LINUX)
     @Order(6)
     public void testConfigListener() throws NacosException, 
InterruptedException {
         Configuration configuration = ConfigurationFactory.getInstance();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to