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

Run tests with Java 21 #1362

Merged
merged 19 commits into from
Nov 17, 2023
Merged

Run tests with Java 21 #1362

merged 19 commits into from
Nov 17, 2023

Conversation

timyates
Copy link
Contributor

@timyates timyates commented Oct 12, 2023

Once starter is released for 4.2.0 and we can generate Java 21 projects, this can be merged

Currently it is set up to use 4.2.0-SNAPSHOT as the version target.

Excluded lambda and function guides which only work on 17.

There is one odd change that was required. When running Kapt projects, we needed to kill the Kotlin Compile Daemon as it holds on to the old properties it was started with, and doesn't notice that it needs to update to include the --add-opens for Kapt to work.

  • We can't --stop the gradle daemons (as this would kill the build itself)
  • We cannot use --no-daemon for all the builds as it takes AGES to run all the tests
  • We cannot use --no-daemon on just the kapt builds, as the Gradle daemon finds the old Kotlin daemon.

So I went with find the kotlin daemon and kill it before and after Kapt builds

Update the matrix to run PRs and the SNAPSHOT tests on Java 17 AND 21

Leave publishing on Java 17
@timyates timyates self-assigned this Oct 12, 2023
@timyates timyates marked this pull request as ready for review October 12, 2023 10:56
@timyates timyates requested a review from sdelamo October 12, 2023 10:56
@timyates timyates marked this pull request as draft October 12, 2023 11:20
@timyates timyates linked an issue Nov 1, 2023 that may be closed by this pull request
import jakarta.inject.Singleton;

@Singleton
public class MockServerClient implements Feature {
Copy link
Contributor

Choose a reason for hiding this comment

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

was this not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It collides with the one in v4.2.0 of Micronaut Starter

https://github.com/micronaut-projects/micronaut-starter/blob/4.2.x/starter-core/src/main/java/io/micronaut/starter/feature/test/MockServerClient.java

I assume this was added as a stop-gap until we got to use the one in 4.2.0?

buildSrc/build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
@sdelamo sdelamo marked this pull request as ready for review November 17, 2023 07:39
@timyates
Copy link
Contributor Author

@sdelamo should we switch to just testing 21 on a nightly basis?

@sdelamo
Copy link
Contributor

sdelamo commented Nov 17, 2023

@sdelamo should we switch to just testing 21 on a nightly basis?

yup.

great job making the java 21 transition

@sdelamo sdelamo merged commit 324f7a3 into master Nov 17, 2023
2 checks passed
@sdelamo sdelamo deleted the java-21 branch November 17, 2023 11:25
AndreaLaGrotteria pushed a commit to AndreaLaGrotteria/micronaut-guides that referenced this pull request Oct 3, 2024
* Run tests with Java 21

Update the matrix to run PRs and the SNAPSHOT tests on Java 17 AND 21

Leave publishing on Java 17

* Gradle 8.4

* WIP

* Limit Guides to 17 where sensible

* Fix micronaut-graalvm-reflection validation

* If running on Java 21, don't use the Gradle daemon

We need this as we need to pick up Kapt add-opens.

If we use the daemon, then these are not picked up and kapt compilations will fail

* Limit google-function guide to java 17

* Kill the kotlin compilation daemon before and after kapt tests

* Few more Java 21 exclusions for Lambda

* Remove non-required changes

* Add debug

* Remove debug, use a loop

* Re-enable conditional

* Another 21 exclusion

* Stop downgrading Kotlin to Java 17 for Spring/Kotlin apps

---------

Co-authored-by: sdelamo <sergio.delamo@softamo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Test guides with Java 21
2 participants