Summary: | Write log messages from test to AntUnit's log | ||
---|---|---|---|
Product: | Ant | Reporter: | David Jackman <david.jackman> |
Component: | AntUnit | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 1.0 | ||
Target Milestone: | 1.3 | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: | Patch to implement this feature |
Description
David Jackman
2007-10-09 14:10:41 UTC
Created attachment 20948 [details]
Patch to implement this feature
Makes sense. I normally just run the targets on their own to see the output, but of course, that doesn't work if things behave differently under antunit An extension for this would be to log everything at info on a test failure...this could be good for builds under cruise control and gump, as you get better remote diagnostics (In reply to comment #2) > An extension for this would be to log everything at info on a test > failure...this could be good for builds under cruise control and gump, as you > get better remote diagnostics For this sort of thing, it would be better for the reports generated by the plain and XML listener to include the log output as well. I've written this up as bug 43604. I've faced the use case of somehow getting access to the log output of the project under test before - see http://mail-archives.apache.org/mod_mbox/ant-dev/200708.mbox/%3cy1ufy2u15ao.fsf@v30161.1blu.de%3e I don't really want to modify the AntUnitListener interface, but I can understand if we want to include it in the generated reports (since <junit> does so) on the other hand. Before we go into patch details, can we go back to the dev list and agree on where we want the feature to go? Do you feel this is still required when the listener capture the log output? (In reply to comment #5) > Do you feel this is still required when the listener capture the log output? This has been helpful for us when running the tests manually (to see what's happening in the test as it's happening). Having the listener capture the log output is helpful when the tests are run by an automated process. But you could simply attach a plainListener and have it log to to Ant's logging system. I feel I must be missing something. (In reply to comment #7) > But you could simply attach a plainListener and have it log to to Ant's logging > system. I feel I must be missing something. > With the plainListener I can see the output from the tests after all the tests are run. This change makes it possible for the person running the tests from the command line to see the output of the tests *while they are running*. As you can see from the patch, it writes log messages from the test to the verbose level, so you would only see this output if you add the -verbose option to the command line. (In practice, it would be better to allow some other command line option to specify whether AntUnit writes the log messages from the tests to the Ant log (not on verbose level) because adding the -verbose option always add so much other stuff to the log.) I must admit I still feel this would be too much in the light of plainlistener, maybe we can do a poll or something like this. AntUnit 1.3 will ship with a new listener named logforwarder which forwards the log from the project under test to the one running th test. svn revision 1591967 |