Discussion:
[tycho-user] run integration tests against multiple target platforms
Moritz Eysholdt
2014-06-02 12:55:26 UTC
Permalink
Hi,

I’m developing Eclipse plugins that are expected with work with a variety of Eclipse versions and a variety of versions of other plugins. Therefore I have several target platforms and my integration tests are expected to pass no matter which of my target platforms I use.

I’d like to find a maven/tycho setup that
- allows me to build and install all my plugins using a base-target-platform. I got this working without problems.
- allows me to run the JUnit tests from the already-installed bundles agains variety of other target platforms. This is what I need your advice for.

I’d like to use only one specific target platform for compilation (I called it the base-target-platform above). All other target platforms should be used for tests execution only. This way I’m hoping to detect API incompatibilities on binary level and avoid unnecessary compilation times.

I managed to use maven profiles to make target platforms interchangeable, but I’m unsatisfied with it because
- it doesn’t allow me to have separate platforms for test-compilation and test-execution
- it doesn’t allow me to test against all target platforms during a single execution of the build.

So… can Tycho find and run JUnit tests from an already-installed bundle?

regards,
Moritz
Mickael Istria
2014-06-02 13:07:18 UTC
Permalink
I’d like to use only one specific target platform for compilation (I called it the base-target-platform above). All other target platforms should be used for tests execution only. This way I’m hoping to detect API incompatibilities on binary level and avoid unnecessary compilation times.
I managed to use maven profiles to make target platforms interchangeable, but I’m unsatisfied with it because
- it doesn’t allow me to have separate platforms for test-compilation and test-execution
- it doesn’t allow me to test against all target platforms during a single execution of the build.
So… can Tycho find and run JUnit tests from an already-installed bundle?
What you're asking seems impossible right now. However, this can easily
be worked-around by starting sequentially several reactors:
$ cd bundles
$ mvn clean install -DtargetPlatform=api
# This will install bundles in your local Maven repo
$ cd ../tests
$ mvn clean verify -DtargetPlatform=runtime1
# This will most likely consume the bundles that you just installed
in your local Maven repo
$ mvn clean verify -DtargetPlatform=runtime2
...

The only glitch is that in some circumstances, p2 wll not select the
bundle that is is your local Maven repo:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=418546

HTH
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets
<http://twitter.com/mickaelistria>
Andreas Sewe
2014-06-06 07:33:28 UTC
Permalink
Hi Moritz,
Post by Moritz Eysholdt
I managed to use maven profiles to make target platforms interchangeable, but I’m unsatisfied with it because
- it doesn’t allow me to have separate platforms for test-compilation and test-execution
- it doesn’t allow me to test against all target platforms during a single execution of the build.
So… can Tycho find and run JUnit tests from an already-installed bundle?
maybe the maven-invoker-plugin [1] fits your bill? Normally, it builds
dedicated integration test projects in fresh reactors, but I think you
can shoehorn it into building the current project multiple times in
fresh reactors, each time with a different target platform set.
Previously compiled and installed projects could be re-used by setting
localRepositoryPath [2] accordingly. You just need to take care to stop
before the install phase (verify being the obvious choice), so that the
extra builds don't install stuff into your local repo.

I hope this helps as a first pointer to a solution that *might* work,
*if* you want a solution that's completely internal to Maven. If you can
afford to kick of multiple builds, why not do

mvn clean install
mvn clean verify -pl :your.test.project -DtargetPlaform=runtime1
mvn clean verify -pl :your.test.project -DtargetPlaform=runtime2

This should avoid recompiling everything except for your.test.project at
least.

Hope this helps.

Andreas

[1] <http://maven.apache.org/plugins/maven-invoker-plugin/>
[2]
<http://maven.apache.org/plugins/maven-invoker-plugin/integration-test-mojo.html#localRepositoryPath>
--
Codetrails UG (haftungsbeschränkt)
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940
Loading...