HOWTO: Capture Headless JUnit Console Logs
If you run more than one automated JUnit test suite during your build, it can at times be difficult to ascertain why a suite failed. You can of course run the tests locally, but if your local environment is not identical to the build/test environment (eg., your build server is virtual and its X server is actually just a framebuffer), you may not see the same problem, especially with UI tests.
To capture the console logs for each independent test suite (.metadata/.log from the test’s workspace), you can edit the cleanup target of each test plugin’s test.xml. Make sure that ${classname} is defined, too.
<target name="cleanup">
<mkdir dir="${results}/consolelogs"/>
<copy failonerror="false"
file="${eclipse-home}/results/${classname}.txt"
tofile="${results}/consolelogs/${classname}_${platform}.metadata.log.txt" />
</target>
Now, after your tests run, you’ll get one more log file (for each test.xml you change) in your build folder’s testresults/consolelogs/ folder.
For other PDE Build testing tips, see Modeling Project Testing Problem FAQ.
Posted April 14th, 2008 by in category: ant, build, testing
You can skip to the end and leave a response. Pinging is currently not allowed.
Leave a Reply
You must be logged in using your Eclipse Bugzilla account to post a comment.

