Skip to content

Commit 4afb86b

Browse files
author
Alexander Furer
committed
don't fork tests
1 parent e72fdef commit 4afb86b

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ subprojects {
4747
targetCompatibility = 1.8
4848

4949
test {
50-
forkEvery = 1
50+
// forkEvery = 1
5151
testLogging {
5252
exceptionFormat = 'full'
5353
}
@@ -68,10 +68,6 @@ task codeCoverageReport(type: JacocoReport) {
6868
sourceSets (project('grpc-spring-boot-starter').sourceSets.main
6969
,project('grpc-client-spring-boot-starter').sourceSets.main)
7070

71-
//subprojects.each {
72-
//sourceSets it.sourceSets.main
73-
//}
74-
7571
reports {
7672
xml.enabled true
7773
xml.destination = new File(buildDir,"reports/jacoco/report.xml")

grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/DefaultGrpcPortTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.lognet.springboot.grpc.context.LocalRunningGrpcPort;
99
import org.lognet.springboot.grpc.demo.DemoApp;
1010
import org.springframework.boot.test.context.SpringBootTest;
11+
import org.springframework.test.annotation.DirtiesContext;
1112
import org.springframework.test.context.ActiveProfiles;
1213
import org.springframework.test.context.junit4.SpringRunner;
1314

@@ -16,7 +17,8 @@
1617

1718
@RunWith(SpringRunner.class)
1819
@SpringBootTest(classes = {DemoApp.class}, webEnvironment = NONE)
19-
@ActiveProfiles("disable-security")
20+
@ActiveProfiles({"disable-security","default-port"})
21+
@DirtiesContext
2022
public class DefaultGrpcPortTest extends GrpcServerTestBase {
2123
@LocalRunningGrpcPort
2224
int runningPort;

grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/EnvVarGrpcPortTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.lognet.springboot.grpc.context.LocalRunningGrpcPort;
1010
import org.lognet.springboot.grpc.demo.DemoApp;
1111
import org.springframework.boot.test.context.SpringBootTest;
12+
import org.springframework.test.annotation.DirtiesContext;
1213
import org.springframework.test.context.ActiveProfiles;
1314
import org.springframework.test.context.junit4.SpringRunner;
1415
import org.springframework.util.SocketUtils;
@@ -17,7 +18,8 @@
1718

1819
@RunWith(SpringRunner.class)
1920
@SpringBootTest(classes = {DemoApp.class}, webEnvironment = NONE)
20-
@ActiveProfiles("disable-security")
21+
@ActiveProfiles({"disable-security","default-port"})
22+
@DirtiesContext
2123
public class EnvVarGrpcPortTest extends GrpcServerTestBase {
2224

2325

grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/NettyTransportConfigTest2.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.lognet.springboot.grpc.autoconfigure.GRpcServerProperties;
77
import org.lognet.springboot.grpc.demo.DemoApp;
88
import org.springframework.boot.test.context.SpringBootTest;
9+
import org.springframework.test.annotation.DirtiesContext;
910
import org.springframework.test.context.ActiveProfiles;
1011
import org.springframework.test.context.junit4.SpringRunner;
1112

@@ -14,6 +15,7 @@
1415
@RunWith(SpringRunner.class)
1516
@SpringBootTest(classes = {DemoApp.class}, webEnvironment = NONE)
1617
@ActiveProfiles("netty-test2")
18+
@DirtiesContext
1719
public class NettyTransportConfigTest2 extends GrpcServerTestBase {
1820

1921
@Override

grpc-spring-boot-starter-demo/src/test/resources/application.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ management:
1212
logging:
1313
level:
1414
root: INFO
15+
16+
---
17+
spring:
18+
config:
19+
activate:
20+
on-profile: "!default-port"
21+
grpc:
22+
port: 0

0 commit comments

Comments
 (0)