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

Add native testing with GraalVM and test containers #449

Merged
merged 3 commits into from
Apr 20, 2023
Merged

Conversation

graemerocher
Copy link
Contributor

@graemerocher graemerocher commented Apr 19, 2023

  • Migrates tests to use test resources
  • Adds native testing of Java tests with GraalVM
  • Fixes native image support which was broken for 4.x

Relates to micronaut-projects/micronaut-core#9083

@graemerocher graemerocher marked this pull request as ready for review April 19, 2023 12:21
@graemerocher graemerocher added type: improvement A minor improvement to an existing feature relates-to: graal labels Apr 19, 2023
@sonarcloud
Copy link

sonarcloud bot commented Apr 19, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 16 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@@ -1,7 +1,9 @@
[versions]
micronaut-docs = '2.0.0'
micronaut = '4.0.0-M1'
micronaut = '4.0.0-M2'
micronaut-platform = '4.0.0-M1'
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need micronaut-platform version? We are trying for modules not to depend on platform.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was on the recommendation of @melix

basically I don't see a way to use the Micronaut Gradle plugin without specifying the platform

Copy link
Contributor

Choose a reason for hiding this comment

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

this was on the recommendation of @melix

basically I don't see a way to use the Micronaut Gradle plugin without specifying the platform

@melix is not enough to specify micronaut-gradle-plugin = "4.0.0-M1" why do we need platform version?

Copy link

Choose a reason for hiding this comment

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

Short answer: because we're hacking to use user build plugins in our module builds.

Long answer

Our modules use our internal build plugins. Those plugins must not depend on the platform, and automatically add a catalog named mn which corresponds to the core version of Micronaut. This plugin expects the micronaut property to refer to the core version.

On the other hand, a user applying the Micronaut application plugin defines micronautVersion (micronaut, or micronaut-platform in a catalog), but there it corresponds to the platform version. Latest release also supports adding automatically a catalog named mn, but then it's the platform catalog, unlike our internal build plugins.

Because in our tests we use the Gradle plugin, we are in a conflict situation where our internal plugins expect micronaut to be the version of core, while the user Gradle plugin expects it to be the platform version.

Therefore, we have to explain, in our test suites, that the micronaut version to be used, the platform one, is different. That we can do by explicitly having a variable which stores the platform version and uses it in the tests.

@sdelamo sdelamo merged commit f94c850 into master Apr 20, 2023
@sdelamo sdelamo deleted the graal_tests branch April 20, 2023 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relates-to: graal type: improvement A minor improvement to an existing feature
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants