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

Run some pde.build tests with Tycho #927

Closed

Conversation

mickaelistria
Copy link
Contributor

Missing tests require provisioning the "delta pack" (ie launchers for all Platforms)

Missing tests require provisioning the "delta pack" (ie launchers for
all Platforms)
Copy link

Test Results

   267 files   -        3     267 suites   - 3   46m 19s ⏱️ - 11m 19s
3 442 tests +   115  3 393 ✔️ +     96  35 💤 +5  14 +14 
7 899 runs   - 2 379  7 780 ✔️  - 2 408  81 💤  - 9  38 +38 

For more details on these failures, see this check.

Results for commit 3cd824c. ± Comparison against base commit eeffb96.

@laeubi
Copy link
Contributor

laeubi commented Nov 21, 2023

@mickaelistria from my previous debugging I think that pdebuild want something like we have in product with "include native launcher artifacts", not sure if such an option could be added to p2 installed test framework.

The second thing is, it requires that the "install location" is set and points to the root of the installation that contains the eclipse.exe

@mickaelistria
Copy link
Contributor Author

@laeubi thanks for looking at it. I don't think I'll spend more time on it, my goal was more to demonstrate how such strange cases can be handled and to bootstrap a solution. So if you're willing to continue working on this topic, re-using this patch or not, that would still be welcome.
About delta-pack, I believe that a proper solution is to have a DeltaPackUtils.provisionDeltaPack(File destination) method that would take care of invoking the p2 slicer to populate the destination.

@akurtakov
Copy link
Member

IIRC installing org.eclipse.equinox.executable feature supplies all the different launchers and somewhere in the code it handles that as if delta pack is available. It should have been properly cleaned up but no one really cares about pde.build so it is what it is.

@laeubi
Copy link
Contributor

laeubi commented Nov 21, 2023

@mickaelistria thats already helpful and I'll try to take a look into it later on after the december release, do oyu mind adding the org.eclipse.equinox.executable feature as suggested by @akurtakov ?

@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

I take a look and actually the executable already is included in the p2 installed runtime (I assume the sdk product already pull that in ...) but it explicitly want to find org.eclipse.equinox.executable feature so is not happy with the default eclipse executable in the product itself.

@akurtakov
Copy link
Member

IIRC o.e.equinox.executable contains all arch specific executables and many tests are written with e.g. win32 being hardcoded.

@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

IIRC o.e.equinox.executable contains all arch specific executables and many tests are written with e.g. win32 being hardcoded.

I now was able to supply the build with this "deltapack" that it finds the launcher and bring it down to 9 failures... but it seems it also wants SWT items as well... so it does not only use the executables for test it also uses the generted repo for provision a target in the tests...

@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

and many tests are written with e.g. win32 being hardcoded.

That seems to be the problem for the remaining tests, they want win32 to be "installed" but if running on linux of course this will not happen... so extra requirements don't work... need to find how to trick P2 to still install them...

@iloveeclipse
Copy link
Member

That seems to be the problem for the remaining tests, they want win32 to be "installed"

If that the only issue that prevents other tests to be executed in Jenkins, I see no problem to disable it on non-Windows platforms for now. A proper fix would be even to be platform independent, but I have no idea how much work that would be. Better have more tests immediately as no tests for long time.

@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

If that the only issue that prevents other tests to be executed in Jenkins, I see no problem to disable it on non-Windows platforms for now

That's an interesting idea, I'll push my change and see if it runs on the windows runner already...

A proper fix would be even to be platform independent, but I have no idea how much work that would be

You can take a look at org.eclipse.pde.build.internal.tests.AssembleTests there it uses to build some test artefacts and these contain for example this:

Utils.generateFeature(buildFolder, "sdk", null, new String[] { "org.eclipse.swt;unpack=\"false\"",
"org.eclipse.swt.win32.win32.x86_64;unpack=\"false\";os=\"win32\";ws=\"win32\";arch=\"x86_64\"" });

so at a first glance it seems one needs instead a case for every platform (win/linux/mac) for this to run on different installs.

@laeubi laeubi mentioned this pull request Nov 24, 2023
@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

A quick try with only allow windows as environment failed, seems the P2 installed runtime is missing the fix to use the only defined runtime if it does not match the running target:

Cannot complete the install because one or more required items could not be found.
	Software being installed: Eclipse SDK 4.30.0.I20231123-1700 (org.eclipse.sdk.ide 4.30.0.I20231123-1700)
	Missing requirement for filter properties ~= $0: Equinox p2, headless functionalities 1.7.0.v20231112-1314 (org.eclipse.equinox.p2.core.feature.feature.group 1.7.0.v20231112-1314) requires 'org.eclipse.equinox.p2.iu; org.eclipse.equinox.security.linux [1.1.100.v20231012-1237,1.1.100.v20231012-1237]' but it could not be found
	Cannot satisfy dependency:
		From: Equinox p2, Provisioning for IDEs. 2.4.2200.v20231112-1314 (org.eclipse.equinox.p2.user.ui.feature.group 2.4.2200.v20231112-1314)
		To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.p2.core.feature.feature.group [1.7.0.v20231112-1314,1.7.0.v20231112-1314]
	Cannot satisfy dependency:
		From: Eclipse p2 Provisioning Developer Resources 2.4.2200.v20231112-1314 (org.eclipse.equinox.p2.user.ui.source.feature.group 2.4.2200.v20231112-1314)
		To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.p2.user.ui.feature.group [2.4.2200.v20231112-1314,2.4.2200.v20231112-1314]
	Cannot satisfy dependency:
		From: Eclipse SDK 4.30.0.I20231123-1700 (org.eclipse.sdk.ide 4.30.0.I20231123-1700)
		To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.p2.user.ui.source.feature.group [2.4.2200.v20231112-1314,2.4.2200.v20231112-1314]

