-
Notifications
You must be signed in to change notification settings - Fork 194
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
Add IT to reproduce missing launcher #3442
base: main
Are you sure you want to change the base?
Add IT to reproduce missing launcher #3442
Conversation
9f6b12b
to
b2cc639
Compare
b2cc639
to
7c183f2
Compare
@henryju thanks for the example I have looked into it but the problem lies a bit deeper, I could manage it to have the launcher included but then the runtime can't startup because some bundles need to be started... without P2 we emulate this and setup everything but with a P2 install this is not done and usually a bit hard to guess because if there is a product used one for sure want to have its settings used. One option would be to allow specify a product, another that we have some flag that tells if the p2 provisioned should contain some usual defaults or we require the user to setup things manually (and just enhance the documentation) As you have brought up this usecase I wonder if you have any preferences here? |
Here is an example how to publish a product (what can even be almost empty): that the can be used later on here: would that be suitable for you? Do you want to enhance your testcase and the documentation here: to describe the way to use p2installed runtime? |
Is what you are suggesting already doable with Tycho 4.0.5? I tried to define a dummy product in my test project:
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="A product to define the runtime of the tests" uid="org.sonarlint.eclipse.tests.product" id="org.eclipse.sdk.ide" application="org.eclipse.ui.ide.workbench" version="1" type="features" includeLaunchers="true" autoIncludeRequirements="true">
<configIni use="">
</configIni>
<plugins>
</plugins>
<configurations>
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>
</product> Then use this product for tests:
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<product>org.sonarlint.eclipse.tests.product</product>
<testRuntime>p2Installed</testRuntime>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-publisher-plugin</artifactId>
<executions>
<execution>
<id>publish-products-for-tests</id>
<goals>
<goal>publish-products</goal>
</goals>
<phase>pre-integration-test</phase>
</execution>
</executions>
</plugin>
</plugins>
</build> But this is failing with error:
I tried to follow the hint and added For the record, my target platform file now looks like: <target name="sonarlint-eclipse-build" sequenceNumber="6">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.cdt.feature.group" version="0.0.0"/>
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
<unit id="org.eclipse.m2e.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.platform.ide" version="0.0.0"/>
<unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<!-- Needed for test environment -->
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/releases/2022-06/"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
</target> |
You need to use the current tycho snapshot build (but it will be released soon). |
I was able to make things work using the latest Tycho release. Thanks. I will try to contribute IT and documentation as you suggested, but I am off next week so this might only come later. |
Follow up of #3440