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

Gradle tests fail when running the build with Java 22 #3172

Open
fbricon opened this issue May 29, 2024 · 2 comments
Open

Gradle tests fail when running the build with Java 22 #3172

fbricon opened this issue May 29, 2024 · 2 comments

Comments

@fbricon
Copy link
Contributor

fbricon commented May 29, 2024

mvn clean verify -Dtest="*Gradle*" -DfailIfNoTests=false

yields:

Failures:
  GradleProjectMetadataFileTest.testDeleteClasspath:148->AbstractGradleBasedTest.importSimpleJavaProject:33 expected:<1[.]7> but was:<1[]7>
  GradleProjectMetadataFileTest.testDeleteClasspath:148->AbstractGradleBasedTest.importSimpleJavaProject:33 expected:<1[.]7> but was:<1[]7>
  GradleProjectMetadataFileTest.testMetadataFileLocation2:118
  GradleProjectMetadataFileTest.testMetadataFileLocation2:118
  GradleProjectMetadataFileTest.testSettingsGradle:124 expected:<2> but was:<1>
  GradleProjectMetadataFileTest.testSettingsGradle:124 expected:<2> but was:<1>
  GradleBuildSupportTest.testUpdate:34->AbstractGradleBasedTest.importSimpleJavaProject:33 expected:<1[.]7> but was:<1[]7>
  GradleProjectImporterTest.importGradleKtsProject:542->AbstractProjectsManagerBasedTest.assertNoErrors:363 kradle has errors:
Type=org.eclipse.buildship.core.errormarker:Message=Could not fetch model of type 'BuildEnvironment' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.3.3-bin.zip'.
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: /Users/fbricon/Dev/projects/eclipse.jdt.ls/org.eclipse.jdt.ls.tests/fakejdk/17/bin/java:LineNumber=0 expected:<0> but was:<1>
  GradleProjectImporterTest.importSimpleGradleProject:92->AbstractGradleBasedTest.importSimpleJavaProject:33 expected:<1[.]7> but was:<1[]7>
  GradleProjectImporterTest.testAndroidProjectSupport:644 expected:<2> but was:<1>
  GradleProjectImporterTest.testAndroidProjectSupportChanged:687 expected:<2> but was:<1>
  GradleProjectImporterTest.testAnnotationProcessing:739
  GradleProjectImporterTest.testBuildFile:354->AbstractGradleBasedTest.importSimpleJavaProject:33 expected:<1[.]7> but was:<1[]7>
  GradleProjectImporterTest.testGradlePersistence:289 gradle1 should not synchronize
  GradleProjectImporterTest.testGradlePropertiesFile:365->AbstractGradleBasedTest.importSimpleJavaProject:33 expected:<1[.]7> but was:<1[]7>
  GradleProjectImporterTest.testJava11Project:463->AbstractProjectsManagerBasedTest.assertIsJavaProject:319 gradle-11 is missing the Java nature
  GradleProjectImporterTest.testJava12Project:470->testJavaProjectWithPreviewFeatures:758->AbstractProjectsManagerBasedTest.assertIsJavaProject:319 gradle-12 is missing the Java nature
  GradleProjectImporterTest.testJava13Project:475->testJavaProjectWithPreviewFeatures:758->AbstractProjectsManagerBasedTest.assertIsJavaProject:319 gradle-13 is missing the Java nature
  GradleProjectImporterTest.testJava14Project:480->testJavaProjectWithPreviewFeatures:758->AbstractProjectsManagerBasedTest.assertIsJavaProject:319 gradle-14 is missing the Java nature
  GradleProjectImporterTest.testNameConflictProject:632 expected:<2> but was:<1>
  GradleProjectImporterTest.testSubprojects:490 expected:<3> but was:<1>
Errors:
  GradleProjectMetadataFileTest.testMetadataFileLocation:90 NullPointer Cannot invoke "org.eclipse.core.resources.IProject.getFile(String)" because "project" is null
  GradleProjectMetadataFileTest.testMetadataFileLocation:90 NullPointer Cannot invoke "org.eclipse.core.resources.IProject.getFile(String)" because "project" is null
  GradleProjectImporterTest.testProtoBufSupport:591 » JavaModel protobuf does not exist
  GradleProjectImporterTest.testProtoBufSupportChanged:609 » JavaModel protobuf does not exist

Tests run: 46, Failures: 21, Errors: 4, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for JDT Language Server :: Parent 1.36.0-SNAPSHOT:
[INFO]
[INFO] JDT Language Server :: Parent ...................... SUCCESS [  0.023 s]
[INFO] JDT Language Server :: Target Platform ............. SUCCESS [  0.003 s]
[INFO] JDT Language Server :: Core ........................ SUCCESS [ 15.024 s]
[INFO] JDT Language Server :: Filesystem .................. SUCCESS [  0.134 s]
[INFO] JDT Language Server :: Tests ....................... FAILURE [ 24.865 s]
[INFO] JDT Language Server :: Java LS Logback.appender .... SKIPPED
[INFO] JDT Language Server :: SyntaxServer Tests .......... SKIPPED
[INFO] JDT Language Server :: Product ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  42.402 s
[INFO] Finished at: 2024-05-29T18:29:46+02:00
[INFO] ------------------------------------------------------------------------
@fbricon
Copy link
Contributor Author

fbricon commented May 29, 2024

It's a known upstream issue: eclipse-buildship/buildship#1302 (comment)
Gradle itself can't run on Java 22 currently: https://docs.gradle.org/current/userguide/compatibility.html#java

@fbricon
Copy link
Contributor Author

fbricon commented May 29, 2024

Yeah now I have just 3 tests consistently failing, without changing anything O_o

Failures:
  GradleProjectImporterTest.testNameConflictProject:632 expected:<2> but was:<1>
Errors:
  GradleProjectImporterTest.testProtoBufSupport:591 » JavaModel protobuf does not exist
  GradleProjectImporterTest.testProtoBufSupportChanged:609 » JavaModel protobuf does not exist

Tests run: 46, Failures: 1, Errors: 2, Skipped: 0

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

No branches or pull requests

1 participant