I'll check if that can be fixed at Tycho ...

@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

Here we see https://github.com/eclipse-pde/eclipse.pde/runs/18999626168 that there are some test that fail on 2/3 platforms that means they seem to work in windows!

Problem is if we disable them somehow for non windows they wont run on the i-builds as well or we need just another property to set like the p2 one...

@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

Stupid enough some seem to have hardcoded LINUX in their assumptions:

Unable to find plug-in: org.eclipse.swt.gtk.linux.x86_64_0.0.0. Please check the error log for more details.

🤯

@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

And then there are some test that need different platform items... because they want to test some kind of building for another platform maybe (like Tycho supports), so to support this usecase I think one needs a new option in Tycho p2installed runtime to provision additional things...

@mickaelistria
Copy link
Contributor Author

@laeubi Is it OK if I close this one as I see you're making further progress with #933 ?

@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

A quick try with only allow windows as environment failed, seems the P2 installed runtime is missing the fix to use the only defined runtime if it does not match the running target:

Cannot complete the install because one or more required items could not be found.
	Software being installed: Eclipse SDK 4.30.0.I20231123-1700 (org.eclipse.sdk.ide 4.30.0.I20231123-1700)
	Missing requirement for filter properties ~= $0: Equinox p2, headless functionalities 1.7.0.v20231112-1314 (org.eclipse.equinox.p2.core.feature.feature.group 1.7.0.v20231112-1314) requires 'org.eclipse.equinox.p2.iu; org.eclipse.equinox.security.linux [1.1.100.v20231012-1237,1.1.100.v20231012-1237]' but it could not be found
	Cannot satisfy dependency:
		From: Equinox p2, Provisioning for IDEs. 2.4.2200.v20231112-1314 (org.eclipse.equinox.p2.user.ui.feature.group 2.4.2200.v20231112-1314)
		To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.p2.core.feature.feature.group [1.7.0.v20231112-1314,1.7.0.v20231112-1314]
	Cannot satisfy dependency:
		From: Eclipse p2 Provisioning Developer Resources 2.4.2200.v20231112-1314 (org.eclipse.equinox.p2.user.ui.source.feature.group 2.4.2200.v20231112-1314)
		To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.p2.user.ui.feature.group [2.4.2200.v20231112-1314,2.4.2200.v20231112-1314]
	Cannot satisfy dependency:
		From: Eclipse SDK 4.30.0.I20231123-1700 (org.eclipse.sdk.ide 4.30.0.I20231123-1700)
		To: org.eclipse.equinox.p2.iu; org.eclipse.equinox.p2.user.ui.source.feature.group [2.4.2200.v20231112-1314,2.4.2200.v20231112-1314]

I'll check if that can be fixed at Tycho ...

This will be addressed with

even though it does not help here...

@laeubi
Copy link
Contributor

laeubi commented Nov 24, 2023

@laeubi Is it OK if I close this one as I see you're making further progress with #933 ?

I think we can leave it open as most discussions have taken place here until we found a final solution.

@laeubi
Copy link
Contributor

laeubi commented Nov 25, 2023

With this change I'm now able to run all test except one that is failing as it now gets more content than expected

I'll disable that test for verification builds maybe one more familiar with PDE builds (@iloveeclipse) is then able to make that test work in both scenarios... The test in question is org.eclipse.pde.build.internal.tests.ScriptGenerationTests.testBug238177() what has very strict requirements on number and order of ant targets and seem to return one target more when executed with the p2 provisioned install that is used as a target platform.

@laeubi
Copy link
Contributor

laeubi commented Nov 25, 2023

So to summarize my findings here:

  • pde tests is using p2 in test.xml to build a special local "updatesite"
  • this is then used in some test as a target platform to resolve stuff
  • the util method for that is searching for the launcher and then assume this is location where plugins folder exits to resolve more stuff including multiple plugins for multiple target platforms

Currently we "fake" this with the following workarounds:

  1. Install the equinox launcher feature that make the Util method think the "deltapack" is the eclipse running the test
  2. Install additional target environments so afterwards they are found in the plugin folders

So the best actually would be to rewrite the test so they use for example a release repository or even the ibuilds repository and then simply setup a target platform that provide in what is desired, this would make the test easier to run in different environments and not rely on ant/tycho special setups.

Just in case one want to look into this, a good start is org.eclipse.pde.build.internal.tests.Utils.findExecutable() all test calling this effectively later do a

if (!executable.equals(new File((String) properties.get("baseLocation"))))
			properties.put("pluginPath", executable.getAbsolutePath());

to set a plugin path that is then later passed to the ant build scripts and from there passed as an additional path to the targets to search for stuff...

@HannesWell
Copy link
Member

I think this is included in #980 and thus can be closed.
Nevertheless thanks for this work.

@HannesWell HannesWell closed this Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants