Skip to content

Upgrade tests to JUnit 6 - #652

Merged
AbdullinAM merged 4 commits into
mainfrom
junit-6
Aug 7, 2026
Merged

Upgrade tests to JUnit 6#652
AbdullinAM merged 4 commits into
mainfrom
junit-6

Conversation

@qwwdfsad

Copy link
Copy Markdown
Member

A few notes:

  • kotlin-test is removed as obsolete
  • JUnit4 in a lambda module is kept, I'll remove the whole module later, no need to touch it
  • @AbdullinAM for your experiments with CI -- the min JDK baseline is now 17 due to JUnit 6 requirement

This is a basis for the next PR with tests revamp (and it's more pleasant to do it with JUnit 6 + it's always nice to renovate things) and a nice testing ground for stacked PRs

Comment thread core/build.gradle.kts Outdated
testImplementation(libs.junit)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.googleTruth) {
exclude(group = "junit", module = "junit")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My suggestion is to just get rid of it. As far as I can see, there is nothing specific about its usage. All tests can use default JUnit assertions

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Comment thread gradle/libs.versions.toml
gson = { module = "com.google.code.gson:gson", version.ref = "com-google-code-gson-gson" }
guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" }
junit = { module = "junit:junit", version.ref = "junit-junit" }
junit-bom = { module = "org.junit:junit-bom", version.ref = "org-junit-junit-bom" }

@qwwdfsad qwwdfsad Jul 31, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If you are puzzled by the convention between dashes and camel case, it makes two of us now: https://docs.gradle.org/current/userguide/best_practices_dependencies.html#name_version_catalog_entries

@AbdullinAM

Copy link
Copy Markdown
Member

My only concern with this approach to test generation is that it is very inconvenient for debugging individual test cases: you have to add conditional filtering in the factory to run a single test that you are interested in. My original idea was to replicate the approach from the compiler, I even had a prototype that does it. Maybe we can adapt something like this?

@qwwdfsad

qwwdfsad commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

@AbdullinAM do you mean from Gradle and/or -agent: or from IntelliJ? If the latter, IJ is perfectly capable of selecting one test without any issues, there on rerun

@AbdullinAM
AbdullinAM merged commit b02c846 into main Aug 7, 2026
6 checks passed
@AbdullinAM
AbdullinAM deleted the junit-6 branch August 7, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants