Skip to content

Commit 5a2552a

Browse files
committed
build/ci: fix test coverage FELL
Executing JUnit 4 and JUnit 5/kotest tests in a same build
1 parent 9e2c9bd commit 5a2552a

File tree

3 files changed

+81
-26
lines changed

3 files changed

+81
-26
lines changed

library/pom.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,22 @@
102102
<artifactId>kotest-property-jvm</artifactId>
103103
<scope>test</scope>
104104
</dependency>
105+
<!--
106+
Executing JUnit 4 and JUnit 5 tests in a same build
107+
https://stackoverflow.com/a/47158584/922688
108+
-->
109+
<!--JUnit Jupiter Engine to depend on the JUnit5 engine and JUnit 5 API -->
110+
<dependency>
111+
<groupId>org.junit.jupiter</groupId>
112+
<artifactId>junit-jupiter-engine</artifactId>
113+
<scope>test</scope>
114+
</dependency>
115+
<!--JUnit Jupiter Engine to depend on the JUnit4 engine and JUnit 4 API -->
116+
<dependency>
117+
<groupId>org.junit.vintage</groupId>
118+
<artifactId>junit-vintage-engine</artifactId>
119+
<scope>test</scope>
120+
</dependency>
105121
</dependencies>
106122

107123
<dependencyManagement>
@@ -129,7 +145,9 @@
129145
<version>2.11.0</version>
130146
</dependency>
131147

132-
<!-- QA libs -->
148+
<!--
149+
QA libs
150+
-->
133151
<!--
134152
JSR305 is already Dormant status, so SpotBugs does not release jsr305 jar file.
135153
Please continue using findbugs’ one.

pom.xml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,8 @@
6060

6161
<build>
6262
<plugins>
63-
<plugin>
64-
<artifactId>maven-clean-plugin</artifactId>
65-
<version>3.1.0</version>
66-
</plugin>
67-
<plugin>
68-
<artifactId>maven-source-plugin</artifactId>
69-
<version>3.2.1</version>
70-
</plugin>
71-
<plugin>
72-
<artifactId>maven-javadoc-plugin</artifactId>
73-
<version>3.3.1</version>
74-
</plugin>
75-
<plugin>
76-
<artifactId>maven-site-plugin</artifactId>
77-
<version>3.10.0</version>
78-
</plugin>
79-
<plugin>
80-
<artifactId>maven-install-plugin</artifactId>
81-
<version>2.5.2</version>
82-
</plugin>
8363
<plugin>
8464
<artifactId>maven-deploy-plugin</artifactId>
85-
<version>2.8.2</version>
8665
<configuration>
8766
<skip>true</skip>
8867
</configuration>
@@ -128,6 +107,38 @@
128107
</configuration>
129108
</plugin>
130109
</plugins>
110+
<pluginManagement>
111+
<plugins>
112+
<plugin>
113+
<artifactId>maven-clean-plugin</artifactId>
114+
<version>3.1.0</version>
115+
</plugin>
116+
<plugin>
117+
<artifactId>maven-source-plugin</artifactId>
118+
<version>3.2.1</version>
119+
</plugin>
120+
<plugin>
121+
<artifactId>maven-javadoc-plugin</artifactId>
122+
<version>3.3.1</version>
123+
</plugin>
124+
<plugin>
125+
<artifactId>maven-surefire-plugin</artifactId>
126+
<version>2.22.2</version>
127+
</plugin>
128+
<plugin>
129+
<artifactId>maven-site-plugin</artifactId>
130+
<version>3.10.0</version>
131+
</plugin>
132+
<plugin>
133+
<artifactId>maven-install-plugin</artifactId>
134+
<version>2.5.2</version>
135+
</plugin>
136+
<plugin>
137+
<artifactId>maven-deploy-plugin</artifactId>
138+
<version>2.8.2</version>
139+
</plugin>
140+
</plugins>
141+
</pluginManagement>
131142
</build>
132143

133144
<profiles>

tool/pom.xml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@
9595
<artifactId>commons-lang3</artifactId>
9696
<scope>test</scope>
9797
</dependency>
98+
<dependency>
99+
<groupId>io.kotest</groupId>
100+
<artifactId>kotest-runner-junit4-jvm</artifactId>
101+
<scope>test</scope>
102+
</dependency>
98103
<dependency>
99104
<groupId>io.kotest</groupId>
100105
<artifactId>kotest-runner-junit5-jvm</artifactId>
@@ -110,6 +115,22 @@
110115
<artifactId>kotest-property-jvm</artifactId>
111116
<scope>test</scope>
112117
</dependency>
118+
<!--
119+
Executing JUnit 4 and JUnit 5 tests in a same build
120+
https://stackoverflow.com/a/47158584/922688
121+
-->
122+
<!--JUnit Jupiter Engine to depend on the JUnit5 engine and JUnit 5 API -->
123+
<dependency>
124+
<groupId>org.junit.jupiter</groupId>
125+
<artifactId>junit-jupiter-engine</artifactId>
126+
<scope>test</scope>
127+
</dependency>
128+
<!--JUnit Jupiter Engine to depend on the JUnit4 engine and JUnit 4 API -->
129+
<dependency>
130+
<groupId>org.junit.vintage</groupId>
131+
<artifactId>junit-vintage-engine</artifactId>
132+
<scope>test</scope>
133+
</dependency>
113134
</dependencies>
114135

115136
<dependencyManagement>
@@ -147,7 +168,9 @@
147168
<version>3.12.0</version>
148169
</dependency>
149170

150-
<!-- QA libs -->
171+
<!--
172+
QA libs
173+
-->
151174
<!--
152175
JSR305 is already Dormant status, so SpotBugs does not release jsr305 jar file.
153176
Please continue using findbugs’ one.
@@ -170,6 +193,12 @@
170193
testing libs
171194
-->
172195
<!-- https://github.com/kotlintest/kotlintest -->
196+
<dependency>
197+
<groupId>io.kotest</groupId>
198+
<artifactId>kotest-runner-junit4-jvm</artifactId>
199+
<version>${kotest.version}</version>
200+
<scope>test</scope>
201+
</dependency>
173202
<dependency>
174203
<groupId>io.kotest</groupId>
175204
<artifactId>kotest-runner-junit5-jvm</artifactId>
@@ -290,9 +319,6 @@
290319
</execution>
291320
</executions>
292321
</plugin>
293-
<plugin>
294-
<artifactId>maven-surefire-plugin</artifactId>
295-
</plugin>
296322
<plugin>
297323
<groupId>org.sonatype.plugins</groupId>
298324
<artifactId>nexus-staging-maven-plugin</artifactId>

0 commit comments

Comments
 (0)