OpenLiberty / liberty-tools-intellij

IntelliJ IDEA extension for Liberty
https://plugins.jetbrains.com/plugin/14856-open-liberty-tools
Eclipse Public License 2.0
13 stars 26 forks source link

Intellij 2024.2: Investigating unit test failure for 2024.2 intellij version #1048

Open staicy123 opened 2 weeks ago

staicy123 commented 2 weeks ago

After making changes in build.gradle file for supporting intellij 2024.2. When running the unit test for intellij 2024.2. The build is neither getting failed nor terminated for a long time. The termination takes more than 10 minutes. The same tests works fine for intellij 2024.1 version. Logs: log.txt

vaisakhkannan commented 2 weeks ago

Link to the Jetbrains Slack discussion : https://jetbrains-platform.slack.com/archives/C5U8BM1MK/p1729576853003949

vaisakhkannan commented 1 week ago

Link to the latest Jetbrains Slack discussion : https://jetbrains-platform.slack.com/archives/C5U8BM1MK/p1730119000848479?thread_ts=1730105939.390899&cid=C5U8BM1MK

staicy123 commented 6 days ago

Hi @TrevCraw,

I would like to provide a detailed explanation of this issue. Based on the analysis, I found that the test fails when it reaches this method. Please find the relevant code and logs attached below.

Screenshot 2024-10-30 at 12 33 18 PM Screenshot 2024-10-30 at 12 34 39 PM

Through discussions in the JetBrains Slack channel, it became clear that the issue is caused by a transitive dependency on kotlinx-coroutines. JetBrains provides a testFramework() dependency helper that might resolve this issue.

The testFramework(TestFrameworkType.Platform), testFramework(TestFrameworkType.Plugin.Maven), and similar configurations – when applied – add dependencies on the requested library version closest to your IntelliJ Platform version. They also exclude transitive dependencies already present in the IntelliJ Platform archive, including coroutines.

If you add a dependency on testFramework directly using testImplementation, it will include all transitive dependencies. Disabling transitive dependencies manually (using transitive = false) won’t work, as some dependencies are actually required. That’s why the testFramework helper exists.

I removed the manual Maven dependency for testFramework and implemented the suggested helper framework for Maven. However, kotlinx-coroutines is still appearing as a dependency in our project. When I reported this to the JetBrains team, they confirmed it’s a bug on their end and plan to address it in the next release. I’ve created an issue to track this. https://youtrack.jetbrains.com/issue/IJSDK-2276/Even-after-adding-testFrameworktype-helper-could-still-see-coroutines-in-transitive-dependencies-hence-unit-test-failing

On further request, created issue in intellij-platform-gradle-plugin Github. https://github.com/JetBrains/intellij-platform-gradle-plugin/issues/1817

Please find the Slack conversation attached here: https://jetbrains-platform.slack.com/archives/C5U8BM1MK/p1730105939390899

They also confirmed that they will try to fix at the earliest

Thanks

staicy123 commented 3 days ago

Hi @TrevCraw,

Update on the Issue:

As of today, we tested the snapshot version provided by the team on Friday evening. They attempted to fix the issue, but we confirmed that the problem still persists, and we are unable to run the unit tests using version 2024.2.

On their request, I shared the GitHub link where we are making changes to support version 2024.2 and am currently waiting for their reply.

Analysis:

From my findings, it appears that the kotlinx dependency has been removed in the new version. Our tests are still expecting this dependency to run successfully. I'm not entirely sure about this observation, but I would appreciate any contributions or insights from your end if you have any information on this matter.

Thanks

TrevCraw commented 3 days ago

Hi @staicy123 , I don't have any more insight into this. I think we need to continue to communicate with the JetBrains team and see what new information we get from them.

vaisakhkannan commented 1 day ago

Based on Jetbrains Replay

I see you have

platformBundledPlugins=com.intellij.java, org.jetbrains.idea.maven, com.intellij.gradle, org.jetbrains.plugins.terminal, com.intellij.properties

Currently, Intellij Gradle plugin 2.1.0 has an issue with loading all required bundled modules when targeting 2024.2

The final 2.2.0 will handle that properly (I’m still waiting for Plugin Verifier libraries to be fixed)

NOTE: So we need to wait for the version 2.2.0 and then need to test this unit test failure issue