Skip to content

Commit 8879620

Browse files
committed
moving tests to IT for failsafe, update failsafe version, and update pipeline to skipIT when UnitTest
Signed-off-by: salaboy <[email protected]>
1 parent d0de1ac commit 8879620

File tree

6 files changed

+15
-18
lines changed

6 files changed

+15
-18
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
distribution: 'temurin'
3131
java-version: ${{ env.JDK_VER }}
3232
- name: Run tests
33-
run: ./mvnw clean install -B -q
33+
run: ./mvnw clean install -B -q -DskipITs=true
3434
- name: Codecov
3535
uses: codecov/[email protected]
3636
- name: Upload test report for sdk

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<spotbugs.fail>true</spotbugs.fail>
4343
<spotbugs.exclude.filter.file>../spotbugs-exclude.xml</spotbugs.exclude.filter.file>
4444
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED</argLine>
45-
<failsafe.version>3.2.2</failsafe.version>
45+
<failsafe.version>3.5.3</failsafe.version>
4646
<surefire.version>3.2.2</surefire.version>
4747
<junit-bom.version>5.11.4</junit-bom.version>
4848
<snakeyaml.version>2.0</snakeyaml.version>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
@SpringBootTest(classes = {TestConsumerApplication.class, DaprTestContainersConfig.class,
3838
ConsumerAppTestConfiguration.class, DaprAutoConfiguration.class},
3939
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
40-
class ConsumerAppTests {
40+
class ConsumerAppIT {
4141

4242
private static final String SUBSCRIPTION_MESSAGE_PATTERN = ".*app is subscribed to the following topics.*";
4343

spring-boot-examples/pom.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,20 @@
5555
<plugin>
5656
<groupId>org.apache.maven.plugins</groupId>
5757
<artifactId>maven-failsafe-plugin</artifactId>
58-
<version>3.2.2</version>
5958
<configuration>
6059
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
6160
</configuration>
6261
</plugin>
62+
<plugin>
63+
<groupId>org.jacoco</groupId>
64+
<artifactId>jacoco-maven-plugin</artifactId>
65+
<configuration>
66+
<excludes>
67+
<!-- Exclude full package from test coverage -->
68+
<exclude>**/*io/dapr/springboot/examples/**</exclude>
69+
</excludes>
70+
</configuration>
71+
</plugin>
6372
</plugins>
6473
</build>
6574
</project>
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,19 @@
1313

1414
package io.dapr.springboot.examples.workerone;
1515

16-
import io.dapr.client.DaprClient;
17-
import io.dapr.testcontainers.DaprContainer;
1816
import io.restassured.RestAssured;
19-
import io.restassured.http.ContentType;
2017
import org.junit.jupiter.api.BeforeEach;
2118
import org.junit.jupiter.api.Test;
22-
import org.springframework.beans.factory.annotation.Autowired;
2319
import org.springframework.boot.test.context.SpringBootTest;
2420

25-
import java.io.IOException;
26-
2721
import static io.restassured.RestAssured.given;
2822
import static org.awaitility.Awaitility.await;
2923
import static org.hamcrest.CoreMatchers.is;
3024
import static org.junit.jupiter.api.Assertions.assertEquals;
3125

3226
@SpringBootTest(classes = {TestWorkerOneApplication.class, DaprTestContainersConfig.class},
3327
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
34-
class WorkerOneAppTests {
28+
class WorkerOneAppIT {
3529

3630
@BeforeEach
3731
void setUp() {
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,19 @@
1313

1414
package io.dapr.springboot.examples.workertwo;
1515

16-
import io.dapr.client.DaprClient;
17-
import io.dapr.testcontainers.DaprContainer;
1816
import io.restassured.RestAssured;
19-
import io.restassured.http.ContentType;
2017
import org.junit.jupiter.api.BeforeEach;
2118
import org.junit.jupiter.api.Test;
22-
import org.springframework.beans.factory.annotation.Autowired;
2319
import org.springframework.boot.test.context.SpringBootTest;
2420

25-
import java.io.IOException;
26-
2721
import static io.restassured.RestAssured.given;
2822
import static org.awaitility.Awaitility.await;
2923
import static org.hamcrest.CoreMatchers.is;
3024
import static org.junit.jupiter.api.Assertions.assertEquals;
3125

3226
@SpringBootTest(classes = {TestWorkerTwoApplication.class, DaprTestContainersConfig.class},
3327
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
34-
class WorkerTwoAppTests {
28+
class WorkerTwoAppIT {
3529

3630
@BeforeEach
3731
void setUp() {

0 commit comments

Comments
 (0)