I'd still appreciate more elaboration on your comments, but I guess what I'm going to attempt is to add exclusions in my parent pom for ALL of the junit-platform and junit-jupiter artifacts (because the spring starter artifacts include all of those) and then iteratively test removing the exclusions for only "junit-platform-suite-engine" and "junit-jupiter-engine" and see what doesn't work.
Note that our use cases are more complicated than that simple example. We have to support both Junit 5 and Junit 4 mixed tests at this time. That will definitely mean the junit-vintage-engine" will have to be included. > -----Original Message----- > From: KARR, DAVID <dk0...@att.com> > Sent: Friday, July 8, 2022 4:59 PM > To: Maven Users List <users@maven.apache.org>; i...@soebes.de; David > Karr <davidmichaelk...@gmail.com> > Subject: RE: JUnit 5 test suites not running again > > Inline. > > > -----Original Message----- > > From: Karl Heinz Marbaise <khmarba...@gmx.de> > > Sent: Friday, July 8, 2022 9:21 AM > > To: David Karr <davidmichaelk...@gmail.com>; i...@soebes.de > > Cc: Maven Users List <users@maven.apache.org> > > Subject: Re: JUnit 5 test suites not running again > > > > On 08.07.22 18:09, David Karr wrote: > > > Inline. > > > > > > On Fri, Jul 8, 2022 at 8:17 AM Karl Heinz Marbaise > > > <khmarba...@gmx.de <mailto:khmarba...@gmx.de>> wrote: > > > > > > Hi, > > > > > > On 08.07.22 16:18, David Karr wrote: > > > > I had gotten help here with our JUnit 5 transition, and I > > thought > > > I had it > > > > all working, but now I see that I'm back to the state where > our > > > JUnit 5 > > > > test suites are being ignored. > > > > > > > >>From what I understood, I had to ensure that > > > "junit-platform-runner" was > > > > excluded as a dependency. What I have seems to have done > this, > > > but only > > > > halfway. The "dependency-tree" doesn't have that artifact. > > > However, when > > > > I generated the effective pom, I DID see that artifact. I'm > not > > > sure what > > > > that means. > > > > > > > > I run this command line: > > > > > > > > mvn -U -Dtest=ComponentTestSuite test > > > > > > > > Here's an excerpt of the output: > > > > ------------------ > > > > [INFO] --- maven-surefire-plugin:3.0.0-M7:test (default-test) > @ > > > > PlatformPilotMs --- > > > > [INFO] Using auto detected provider > > > > org.apache.maven.surefire.junitplatform.JUnitPlatformProvider > > > > [INFO] > > > > [INFO] ------------------------------------------------------ > - > > > > [INFO] T E S T S > > > > [INFO] ------------------------------------------------------ > - > > > > [INFO] > > > > [INFO] Results: > > > > [INFO] > > > > [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 > > > > ------------------ > > > > > > > > As you can see, I'm using v3.0.0-M7 of Surefire. I'm using > > v1.8.2 of > > > > junit-platform, and v5.8.2 of junit-jupiter. > > > > > > > > I've designed a parent pom hierarchy that looks like this: > > > > > > > > sdk-java-parent: > > > > dependencyManagement includes "ext-bom" pom with scope > > "import" > > > > dependencies has a block like this: > > > > -------------- > > > > <dependency> > > > > <groupId>...</groupId> > > > > <artifactId>seed-sdk-core</artifactId> > > > > <exclusions> > > > > <exclusion> > > > > <groupId>org.junit.platform</groupId> > > > > <artifactId>junit-platform- > > runner</artifactId> > > > > </exclusion> > > > > </exclusions> > > > > </dependency> > > > > -------------- > > > > > > > > The effective pom also has this: > > > > ---------------------- > > > > <plugin> > > > > <groupId>org.apache.maven.plugins</groupId> > > > > <artifactId>maven-surefire-plugin</artifactId> > > > > <version>3.0.0-M7</version> > > > > <configuration> > > > > <forkCount>1</forkCount> > > > > <reuseForks>false</reuseForks> > > > > > > > > <redirectTestOutputToFile>true</redirectTestOutputToFile> > > > > <argLine>${surefireArgLine}</argLine> > > > > <skipTests>false</skipTests> > > > > <excludes> > > > > <exclude>**/contract/*.java</exclude> > > > > <exclude>**/integration/*.java</exclude> > > > > <exclude>**/component/*.java</exclude> > > > > </excludes> > > > > </configuration> > > > > </plugin> > > > > ------------------- > > > > > > > > What could we be missing? > > > > > > > > > > > > > Which dependencies do you have defined for running junit jupiter > > tests? > > > > > > > > > These are the resulting junit-jupiter dependencies in the effective > > pom: > > > > > > junit-jupiter > > > junit-jupiter-api > > > junit-jupiter-engine > > > junit-jupiter-migrationsupport > > > junit-jupiter-params > > > > > > Migrationsupport means JUnit 4... not JUnit Jupiter.. > > Can you please say a little more about this? How am I supposed to > interpret this statement? > > Note that I’m not including these dependencies explicitly. I'm just > including spring-boot-starter-test as a dependency, and I believe that > is specifying all of the junit-platform and junit-jupiter dependencies. > > > Check the example: > > > > https://urldefense.com/v3/__https://github.com/khmarbaise/youtube- > > videos/tree/episode-4/episode-4__;!!BhdT!h0T4hl4evyAM6E7Tn4EXDDTtehn- > > DKUE0stAC6OJifklNt8X_G0yvcNyz8rln8jfucvpyoSu0KU0QzqMYGY$ > > And what about the example am I supposed to be seeing? > > > Kind regards > > Karl Heinz Marbaise > > > > > > > > > > And these are the resulting junit-platform dependencies (still not > > > sure why junit-platform-runner is in here, when I'm excluding it AND > > > it doesn't appear in dependency:tree): > > > > > > junit-platform-commons > > > junit-platform-console > > > junit-platform-engine > > > junit-platform-jfr > > > junit-platform-launcher > > > junit-platform-reporting > > > junit-platform-runner > > > junit-platform-suite > > > junit-platform-suite-api > > > junit-platform-suite-commons > > > junit-platform-suite-engine > > > junit-platform-testkit > > > > > > > > > Why do you think you need to exclude junit jupiter runner? > > > > > > > > > Not jupiter, but "junit-platform-runner". Looking at the message > > > history, I see that "Slawomir Jaranowski" at least, had said this. > > > > > > > > > Do you use the dependency junit-jupiter-engine as a dependency: > > > > > > Are you using @Suite annotation of JUnit Jupiter? > > > > > > Have you defined a class for example `ComponentTestSuite` like > > this: > > > > > > @Suite > > > @SelectPackages("package.xxx") > > > @IncludeClassNamePatterns(".*Pattern") > > > class SuiteDemoTests { > > > > > > }.. > > > > > > > > > This is an excerpt of my test suite: > > > ------------ > > > import org.junit.platform.suite.api.SelectClasses; > > > import org.junit.platform.suite.api.Suite; > > > > > > @Suite > > > @SelectClasses({... > > > ---------- > > > > > > > > > > > > If you like to run suites you have to have two dependencies: > > > > > > <dependency> > > > <groupId>org.junit.platform</groupId> > > > <artifactId>junit-platform-suite-engine</artifactId> > > > <scope>test</scope> > > > </dependency> > > > <dependency> > > > <groupId>org.junit.jupiter</groupId> > > > <artifactId>junit-jupiter-engine</artifactId> > > > <scope>test</scope> > > > </dependency> > > > > > > > > > Kind regards > > > Karl Heinz Marbaise > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > > For additional commands, e-mail: users-h...@maven.apache.org > > B > KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB > [ X ܚX KK[XZ[ > > \ \ ][ X ܚX PX] [ \X K ܙ B ܈Y][ۘ[ [X[ K[XZ[ > > \ \ Z[X] [ \X K ܙ B