Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus 2.4.1.Final - Continuous Testing - engine.JupiterTestEngine not a subtype #21226

Closed
mettwm opened this issue Nov 5, 2021 · 8 comments · Fixed by #23293
Closed

Quarkus 2.4.1.Final - Continuous Testing - engine.JupiterTestEngine not a subtype #21226

mettwm opened this issue Nov 5, 2021 · 8 comments · Fixed by #23293
Labels
area/continuous-testing kind/bug Something isn't working triage/needs-reproducer We are waiting for a reproducer.
Milestone

Comments

@mettwm
Copy link

mettwm commented Nov 5, 2021

Describe the bug

Hi there,

I have started to play with 2.4.1.Final quarkus to convert my application with tests originally for 1.13.6.Final to see if I see I hit the wall somewhere :)

The application was working as expected yet I got following error when pressing [r] to run my tests in quarkus:dev mode

2021-11-05 12:54:47,047 ERROR [io.qua.test] (Test runner thread) Internal error running tests: java.util.ServiceConfigurationError: org.junit.platform.engine.TestEngine: org.junit.jupiter.engine.JupiterTestEngine not a subtype at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:589) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1237) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1265) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385) at java.base/java.lang.Iterable.forEach(Iterable.java:74) at org.junit.platform.launcher.core.LauncherFactory.collectTestEngines(LauncherFactory.java:145) at org.junit.platform.launcher.core.LauncherFactory.createDefaultLauncher(LauncherFactory.java:131) at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:125) at io.quarkus.deployment.dev.testing.JunitTestRunner.prepare(JunitTestRunner.java:146) at io.quarkus.deployment.dev.testing.ModuleTestRunner.prepare(ModuleTestRunner.java:83) at io.quarkus.deployment.dev.testing.TestSupport.runInternal(TestSupport.java:335) at io.quarkus.deployment.dev.testing.TestSupport$2.run(TestSupport.java:294) at java.base/java.lang.Thread.run(Thread.java:834)

here is the part of the pom.xml

`

	<!-- Quarkus bits -->
	<quarkus-plugin.version>2.4.1.Final</quarkus-plugin.version>
	<quarkus.package.type>uber-jar</quarkus.package.type>
	<quarkus.version>2.4.1.Final</quarkus.version>
	<quarkus-junit5-mockito.version>2.4.1.Final
	</quarkus-junit5-mockito.version>
	<wiremock.version>2.31.0</wiremock.version>
	<xmlunit-assertj.version>2.8.2</xmlunit-assertj.version>
	<commons-lang3.version>3.12.0</commons-lang3.version>
</properties>
<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-bom</artifactId>
			<version>${quarkus.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>
<dependencies>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-bootstrap-runner</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus.arc</groupId>
		<artifactId>arc</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-core</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-arc</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-resteasy</artifactId>
	</dependency>
	<dependency>
		<groupId>org.jboss.resteasy</groupId>
		<artifactId>resteasy-core</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-hibernate-validator</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-rest-client-mutiny</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-rest-client-jackson</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-junit5</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>io.rest-assured</groupId>
		<artifactId>rest-assured</artifactId>
		<scope>test</scope>
		<exclusions>
			<exclusion>
				<artifactId>hamcrest</artifactId>
				<groupId>org.hamcrest</groupId>
			</exclusion>
		</exclusions>
	</dependency>
	<dependency>
		<groupId>com.github.tomakehurst</groupId>
		<artifactId>wiremock-jre8</artifactId>
		<!-- <artifactId>wiremock</artifactId> -->
		<version>${wiremock.version}</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.xmlunit</groupId>
		<artifactId>xmlunit-assertj</artifactId>
		<version>${xmlunit-assertj.version}</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-junit5-mockito</artifactId>
		<version>${quarkus-junit5-mockito.version}</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<version>${lombok.version}</version>
	</dependency>
	<dependency>
		<groupId>org.mapstruct</groupId>
		<artifactId>mapstruct</artifactId>
		<version>${mapstruct.version}</version>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-container-image-docker</artifactId>
	</dependency>
	<dependency>
		<groupId>io.quarkus</groupId>
		<artifactId>quarkus-smallrye-health</artifactId>
	</dependency>
	<dependency>
		<groupId>org.apache.commons</groupId>
		<artifactId>commons-lang3</artifactId>
		<version>${commons-lang3.version}</version>
	</dependency>
</dependencies>

`

So, it was using quarkus-junit5 & quarkus-junit5-mockito and java was

$ java --version java 11.0.12 2021-07-20 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode)

By the way mvn clean compile test ran all tests successfully.

Cheers.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

java 11.0.12 2021-07-20 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@mettwm mettwm added the kind/bug Something isn't working label Nov 5, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 5, 2021

/cc @stuartwdouglas

@gsmet
Copy link
Member

gsmet commented Nov 8, 2021

@mettwm it would help if you could prepare a small reproducer.

@gsmet gsmet added the triage/needs-reproducer We are waiting for a reproducer. label Nov 8, 2021
@rkraneis
Copy link

rkraneis commented Nov 12, 2021

We also face this problem. The cause (for us; the above pom doesn't show this setup) seems to be having a dependency on another maven module in the reactor. Will follow up with a reproducer.
I cannot reproduce this (yet) with a minimal setup. Sadly, mvn dependency:tree had as the only difference between working and non-working project this module.

@gsmet
Copy link
Member

gsmet commented Jan 4, 2022

I'm closing this one given we don't have any reproducer allowing us to dig what's going on. If you end up having a reproducer, please reopen (or open a new issue with the reproducer attached).

Thanks.

@gsmet gsmet closed this as completed Jan 4, 2022
@bnazare
Copy link

bnazare commented Jan 28, 2022

@gsmet I encountered the same issue and I think I managed to create a minimal reproducer here: https://github.com/bnazare/quarkus-21226-reproducer

To make a long story short, it seems the issue occurs when you have a quarkus module in a multi-module project and said quarkus module depends on a second module which in turn depends on junit-jupiter-engine.

As for the reproducer, it's a very basic multi-module build with a quarkus module taken directly from https://code.quarkus.io/ and a second module with just an empty class and a dependency on junit-jupiter-engine (which it doesn't even use).

To reproduce the issue do the following:

  1. create a clone of https://github.com/bnazare/quarkus-21226-reproducer
  2. run mvn clean install in the project's root
  3. change to folder code-with-quarkus
  4. run mvn clean quarkus:test

You can make the issue go away by doing the following:

  1. remove the junit-jupiter-engine dependency from acme-dep/pom.xml
  2. run mvn clean quarkus:test again

In case it's relevant here's the output from mvn --version:

$ mvn --version
Apache Maven 3.6.3 (Red Hat 3.6.3-13)
Maven home: /usr/share/maven
Java version: 11.0.13, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-2.fc35.x86_64
Default locale: pt_PT, platform encoding: UTF-8
OS name: "linux", version: "5.15.16-200.fc35.x86_64", arch: "amd64", family: "unix"

I got similar result with Maven 3.8.4.

@gsmet
Copy link
Member

gsmet commented Jan 28, 2022

@geoand could you have a look at the reproducer? ^

@geoand
Copy link
Contributor

geoand commented Jan 28, 2022

I'll try and have a look on Monday

@geoand
Copy link
Contributor

geoand commented Jan 31, 2022

Looks like Stuart already took care of it :)

@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Jan 31, 2022
@gsmet gsmet modified the milestones: 2.8 - main, 2.7.1.Final Jan 31, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/continuous-testing kind/bug Something isn't working triage/needs-reproducer We are waiting for a reproducer.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants