Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336095

Summary: Run unit tests for each I-build
Product: [ECD] Orion Reporter: Tomasz Zarna <tomasz.zarna>
Component: ClientAssignee: Andrew Niefer <aniefer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, john.arthorne
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 335241, 335952    
Bug Blocks: 336096    
Attachments:
Description Flags
error log none

Description Tomasz Zarna CLA 2011-02-02 11:29:10 EST
Since we now produce I-builds on a regular basis, as a next step we could run unit tests for each build. It should include both junits for server as well as javascript tests I guess client side guys are working on.
Comment 1 Andrew Niefer CLA 2011-02-04 17:46:21 EST
The test feature & bundles are now being fetched, built and installed into an orion server in the nightly builds.
The tests are not yet actually being run.
Comment 2 Andrew Niefer CLA 2011-02-07 17:34:36 EST
Created attachment 188484 [details]
error log

I have hooked up the tests to run in the releng builds, however they are failing early with java.lang.NoClassDefFoundError: junit/framework/TestListener

I'm not sure what the problem is.
Comment 3 Andrew Niefer CLA 2011-02-07 18:06:15 EST
We are trying to do
classname=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter
EclipseTestRunner.class.getClassLoader().loadClass(classname);

The EclipseTestRunner.class.getClassLoader() should be the osgi class loader for org.eclipse.test.  This is able to see the required junit.framework.TestListener class.

However, I think that we actually delegate to the org.apache.ant osgi class loader to load XMLJUnitResultFormatter, and that classloader is not able to see junit.framework because ant is not wired to junit.

If this is correct, I'm not sure how the unit tests are supposed to work.
Comment 4 Andrew Niefer CLA 2011-02-08 11:07:36 EST
The problem is that we were missing the org.eclipse.ant.optional.junit fragment which adds the required dependency
Comment 5 Andrew Niefer CLA 2011-02-09 13:56:41 EST
This is done.
We are currently running 
org.eclipse.orion.server.tests.AllServerTests
org.eclipse.orion.server.tests.filesystem.git.AllTests

To add tests to be run, a test bundle just needs to contain a test.xml file though the html build results page will need to be updated to show any additions.
Comment 6 Tomasz Zarna CLA 2011-02-10 05:05:06 EST
Awesome, thanks Andrew.