Skip to content

Commit cc08148

Browse files
authored
optimize: windows and macos do not start container (#6866)
1 parent 09ab4b9 commit cc08148

File tree

5 files changed

+180
-59
lines changed

5 files changed

+180
-59
lines changed

.github/workflows/test-ubuntu.yml

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: "test-ubuntu"
2+
3+
on:
4+
push:
5+
branches: [ test*, "*.*.*" ]
6+
pull_request:
7+
branches: [ test*, "*.*.*" ]
8+
jobs:
9+
# job 1
10+
test:
11+
name: "test"
12+
services:
13+
redis:
14+
image: redis:7.2
15+
ports:
16+
- 6379:6379
17+
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
18+
nacos:
19+
image: nacos/nacos-server:v2.4.2
20+
ports:
21+
- 8848:8848
22+
env:
23+
MODE: standalone
24+
SPRING_SECURITY_ENABLED: false
25+
options: --health-cmd="curl -f http://localhost:8848/nacos" --health-interval=10s --health-timeout=5s --health-retries=3 --health-start-period=30s
26+
runs-on: "${{ matrix.os }}-latest"
27+
strategy:
28+
max-parallel: 3
29+
fail-fast: false
30+
matrix:
31+
java: [ 8, 11, 17, 21 ]
32+
os: [
33+
ubuntu,
34+
]
35+
springboot: [
36+
2.7.18 -D spring-framework.version=5.3.31,
37+
2.6.15 -D spring-framework.version=5.3.27,
38+
2.5.15 -D spring-framework.version=5.3.27,
39+
2.4.13 -D spring-framework.version=5.3.13,
40+
2.3.12.RELEASE -D spring-framework.version=5.2.15.RELEASE,
41+
2.2.13.RELEASE -D spring-framework.version=5.2.12.RELEASE,
42+
#2.1.18.RELEASE,
43+
#2.0.9.RELEASE,
44+
]
45+
steps:
46+
# step 1
47+
- name: "Checkout"
48+
uses: actions/checkout@v3
49+
# step 2
50+
- name: "Use Python 3.x"
51+
uses: actions/setup-python@v2
52+
with:
53+
python-version: '3.12'
54+
# step 3
55+
- name: "Set up Java JDK"
56+
uses: actions/[email protected]
57+
with:
58+
distribution: 'zulu'
59+
java-version: ${{ matrix.java }}
60+
# step 4
61+
## step 4.1: for Ubuntu and MacOS
62+
- name: "Test with Maven on '${{ matrix.os }}' OS"
63+
run: |
64+
./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;
65+
66+
# job 2
67+
test-springboot3x:
68+
name: "test-springboot3.x"
69+
services:
70+
redis:
71+
image: redis:7.2
72+
ports:
73+
- 6379:6379
74+
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
75+
nacos:
76+
image: nacos/nacos-server:v2.4.2
77+
ports:
78+
- 8848:8848
79+
env:
80+
MODE: standalone
81+
SPRING_SECURITY_ENABLED: false
82+
options: --health-cmd="curl -f http://localhost:8848/nacos" --health-interval=10s --health-timeout=5s --health-retries=3 --health-start-period=30s
83+
runs-on: "${{ matrix.os }}-latest"
84+
strategy:
85+
max-parallel: 3
86+
fail-fast: false
87+
matrix:
88+
java: [ 17, 21 ]
89+
os: [
90+
ubuntu,
91+
]
92+
springboot: [
93+
3.2.0 -D spring-framework.version=6.1.1,
94+
3.1.6 -D spring-framework.version=6.0.14,
95+
3.0.13 -D spring-framework.version=6.0.14,
96+
]
97+
steps:
98+
# step 1
99+
- name: "Checkout"
100+
uses: actions/checkout@v3
101+
# step 2
102+
- name: "Use Python 3.x"
103+
uses: actions/setup-python@v2
104+
with:
105+
python-version: '3.12'
106+
# step 3
107+
- name: "Set up Java JDK"
108+
uses: actions/[email protected]
109+
with:
110+
distribution: 'zulu'
111+
java-version: ${{ matrix.java }}
112+
# step 4
113+
## step 4.1: for Ubuntu and MacOS
114+
- name: "Test with Maven on '${{ matrix.os }}' OS"
115+
if: matrix.os != 'windows'
116+
run: |
117+
./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;
118+
## step 4.2: for Windows
119+
- name: "Build with Maven on 'windows' OS (Skip tests)"
120+
if: matrix.os == 'windows'
121+
run: | # Skip tests, because too many errors in unit-test.
122+
./mvnw.cmd -version;
123+
./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;
124+
125+
# job 3
126+
test-arm64:
127+
name: "test-arm64"
128+
runs-on: ubuntu-latest
129+
strategy:
130+
fail-fast: false
131+
matrix:
132+
springboot: [
133+
#2.7.18 -Dspring-framework.version=5.3.31, # The maven-compiler-plugin will throw an error for an unknown reason.
134+
#2.6.15 -Dspring-framework.version=5.3.27, # The maven-compiler-plugin will throw an error for an unknown reason.
135+
#2.5.15 -Dspring-framework.version=5.3.27, # The maven-compiler-plugin will throw an error for an unknown reason.
136+
2.4.13 -Dspring-framework.version=5.3.13,
137+
2.3.12.RELEASE -Dspring-framework.version=5.2.15.RELEASE,
138+
2.2.13.RELEASE -Dspring-framework.version=5.2.12.RELEASE,
139+
#2.1.18.RELEASE,
140+
#2.0.9.RELEASE,
141+
]
142+
steps:
143+
# step 1
144+
- name: "Checkout"
145+
uses: actions/checkout@v3
146+
# step 2
147+
- name: "Set up QEMU"
148+
id: qemu
149+
uses: docker/setup-qemu-action@v3
150+
# step 3
151+
- name: "Build with Maven on 'arm64v8/ubuntu:20.04' OS (Skip tests)"
152+
run: |
153+
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
154+
arm64v8/ubuntu:20.04 \
155+
bash -exc 'apt-get update -y && \
156+
apt-get install maven -y && \
157+
apt-get install -y python3 python3-pip python3-distutils && \
158+
apt-get install -y build-essential && \
159+
mvn -version && \
160+
mvn -T 4C clean install \
161+
-Dspring-boot.version=${{ matrix.springboot }} \
162+
-Prelease-seata \
163+
-DskipTests \
164+
-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'

.github/workflows/test.yml

+4-58
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,19 @@ name: "test"
33
on:
44
push:
55
branches: [ test*, "*.*.*" ]
6+
pull_request:
7+
branches: [ test*, "*.*.*" ]
68
jobs:
79
# job 1
810
test:
911
name: "test"
10-
services:
11-
if: matrix.os != 'windows'
12-
redis:
13-
image: redis:7.2
14-
ports:
15-
- 6379:6379
16-
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
17-
nacos:
18-
image: nacos/nacos-server:v2.4.2
19-
ports:
20-
- 8848:8848
21-
env:
22-
MODE: standalone
23-
SPRING_SECURITY_ENABLED: false
24-
options: --health-cmd="curl -f http://localhost:8848/nacos" --health-interval=10s --health-timeout=5s --health-retries=3 --health-start-period=30s
2512
runs-on: "${{ matrix.os }}-latest"
2613
strategy:
14+
max-parallel: 3
2715
fail-fast: false
2816
matrix:
2917
java: [ 8, 11, 17, 21 ]
3018
os: [
31-
ubuntu,
3219
macos,
3320
windows, # Skip tests, because too many errors in unit-test.
3421
]
@@ -84,11 +71,11 @@ jobs:
8471
name: "test-springboot3.x"
8572
runs-on: "${{ matrix.os }}-latest"
8673
strategy:
74+
max-parallel: 3
8775
fail-fast: false
8876
matrix:
8977
java: [ 17, 21 ]
9078
os: [
91-
ubuntu,
9279
macos,
9380
windows, # Skip tests, because too many errors in unit-test.
9481
]
@@ -133,44 +120,3 @@ jobs:
133120
run: | # Skip tests, because too many errors in unit-test.
134121
./mvnw.cmd -version;
135122
./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;
136-
137-
# job 3
138-
test-arm64:
139-
name: "test-arm64"
140-
runs-on: ubuntu-latest
141-
strategy:
142-
fail-fast: false
143-
matrix:
144-
springboot: [
145-
#2.7.18 -Dspring-framework.version=5.3.31, # The maven-compiler-plugin will throw an error for an unknown reason.
146-
#2.6.15 -Dspring-framework.version=5.3.27, # The maven-compiler-plugin will throw an error for an unknown reason.
147-
#2.5.15 -Dspring-framework.version=5.3.27, # The maven-compiler-plugin will throw an error for an unknown reason.
148-
2.4.13 -Dspring-framework.version=5.3.13,
149-
2.3.12.RELEASE -Dspring-framework.version=5.2.15.RELEASE,
150-
2.2.13.RELEASE -Dspring-framework.version=5.2.12.RELEASE,
151-
#2.1.18.RELEASE,
152-
#2.0.9.RELEASE,
153-
]
154-
steps:
155-
# step 1
156-
- name: "Checkout"
157-
uses: actions/checkout@v3
158-
# step 2
159-
- name: "Set up QEMU"
160-
id: qemu
161-
uses: docker/setup-qemu-action@v3
162-
# step 3
163-
- name: "Build with Maven on 'arm64v8/ubuntu:20.04' OS (Skip tests)"
164-
run: |
165-
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
166-
arm64v8/ubuntu:20.04 \
167-
bash -exc 'apt-get update -y && \
168-
apt-get install maven -y && \
169-
apt-get install -y python3 python3-pip python3-distutils && \
170-
apt-get install -y build-essential && \
171-
mvn -version && \
172-
mvn -T 4C clean install \
173-
-Dspring-boot.version=${{ matrix.springboot }} \
174-
-Prelease-seata \
175-
-DskipTests \
176-
-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'

config/seata-config-nacos/src/test/java/io/seata/config/extend/TestConfigFromExtendSPI.java

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
import org.junit.jupiter.api.Assertions;
3838
import org.junit.jupiter.api.BeforeAll;
3939
import org.junit.jupiter.api.Test;
40+
import org.junit.jupiter.api.condition.EnabledOnOs;
41+
import org.junit.jupiter.api.condition.OS;
4042

4143
public class TestConfigFromExtendSPI {
4244

@@ -59,6 +61,7 @@ public static void setup() throws NacosException {
5961
}
6062

6163
@Test
64+
@EnabledOnOs(OS.LINUX)
6265
public void testGetConfigProperties() throws Exception {
6366
Assertions.assertNotNull(configService);
6467
Configuration configuration = ConfigurationFactory.getInstance();

config/seata-config-nacos/src/test/java/org/apache/seata/config/nacos/NacosMockTest.java

+9
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
import org.junit.jupiter.api.Assertions;
3838
import org.junit.jupiter.api.BeforeAll;
3939
import org.junit.jupiter.api.Test;
40+
import org.junit.jupiter.api.condition.EnabledOnJre;
41+
import org.junit.jupiter.api.condition.EnabledOnOs;
42+
import org.junit.jupiter.api.condition.OS;
4043

4144
public class NacosMockTest {
4245
private static ConfigService configService;
@@ -64,13 +67,15 @@ public static void setup() throws NacosException {
6467
}
6568

6669
@Test
70+
@EnabledOnOs(OS.LINUX)
6771
public void getInstance() {
6872
Assertions.assertNotNull(configService);
6973
Assertions.assertNotNull(NacosConfiguration.getInstance());
7074
Assertions.assertNotNull(ConfigurationFactory.getInstance());
7175
}
7276

7377
@Test
78+
@EnabledOnOs(OS.LINUX)
7479
public void getConfig() {
7580
Configuration configuration = ConfigurationFactory.getInstance();
7681
String configStrValue = configuration.getConfig(SUB_NACOS_DATAID);
@@ -135,6 +140,7 @@ public void getConfig() {
135140
}
136141

137142
@Test
143+
@EnabledOnOs(OS.LINUX)
138144
public void putConfigIfAbsent() {
139145
Configuration configuration = ConfigurationFactory.getInstance();
140146
Assertions.assertThrows(UndeclaredThrowableException.class, () -> {
@@ -143,13 +149,15 @@ public void putConfigIfAbsent() {
143149
}
144150

145151
@Test
152+
@EnabledOnOs(OS.LINUX)
146153
public void removeConfig() {
147154
Configuration configuration = ConfigurationFactory.getInstance();
148155
boolean removed = configuration.removeConfig(NACOS_DATAID);
149156
Assertions.assertTrue(removed);
150157
}
151158

152159
@Test
160+
@EnabledOnOs(OS.LINUX)
153161
public void putConfig() {
154162
Configuration configuration = ConfigurationFactory.getInstance();
155163
boolean added = configuration.putConfig(SUB_NACOS_DATAID, "TEST");
@@ -159,6 +167,7 @@ public void putConfig() {
159167
}
160168

161169
@Test
170+
@EnabledOnOs(OS.LINUX)
162171
public void testConfigListener() throws NacosException, InterruptedException {
163172
Configuration configuration = ConfigurationFactory.getInstance();
164173
configuration.putConfig(NACOS_DATAID, "KEY=TEST");

console/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@
194194
<phase>generate-resources</phase>
195195
<configuration>
196196
<arguments>install</arguments>
197-
<npmRegistryURL>https://registry.npmmirror.com/</npmRegistryURL>
198197
</configuration>
199198
</execution>
200199
<execution>

0 commit comments

Comments
 (0)