0
votes

I wrote some Junit tests for my eclipse plugin. If I start my test suite as a "JUnit Plug-in Test" from Eclipse, everything is working fine. Now I want to run them from Maven Tycho.

So I put the following packaging : "eclipse-test-plugin", in the pom.xml and the integration tests start with a "mvn clean integration-test". So I think my maven configuration is quite OK.

But some tests are failing, and I suspect the headless build can't detect the IMarkers my tests are trying to detect, since IMarkers are UI components.

Am I right? Any idea to get my tests based on IMarkers running with Tycho?

1
It would be good if you could provide the error you are getting from the failed tests. I have found that looking the [timestamp].log file under target/work/configuration folder is often a good starting point - Patrick Roumanoff

1 Answers

1
votes

You need to tell test plugin that you want to run the test with a UI, by default it will run with the headless runner.

<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>tycho-surefire-plugin</artifactId>
  <configuration>
    <useUIHarness>true</useUIHarness>
    <useUIThread>true</useUIThread>
  </configuration>
</plugin>