8

I have some integration tests that are run with the failsafe plugin. This works until Spring Boot 2.3.5.RELEASE, but after migrating to 2.4.0 the ITs are no longer executed.

  1. Does anybody have the same problem?

  2. How can I debug failsafe to find out why the tests are not executed?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Simon Martinelli
  • 34,053
  • 5
  • 48
  • 82
  • On how to debug Maven Failsafe Plugin, it should be doable by adding `-Dmaven.failsafe.debug` to your maven configuration, then configure a remote debugger configuration on localhost and port 5005. This [SO thread](https://stackoverflow.com/a/53803856/11982497) describes how to do it for IntelliJ. A similar approach should be doable in Eclipse by ading a "Remote Java Application" configuration – Tarek Oraby Dec 01 '20 at 08:05
  • Hi Tarek, By debug I meant to get some information where failsafe is searching for the test classes to see why it doesn't fine any – Simon Martinelli Dec 01 '20 at 08:07
  • Right, in that case adding one of the following flags might be helpful -X,--debug,-e,--errors – Tarek Oraby Dec 01 '20 at 08:14
  • I add -X I can see that the testClassesDirectory is correct. But it doesn't execute anything – Simon Martinelli Dec 01 '20 at 08:58

2 Answers2

9

The problem was that the ITs are Junit4 tests and Spring Boot 2.4.0 removed the vintage Junit dependency.

I had to add the following dependency.

<dependency>
    <groupId>org.junit.vintage</groupId>
    <artifactId>junit-vintage-engine</artifactId>
    <scope>test</scope>
    <exclusions>
        <exclusion>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
        </exclusion>
    </exclusions>
</dependency>
Simon Martinelli
  • 34,053
  • 5
  • 48
  • 82
  • 1
    Upgrading Maven Failsafe plugin from version 2.22.2 to 3.0.0-M5 also did the trick for me. – Thomas Oct 06 '21 at 04:01
2

For me I "updated" my IT test so it uses Junit 5 style imports. Also failsafe plugin version -> 3.0.0-M5

Now they run.

Instead of silently not running, yikes.

rogerdpack
  • 62,887
  • 36
  • 269
  • 388