You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by ji...@apache.org on 2024/09/19 05:36:51 UTC

(incubator-seata) branch 2.2.0 updated: optimize: windows and macos do not start container (#6866)

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

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


The following commit(s) were added to refs/heads/2.2.0 by this push:
     new cc08148d61 optimize: windows and macos do not start container (#6866)
cc08148d61 is described below

commit cc08148d61a4a09ece33e45343753017857e6798
Author: funkye <ji...@apache.org>
AuthorDate: Thu Sep 19 13:36:48 2024 +0800

    optimize: windows and macos do not start container (#6866)
---
 .github/workflows/{test.yml => test-ubuntu.yml}    | 54 ++++++++-----------
 .github/workflows/test.yml                         | 62 ++--------------------
 .../config/extend/TestConfigFromExtendSPI.java     |  3 ++
 .../apache/seata/config/nacos/NacosMockTest.java   |  9 ++++
 console/pom.xml                                    |  1 -
 5 files changed, 37 insertions(+), 92 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test-ubuntu.yml
similarity index 69%
copy from .github/workflows/test.yml
copy to .github/workflows/test-ubuntu.yml
index d3f618596b..8b4abcc82a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test-ubuntu.yml
@@ -1,14 +1,15 @@
-name: "test"
+name: "test-ubuntu"
 
 on:
   push:
     branches: [ test*, "*.*.*" ]
+  pull_request:
+    branches: [ test*, "*.*.*" ]
 jobs:
   # job 1
   test:
     name: "test"
     services:
-      if: matrix.os != 'windows'
       redis:
         image: redis:7.2
         ports:
@@ -24,13 +25,12 @@ jobs:
         options: --health-cmd="curl -f http://localhost:8848/nacos" --health-interval=10s --health-timeout=5s --health-retries=3 --health-start-period=30s
     runs-on: "${{ matrix.os }}-latest"
     strategy:
+      max-parallel: 3
       fail-fast: false
       matrix:
         java: [ 8, 11, 17, 21 ]
         os: [
           ubuntu,
-          macos,
-          windows, # Skip tests, because too many errors in unit-test.
         ]
         springboot: [
           2.7.18         -D spring-framework.version=5.3.31,
@@ -60,37 +60,34 @@ jobs:
       # step 4
       ## step 4.1: for Ubuntu and MacOS
       - name: "Test with Maven on '${{ matrix.os }}' OS"
-        if: matrix.os != 'windows'
         run: |
-          if [ "${{ matrix.os }}" == "macos" ]; then
-             python3 -m ensurepip --upgrade;
-             python3 -m pip install --upgrade pip setuptools;
-             if ! python3 -c "import distutils" &>/dev/null; then
-                python3 -m pip install --upgrade setuptools
-             fi
-            ./mvnw -T 4C clean test -P args-for-client-test  -P arrch64 -Dspring-boot.version=${{ matrix.springboot }} -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
-          else
-            ./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
-          fi
-      ## step 4.2: for Windows
-      - name: "Build with Maven on 'windows' OS (Skip tests)"
-        if: matrix.os == 'windows'
-        run: | # Skip tests, because too many errors in unit-test.
-          ./mvnw.cmd -version;
-          ./mvnw.cmd clean install -P args-for-client-test -DskipTests -D spring-boot.version=${{ matrix.springboot }} -e -B -D org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
+          ./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
 
   # job 2
   test-springboot3x:
     name: "test-springboot3.x"
+    services:
+      redis:
+        image: redis:7.2
+        ports:
+          - 6379:6379
+        options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
+      nacos:
+        image: nacos/nacos-server:v2.4.2
+        ports:
+          - 8848:8848
+        env:
+          MODE: standalone
+          SPRING_SECURITY_ENABLED: false
+        options: --health-cmd="curl -f http://localhost:8848/nacos" --health-interval=10s --health-timeout=5s --health-retries=3 --health-start-period=30s
     runs-on: "${{ matrix.os }}-latest"
     strategy:
+      max-parallel: 3
       fail-fast: false
       matrix:
         java: [ 17, 21 ]
         os: [
           ubuntu,
-          macos,
-          windows, # Skip tests, because too many errors in unit-test.
         ]
         springboot: [
           3.2.0  -D spring-framework.version=6.1.1,
@@ -117,16 +114,7 @@ jobs:
       - name: "Test with Maven on '${{ matrix.os }}' OS"
         if: matrix.os != 'windows'
         run: |
-          if [ "${{ matrix.os }}" == "macos" ]; then
-             python3 -m ensurepip --upgrade;
-             python3 -m pip install --upgrade pip setuptools;
-             if ! python3 -c "import distutils" &>/dev/null; then
-                python3 -m pip install --upgrade setuptools
-             fi
-            ./mvnw -T 4C clean test -P args-for-client-test  -P arrch64 -Dspring-boot.version=${{ matrix.springboot }} -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
-          else
-            ./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
-          fi
+          ./mvnw -T 4C clean test -P args-for-client-test -Dspring-boot.version=${{ matrix.springboot }} -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
       ## step 4.2: for Windows
       - name: "Build with Maven on 'windows' OS (Skip tests)"
         if: matrix.os == 'windows'
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index d3f618596b..2c775a1a84 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -3,32 +3,19 @@ name: "test"
 on:
   push:
     branches: [ test*, "*.*.*" ]
+  pull_request:
+    branches: [ test*, "*.*.*" ]
 jobs:
   # job 1
   test:
     name: "test"
-    services:
-      if: matrix.os != 'windows'
-      redis:
-        image: redis:7.2
-        ports:
-          - 6379:6379
-        options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
-      nacos:
-        image: nacos/nacos-server:v2.4.2
-        ports:
-          - 8848:8848
-        env:
-          MODE: standalone
-          SPRING_SECURITY_ENABLED: false
-        options: --health-cmd="curl -f http://localhost:8848/nacos" --health-interval=10s --health-timeout=5s --health-retries=3 --health-start-period=30s
     runs-on: "${{ matrix.os }}-latest"
     strategy:
+      max-parallel: 3
       fail-fast: false
       matrix:
         java: [ 8, 11, 17, 21 ]
         os: [
-          ubuntu,
           macos,
           windows, # Skip tests, because too many errors in unit-test.
         ]
@@ -84,11 +71,11 @@ jobs:
     name: "test-springboot3.x"
     runs-on: "${{ matrix.os }}-latest"
     strategy:
+      max-parallel: 3
       fail-fast: false
       matrix:
         java: [ 17, 21 ]
         os: [
-          ubuntu,
           macos,
           windows, # Skip tests, because too many errors in unit-test.
         ]
@@ -133,44 +120,3 @@ jobs:
         run: | # Skip tests, because too many errors in unit-test.
           ./mvnw.cmd -version;
           ./mvnw.cmd clean install -P args-for-client-test -DskipTests -D spring-boot.version=${{ matrix.springboot }} -e -B -D org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
-
-  # job 3
-  test-arm64:
-    name: "test-arm64"
-    runs-on: ubuntu-latest
-    strategy:
-      fail-fast: false
-      matrix:
-        springboot: [
-          #2.7.18         -Dspring-framework.version=5.3.31, # The maven-compiler-plugin will throw an error for an unknown reason.
-          #2.6.15         -Dspring-framework.version=5.3.27, # The maven-compiler-plugin will throw an error for an unknown reason.
-          #2.5.15         -Dspring-framework.version=5.3.27, # The maven-compiler-plugin will throw an error for an unknown reason.
-          2.4.13         -Dspring-framework.version=5.3.13,
-          2.3.12.RELEASE -Dspring-framework.version=5.2.15.RELEASE,
-          2.2.13.RELEASE -Dspring-framework.version=5.2.12.RELEASE,
-          #2.1.18.RELEASE,
-          #2.0.9.RELEASE,
-        ]
-    steps:
-      # step 1
-      - name: "Checkout"
-        uses: actions/checkout@v3
-      # step 2
-      - name: "Set up QEMU"
-        id: qemu
-        uses: docker/setup-qemu-action@v3
-      # step 3
-      - name: "Build with Maven on 'arm64v8/ubuntu:20.04' OS (Skip tests)"
-        run: |
-          docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
-            arm64v8/ubuntu:20.04 \
-            bash -exc 'apt-get update -y && \
-                       apt-get install maven -y && \
-                       apt-get install -y python3 python3-pip python3-distutils && \
-                       apt-get install -y build-essential && \
-                       mvn -version && \
-                       mvn -T 4C clean install \
-                           -Dspring-boot.version=${{ matrix.springboot }} \
-                           -Prelease-seata \
-                           -DskipTests \
-                           -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
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 80bde36481..55e7644186 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
@@ -37,6 +37,8 @@ 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;
 
 public class TestConfigFromExtendSPI {
 
@@ -59,6 +61,7 @@ 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 5c3a9d5402..f246ba33ea 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
@@ -37,6 +37,9 @@ import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledOnJre;
+import org.junit.jupiter.api.condition.EnabledOnOs;
+import org.junit.jupiter.api.condition.OS;
 
 public class NacosMockTest {
     private static ConfigService configService;
@@ -64,6 +67,7 @@ public class NacosMockTest {
     }
 
     @Test
+    @EnabledOnOs(OS.LINUX)
     public void getInstance() {
         Assertions.assertNotNull(configService);
         Assertions.assertNotNull(NacosConfiguration.getInstance());
@@ -71,6 +75,7 @@ public class NacosMockTest {
     }
 
     @Test
+    @EnabledOnOs(OS.LINUX)
     public void getConfig() {
         Configuration configuration = ConfigurationFactory.getInstance();
         String configStrValue = configuration.getConfig(SUB_NACOS_DATAID);
@@ -135,6 +140,7 @@ public class NacosMockTest {
     }
 
     @Test
+    @EnabledOnOs(OS.LINUX)
     public void putConfigIfAbsent() {
         Configuration configuration = ConfigurationFactory.getInstance();
         Assertions.assertThrows(UndeclaredThrowableException.class, () -> {
@@ -143,6 +149,7 @@ public class NacosMockTest {
     }
 
     @Test
+    @EnabledOnOs(OS.LINUX)
     public void removeConfig() {
         Configuration configuration = ConfigurationFactory.getInstance();
         boolean removed = configuration.removeConfig(NACOS_DATAID);
@@ -150,6 +157,7 @@ public class NacosMockTest {
     }
 
     @Test
+    @EnabledOnOs(OS.LINUX)
     public void putConfig() {
         Configuration configuration = ConfigurationFactory.getInstance();
         boolean added = configuration.putConfig(SUB_NACOS_DATAID, "TEST");
@@ -159,6 +167,7 @@ public class NacosMockTest {
     }
 
     @Test
+    @EnabledOnOs(OS.LINUX)
     public void testConfigListener() throws NacosException, InterruptedException {
         Configuration configuration = ConfigurationFactory.getInstance();
         configuration.putConfig(NACOS_DATAID, "KEY=TEST");
diff --git a/console/pom.xml b/console/pom.xml
index 23610df3a0..16fba6a55e 100644
--- a/console/pom.xml
+++ b/console/pom.xml
@@ -194,7 +194,6 @@
                         <phase>generate-resources</phase>
                         <configuration>
                             <arguments>install</arguments>
-                            <npmRegistryURL>https://registry.npmmirror.com/</npmRegistryURL>
                         </configuration>
                     </execution>
                     <execution>


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org