Orion/How Tos/How To Run Releng JUnits
The Orion build runs JUnit server tests during the releng build. Sometimes these tests fail and it is hard to reproduce the failures locally in your Eclipse workspace due to setup differences.
This page outlines how to download and re-run the last build's junit tests locally with the same scripts that ran the tests during the build.
See the "Getting the Source" page for details on getting the Orion source into your Eclipse workspace. In particular, you need the org.eclipse.orion.releng project. This project contains a launch configuration named "Run Orion Releng Tests".
The Releng Tests Launch Configuration
- -DbuildType=N : The build type should be set to either "N" or "I" to test the last nightly or integration build.
- -DrunTestsLocally=true : This same script is used to build and run the tests for real in the releng build, this property tells the script that we just want to download and re-run the last build's tests.
Running this launch config will download the latest build and test bundles and run them. This will be testing the results of the releng build, not the content of your workspace. By default, a folder org.eclipse.orion.releng/build/test will be created to contain the tests. The Orion server from the last build will be installed here and run. To change the location where the server and tests will be installed, add a path to the launch config using:
To test an earlier build instead of the most recent, add the following with an appropriate build Id:
The results of the junit tests will appear under org.eclipse.orion.releng/build/test/eclipse/results. The resulting xml files can be opened and viewed using the JUnit view.
Debugging the Tests
When running the tests this way, a second java process will be started by the test scripts. In order to debug you will need to set vm arguments for that test process. In the "Run Orion Releng Tests" launch configuration, add the following Program Argument which specifies vm arguments to use in the forked test processs.
-Dvmargs="-Xms40m -Xmx384m -XX:MaxPermSize=256m -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
(The -XX:MaxPermSize=256m should only be added if you are running on a Sun VM).
Once the test script reaches the point where it starts the test:
init: core-test: java-test: [echo] Running org.eclipse.orion.server.tests.AllServerTests. Result file: /eclipse/git/web/org.eclipse.orion.server/releng/org.eclipse.orion.releng/builder/scripts/../../build/test/eclipse/results/org.eclipse.orion.server.tests.AllServerTests.xml.
Then you can set your breakpoints and start a second Remote Java Application launch configuration on localhost port 8000: