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

Update to LSP4MP 0.13.3 #1035

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

rgrunber
Copy link
Member

@rgrunber rgrunber commented Dec 4, 2024

  • ProjectLabelTest, and PropertiesManagerLocationTest should import all test projects initially (@BeforeClass) as now, load{Maven,Gradle}Project will clear any previously imported test projects
  • quarkus-renarde-todo, microprofile-applicationpath test projects do not need .project/.classpath files
  • artifactID should match project folder for quarkus-renarde-todo

@rgrunber rgrunber added the dependencies Pull requests that update a dependency file label Dec 4, 2024
@rgrunber rgrunber added this to the 0.21.1 milestone Dec 4, 2024
@rgrunber rgrunber requested a review from datho7561 December 4, 2024 18:15
@datho7561
Copy link
Contributor

There's a test that failing consistently: PropertiesManagerLocationTest.usingVertxTest

@datho7561
Copy link
Contributor

datho7561 commented Dec 4, 2024

This fixed the vertx test for me:

diff --git a/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus.test/src/main/java/com/redhat/microprofile/jdt/quarkus/PropertiesManagerLocationTest.java b/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus.test/src/main/java/com/redhat/microprofile/jdt/quarkus/PropertiesManagerLocationTest.java
index fb33f04e..47acc2a0 100644
--- a/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus.test/src/main/java/com/redhat/microprofile/jdt/quarkus/PropertiesManagerLocationTest.java
+++ b/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus.test/src/main/java/com/redhat/microprofile/jdt/quarkus/PropertiesManagerLocationTest.java
@@ -19,12 +19,14 @@ import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.IMember;
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin;
+import org.eclipse.jdt.ls.core.internal.ProjectUtils;
 import org.eclipse.lsp4j.ClientCapabilities;
 import org.eclipse.lsp4j.Location;
 import org.eclipse.lsp4mp.jdt.core.BasePropertiesManagerTest;
 import org.eclipse.lsp4mp.jdt.core.PropertiesManager;
 import org.eclipse.lsp4mp.jdt.core.utils.IJDTUtils;
 import org.junit.Assert;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 
@@ -36,12 +38,17 @@ import org.junit.Test;
  */
 public class PropertiesManagerLocationTest extends BasePropertiesManagerTest {
 	
+	@BeforeClass
+	public static void setupTetststs() throws CoreException, Exception {
+		loadMavenProject(MicroProfileMavenProjectName.using_vertx);
+	}
+
 	@Test
 	public void usingVertxTest() throws Exception {
 		// Enable classFileContentsSupport to generate jdt Location
 		enableClassFileContentsSupport();
 
-		IJavaProject javaProject = loadMavenProject(MicroProfileMavenProjectName.using_vertx);
+		IJavaProject javaProject = ProjectUtils.getJavaProject(MicroProfileMavenProjectName.using_vertx);
 
 		// Test with JAR
 		// quarkus.datasource.url

@rgrunber rgrunber force-pushed the fix-tests branch 2 times, most recently from 6cae8b8 to 0acfad5 Compare December 4, 2024 20:21
@rgrunber rgrunber self-assigned this Dec 4, 2024
@rgrunber
Copy link
Member Author

rgrunber commented Dec 4, 2024

I think it's worth investigating

ConfigItemIntBoolDefaultValueTest.configItemIntBoolDefaultValueTest:42 expected:<276> but was:<273>
MicroProfileConfigPropertyTest.configQuickstartFromClasspath:37 expected:<276> but was:<273>

before merging. They only fail in the GHA job, and never locally so I suspect something about the GHA configuration.

@rgrunber
Copy link
Member Author

rgrunber commented Dec 5, 2024

ConfigItemIntBoolDefaultValueTest.configItemIntBoolDefaultValueTest:42 expected:<276> but was:<273>
MicroProfileConfigPropertyTest.configQuickstartFromClasspath:37 expected:<276> but was:<273>

Thanks to @datho7561 for helping me narrow down the issue. Specifically,

https://github.com/eclipse-jdt/eclipse.jdt.core/blob/452a5de1ca83d1641d9a537417c71a531c36f831/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java#L281-L295

https://github.com/eclipse/lsp4mp/blob/1ba1bcc32da25562b6ee7b42770d5c1539abf85a/microprofile.jdt/org.eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/jdt/core/utils/JDTTypeUtils.java#L45-L51

A progress monitor needs to be passed in to correctly resolve secondary types.

@@ -36,12 +38,17 @@
*/
public class PropertiesManagerLocationTest extends BasePropertiesManagerTest {

@BeforeClass
public static void setupTetststs() throws CoreException, Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be a good idea to fix this name (this was my fault, sorry)

- ProjectLabelTest, and PropertiesManagerLocationTest should import all
  test projects initially (@BeforeClass) as now,
  load{Maven,Gradle}Project will clear any previously imported test
  projects
- quarkus-renarde-todo, microprofile-applicationpath,
  scheduler-diagnostic test projects do not need .project/.classpath
  files
- artifactID should match project folder for quarkus-renarde-todo

Signed-off-by: Roland Grunberg <[email protected]>
Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks, Roland!

@datho7561 datho7561 merged commit 349b2b6 into redhat-developer:master Dec 5, 2024
1 check failed
@rgrunber rgrunber deleted the fix-tests branch December 5, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants