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

Failure in LibertyPluginSWTBotGradleTest.testDashboardDebugWithCustomConfigAction - widget not found #433

Open
scottkurz opened this issue Sep 11, 2023 · 2 comments
Labels

Comments

@scottkurz
Copy link
Member

2023-09-08T19:44:40.2947775Z java.lang.RuntimeException: Unable to locate widget: Start parameters:
2023-09-08T19:44:40.2948419Z at io.openliberty.tools.eclipse.test.it.utils.MagicWidgetFinder.find(MagicWidgetFinder.java:1054)
2023-09-08T19:44:40.2949294Z at io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.setCustomStartParmsFromShell(SWTBotPluginOperations.java:541)
2023-09-08T19:44:40.2950363Z at io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.launchCustomDebugFromDashboard(SWTBotPluginOperations.java:523)
2023-09-08T19:44:40.2951532Z at io.openliberty.tools.eclipse.test.it.LibertyPluginSWTBotGradleTest.testDashboardDebugWithCustomConfigAction(LibertyPluginSWTBotGradleTest.java:428)

This failure was introduced by an earlier version of #428. It seemed to occur consistently on Linux in particular.

We decided to workaround the failure by configuring the tests to run in alphabetical order. Our guess is that the way to understand this fact is that the error is provoked by runningthe LibertyPluginSWTBotMavenTest tests before the LibertyPluginSWTBotGradleTest tests, and worked around when these are run in the opposite relative order, such that the Gradle tests are run first (it's conceivable there are other complicating factors, including possibly the other test classes).

Opening this issue to follow up on the failure, to understand it better. This will hopefully help us more generally under these SWTBot tests. It's not that running the tests in a predictable alphabetical order is necessarily bad, but we'd like to understand the failure while it's happening consistently, (as it was when merging the PR on top of the HEAD of 2fb4b6b).

@scottkurz
Copy link
Member Author

scottkurz commented Sep 18, 2023

After debugging more, there are a few angles to pursue here:

  • 1. How to prevent the immediate problem by cleaning up better
  • 2. Understanding better how this is happening via leftover debug configs
  • 3. How to record video to get a head start on this and other similar problems in the future.

1.

we may simply need to do something like #440 to delete Remote Java App debug configs, not just Liberty Tools debug configs, before a new test. (Note at the moment this PR has some other commits to provoke failures which would need to be removed before merge.)

2.

I would like to understand better if the "find" behavior is determined in a straightforward way based on an earlier debug config, or if the "find" behavior is in fact different on the different envs (platform, etc). That is, if there's a leftover Remote Java App 'app' debug/run config, will the LT debug config ALWAYS get created as 'app(1)' and thus NEVER found in the following find (...'app')... command? This will help us understand how predictable the MWF usage will be, in general.

3.

While the path is well laid-out for us, to a point, by the LTI https://github.com/OpenLiberty/liberty-tools-intellij/ GHA config, there is a problem with LTE. The problem is that the relevant libraries are not already very OSGi-friendly, they do not include bundle manifests. At the moment, the config is done with the help of the org.aeonbits.owner, org.aeonbits.owner-java8 modules. Though Tycho can generate bundle manifests it doesn't generate in such a way that the "split" package can be accessed across both.

So the doc here: https://automation-remarks.com/video-recorder-java/ does not work w/o modification.

As a POC, I hacked togther both the 'aeonbits' packages into a single bundle and replaced these in my local Maven repo. This got the video generated. (Note, I used the VLC media player, on Android, to view the generated videos).

My next effort is to try to write my own extension that provides its own config, so that the aeonbits libs are not needed, from within the LTE test env. (Work in progress: https://github.com/scottkurz/liberty-tools-eclipse/tree/lte-video)

@awisniew90
Copy link
Contributor

I may have gotten to the same conclusion (aeonbits bundle issue) but from a different angle...

There are two main dependencies that are needed from the com.automation-remarks video recorder libraries:

  1. video-recorder-junit5
  2. video-recorder-core (used by junit5^)

These dependencies can be added to the target platform file like so:

<location includeDependencyDepth="none" includeDependencyScopes="compile" missingManifest="generate" type="Maven"> <dependencies> <dependency> <groupId>com.automation-remarks</groupId> <artifactId>video-recorder-junit5</artifactId> <version>2.0</version> <type>jar</type> </dependency> </dependencies> </location>

and tycho will generate a manifest for them and bundle them into bundles with the prefix "wrapped" added. e.g. "wrapped.com.automation-remarks.video-recorder-junit5"

In trying to recreate Scott's issue with aeobits bundling, I first simplified things and tried to bundle these two dependencies separately. Each had "none" specified in the target platform file for "dependency depth" which means "dont try to bundle any direct or transitive dependencies". I found that the dialog window in Eclipse for the target-platform file was showing an error that video-recorder-core could not be bundles, but this seems benign as the logs for a maven install are showing the bundle being generated. However, the junit5 bundle could only find classes in the core bundle if the core bundle (with "wrapped" prefix) was added as a "Required-Bundle" in our test projects Manifest file.

The latest issue is that the core bundle cannot find a class in the aeonbits dependency library:

Caused by: java.lang.ClassNotFoundException: org.aeonbits.owner.ConfigFactory cannot be found by wrapped.com.automation-remarks.video-recorder-core_2.0.0

I then added the com.aeonbits.owner dependency to the target platform, but the bundle does not seem to be generated and no manifest is created as is done for the other dependencies. e.g. for video-recorder-junit5:

[INFO] com.automation-remarks:video-recorder-junit5:2.0 is wrapped as a bundle with bundle symbolic name wrapped.com.automation-remarks.video-recorder-junit5 [INFO] The artifact can be referenced in feature files with the following data: <plugin id="wrapped.com.automation-remarks.video-recorder-junit5" version=" 2.0" download-size="0" install-size="0" unpack="false"/> [DEBUG] The following manifest was generated for this artifact: Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Created-By: 17.0.6 (IBM Corporation) Tool: Bnd-6.3.1.202206071316 Bnd-LastModified: 1707155912321 Export-Package: com.automation.remarks.junit5;version=" 2.0";uses:="com. automation.remarks.video.annotations,org.junit.jupiter.api.extension" Import-Package: com.automation.remarks.video;resolution:=optional,com.au tomation.remarks.video.annotations;resolution:=optional,com.automation. remarks.video.enums;resolution:=optional,com.automation.remarks.video.r ecorder;resolution:=optional,org.junit.jupiter.api.extension;resolution :=optional,org.junit.platform.commons.util;resolution:=optional DynamicImport-Package: * Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" Bundle-Name: Bundle derived from maven artifact com.automation-remarks:v ideo-recorder-junit5:2.0 Bundle-Version: 2.0 Bundle-SymbolicName: wrapped.com.automation-remarks.video-recorder-junit 5

I have yet to debug why the aeobits dependency is not being bundled. no obvious errors are shown. This could perhaps be the same issue Scott saw, but given that this is not bundling two dependencies together it seems it may be a different issue. getting past could potentially make this work.

Changes are here: https://github.com/awisniew90/liberty-tools-eclipse/tree/video-recorder

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

No branches or pull requests

2 participants