Bug 206879 - [JUnit] Optionally import test results after completed ANT job
Summary: [JUnit] Optionally import test results after completed ANT job
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-19 08:32 EDT by Johan Walles CLA
Modified: 2007-10-19 10:54 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Walles CLA 2007-10-19 08:32:55 EDT
Build ID: M20070921-1145

This is a spinoff from bug 206750.  Thanks to Markus Keller for most of the below instructions.

1. run junit ant task with
                <junit printsummary="yes">
                        <formatter type="xml"/>
                        ...

2. create a summary:
                <junitreport todir="${result}">
                        <fileset dir="${result}">
                                <include name="TEST-*.xml"/>
                        </fileset>
                </junitreport>

Current results:
Test results summary is created by ANT.  Nothing more happens.

Expected results:
Test results summary is created by ANT.  Eclipse finds the test results and automatically pops up its JUnit test results UI, just as if you had done:
"
3. in JUnit view, open the menu on the 'Test Run History' button, choose
Import..., and select the generated TEST-yourTest.xml or TESTS-TestSuites.xml
file.
"

Note:
I wouldn't mind having to fill in something in the Eclipse ANT job description for this to work.  Checking a box and telling Eclipse which file it should import after running the tests would be fine.
Comment 1 Markus Keller CLA 2007-10-19 09:47:49 EDT
> I wouldn't mind having to fill in something in the Eclipse ANT job description
> for this to work.  Checking a box and telling Eclipse which file it should
> import after running the tests would be fine.

The difficult part is where to put this option. Ant build launch configurations can be used for anything, and we can't pollute all Ant launch config dialogs with a rarely-used JUnit tab.

A way out could be a general "Open this file after the Ant build" facility (e.g. on the Refresh) tab, and JDT/JUnit registering an IEditorLauncher that opens test result files in the JUnit view.
Comment 2 Johan Walles CLA 2007-10-19 10:54:43 EDT
I really don't know how Eclipse works so this might be the worst idea ever, but how about having the JUnit UI behave like an editor:

0. I run my JUnit tests through ANT once.

1. I load the test results file into the JUnit UI.

2. I run my JUnit tests through ANT once more.

3. The JUnit UI notices that the file it loaded has changed on disk, and reads it again.