Skip to content

Conversation

@gsmet
Copy link
Member

@gsmet gsmet commented Dec 4, 2025

Note that the assumption in this work is that junit-jupiter will mostly stay compatible and that they won't break everything. But I think it's a relatively fair assumption given how they handled the JUnit 4 -> JUnit 5 and the JUnit 5 -> JUnit 6 move.

@quarkus-bot quarkus-bot bot added area/arc Issue related to ARC (dependency injection) area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/platform Issues related to definition and interaction with Quarkus Platform area/testing labels Dec 4, 2025
@gastaldi
Copy link
Contributor

gastaldi commented Dec 5, 2025

@gsmet this is what I came up with my investigation back then: 8781c2c (#50355)

Note that you also need to bump devtools/gradle/gradle/libs.versions.toml

gsmet added 2 commits December 5, 2025 11:05
Also adjust QuarkusTestNestedTestCase as the order in which nested tests
are executed have changed and is now a lot more logical.
And put relocations in place.
Update recipes will also be provided.
@gsmet
Copy link
Member Author

gsmet commented Dec 5, 2025

@gastaldi ah sorry, I totally missed you had started this work.

@gsmet
Copy link
Member Author

gsmet commented Dec 5, 2025

/cc @cescoffier @geoand @Sanne @aloubyansky @gastaldi please check the approach described in the description as the renaming is a rather massive change and I would like to be sure we're all on the same page.

See https://groups.google.com/g/quarkus-dev/c/yUc9s5U4DbA

@gsmet
Copy link
Member Author

gsmet commented Dec 5, 2025

Also /cc @holly-cummins @mkouba as you were involved in some of the testing infra.

@geoand
Copy link
Contributor

geoand commented Dec 5, 2025

That's the plan I was +1 with :)

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

🎊 PR Preview 5b8ebed has been successfully built and deployed to https://quarkus-pr-main-51412-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@Sanne
Copy link
Member

Sanne commented Dec 5, 2025

I'm ok with this approach - but I wonder if you considered the alternative of introducing a new set of quarkus-junit6 artifacts rather than renaming?
That would give people an easier path to upgrade decoupled from other changes, but I'm guessing this is only relevant if the assumption of super-smooth migration proves too optimistic.

This could also be useful if we had some semantic changes on our wishlist which we didn't dare do because of user update hassle.

(But I fully agree this is all unnecessary if it's a very simple drop-in change)

@mkouba
Copy link
Contributor

mkouba commented Dec 5, 2025

I understand that JUnit6 is more like an evolution with minimal breaking changes and as such a good candidate for drop-in replacement. And the user has an option to go back to JUnit5 and it should work, more or less.

But I wonder if we should clarify the strategy for future releases. quarkus-junit-jupiter suggests that we will support a single version of JUnit which might be compatible with other versions (i.e. JUnit6 and JUnit5). But it does not suggest which version/s is/are actually supported. And that's probably fine but it requires some extra knowledge.

Also I don't have any numbers but I think that most users do not care about platform/jupiter/vintage, so quarkus-junit might be a better choice for the artifactId. Or maybe even quarkus-test?

Another question is - what if JUnit7 will be a "revolution", i.e. not a drop-in replacement? The artifactId remains the same, but Quarkus will silently drop support for older versions of JUnit?


<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.junit>5.13.4</version.junit>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this property be defined in the parent POM?

@@ -178,9 +178,9 @@ void beforeEach() {
@Test
void testOne() {
assertEquals(1, COUNT_BEFORE_ALL.get(), "COUNT_BEFORE_ALL");
assertEquals(3, COUNT_BEFORE_EACH.get(), "COUNT_BEFORE_EACH");
assertEquals(1, COUNT_TEST.getAndIncrement(), "COUNT_TEST");
assertEquals(1, COUNT_AFTER_EACH.get(), "COUNT_AFTER_EACH");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know what causes these changes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yes, that looks like it might need investigation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's expected, the order in which nested tests are executed have been changed and is now more natural.

@aloubyansky
Copy link
Member

But I wonder if we should clarify the strategy for future releases. quarkus-junit-jupiter suggests that we will support a single version of JUnit which might be compatible with other versions (i.e. JUnit6 and JUnit5). But it does not suggest which version/s is/are actually supported. And that's probably fine but it requires some extra knowledge.

That's true. OTOH, the same could be said about Quarkus extensions, such as quarkus-hibernate.

Also I don't have any numbers but I think that most users do not care about platform/jupiter/vintage, so quarkus-junit might be a better choice for the artifactId. Or maybe even quarkus-test?

quarkus-junit looks nice.

@gsmet
Copy link
Member Author

gsmet commented Dec 5, 2025

We could go with quarkus-junit. My problem with this is: what if they introduce a brand new version that breaks the compatibility entirely and we want to support bother versions at the same time.

Now I'm not sold with the names, we can adjust but it's not really easy to find something that is future proof given we have no idea what the future will be.

@gsmet
Copy link
Member Author

gsmet commented Dec 5, 2025

As for quarkus-junit6, why not but the thing is that I really don't want to support both JUnit 5 and 6 given they are very very similar and as @mkouba said more an evolution.
So if we did that, I think I would add some relocations to rewrite junit5 to junit6 anyway and keep only one version.

@geoand
Copy link
Contributor

geoand commented Dec 5, 2025

I really don't want to support both JUnit 5 and 6

I couldn't agree more. We should only support one

@mkouba
Copy link
Contributor

mkouba commented Dec 5, 2025

We could go with quarkus-junit. My problem with this is: what if they introduce a brand new version that breaks the compatibility entirely and we want to support bother versions at the same time.

Like a replacement for Jupiter? 🤔 That would mean a new programming model/extension model and I don't think we will be able to support multiple extension models easily...

Now I'm not sold with the names, we can adjust but it's not really easy to find something that is future proof given we have no idea what the future will be.

💯

@gsmet
Copy link
Member Author

gsmet commented Dec 5, 2025

Like a replacement for Jupiter? 🤔 That would mean a new programming model/extension model and I don't think we will be able to support multiple extension models easily...

Well at some point we had a JUnit 4 artifact IIRC. If they push a brand new version of JUnit that breaks everything, we will probably need new artifacts and yes a brand new implementation. And we might want to support both models for a while. Now, we could decide to rename the old ones to a disctinctive names and keep quarkus-junit for the latest.

I'm fine with moving to quarkus-junit. Let me know if it all works for you... because given it's a simplification, it will be annoying to rename it afterwards.

@geoand
Copy link
Contributor

geoand commented Dec 5, 2025

I'm fine with moving to quarkus-junit

Fine with me as well

@gastaldi
Copy link
Contributor

gastaldi commented Dec 5, 2025

No objections, but thinking ahead how about quarkus-test as @mkouba suggested earlier? That would save us the hassle of renaming again if Junit brand is renamed to something else

@holly-cummins
Copy link
Contributor

No objections, but thinking ahead how about quarkus-test as @mkouba suggested earlier? That would save us the hassle of renaming again if Junit brand is renamed to something else

That seems too generic to me; it doesn't give people enough information about what's inside. In particular, it's not obvious from the dependency name that you wouldn't need JUnit on your classpath, because this is giving you JUnit.

It would also rule out some future in which we decide we don't have enough work and want to support both JUnit and a cool new challenger testing framework. It would kind of work if we switched from JUnit to CoolNewChallengerTest, but I'm not sure we'd want the name to stay the same if we did such a massive breaking change.

@aloubyansky
Copy link
Member

We also could create something on our own and name it quarkus-test.

@geoand
Copy link
Contributor

geoand commented Dec 5, 2025

Obviously, the only constant in technology is change, but given what we've seen in the past few years, I don't think that many people are asking for / and no one I know of is working on a new unit test framework in Java - JUnit has won, and rightly so, as it is awesome.
Moreover, I don't envision that JUnit itself will introduce some massive programming model change - it uses what most of the enterprise Java community has settled on, i.e., an annotation-based model based on a well-defined lifecycle and by all accounts, users are happy with it.

I don't see the JUnit 4 vs TestNG vs Spock situation repeating itself any time soon (and I'd be willing to put my money where my mouth is on this :)).

Calling the extension quarkus-junit seems like the most pragmatic option to me as it conveys the functionality of the dependency, and if JUnit 7 comes along at some point and has some breaking changes - so be it, we and users deal with analogous situations in other extensions all the time.

@gsmet
Copy link
Member Author

gsmet commented Dec 5, 2025

Yeah, I'm -1 for quarkus-test and I'm fine with quarkus-junit.

If nobody objects by Monday evening, I will go do that on Tuesday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agroal area/amazon-lambda area/arc Issue related to ARC (dependency injection) area/cache area/config area/container-image area/context-propagation area/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/docstyle issues related for manual docstyle review area/documentation area/elasticsearch area/fault-tolerance area/flyway area/funqy area/google-cloud-functions area/gradle Gradle area/graphics area/graphql area/grpc gRPC area/health area/hibernate-orm Hibernate ORM area/hibernate-reactive Hibernate Reactive area/hibernate-search Hibernate Search area/hibernate-validator Hibernate Validator area/infinispan Infinispan area/jackson Issues related to Jackson (JSON library) area/jaxb area/jdbc Issues related to the JDBC extensions area/kafka area/kafka-streams area/keycloak area/kotlin area/kubernetes area/liquibase area/logging area/lra area/mailer area/maven area/metrics area/mongodb area/mutiny area/narayana Transactions / Narayana area/oidc area/openapi area/panache area/picocli area/platform Issues related to definition and interaction with Quarkus Platform area/qute The template engine area/reactive-messaging area/reactive-sql-clients area/reactive-streams-operators area/redis area/rest area/rest-client area/resteasy-classic area/scala area/scheduler area/security area/smallrye area/spring Issues relating to the Spring integration area/swagger-ui area/testing area/tracing area/undertow area/vertx area/websockets release/breaking-change release/noteworthy-feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants