You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by rmatthews <rm...@nakedobjects.org> on 2007/10/31 14:06:46 UTC

Finding out what test has failed and why

When I build with Maven it is running the unit test as expected, however if a
test fails then I have no immediate indication why.  If I set printSummary
to false I get no indication whatsoever; when  it is true I get many line
telling me things are OK.  The upshot of it is that I am left to browse
through many text/xml files in the surefire-report directory to find the
problem: this is not very efficient.  The alternative is run create the site
and browse the output, which makes the looking quicker but it takes a long
time to generate the site.

Is there any way to have printed out, only on failures, what has failed and
see the stack trace, ie to have the same facility I have in my IDE?

If that is not possible, how do I get the surefire-report plugin to run
after a test failure (ie during the test phase rather than the site phase.

Many thanks
Robert Matthews
-- 
View this message in context: http://www.nabble.com/Finding-out-what-test-has-failed-and-why-tf4724947s177.html#a13508821
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Finding out what test has failed and why

Posted by Wayne Fay <wa...@gmail.com>.
Two comments:
1. The larger files are always the ones with failures eg 3kb no
failures, 12kb has failures. So you can sort by size and find them
pretty quickly.
2. You can set <useFile>false</> in m-surefire-p configuration and it
will print its output to the command line rather than the files.

Wayne

On 10/31/07, rmatthews <rm...@nakedobjects.org> wrote:
>
> When I build with Maven it is running the unit test as expected, however if a
> test fails then I have no immediate indication why.  If I set printSummary
> to false I get no indication whatsoever; when  it is true I get many line
> telling me things are OK.  The upshot of it is that I am left to browse
> through many text/xml files in the surefire-report directory to find the
> problem: this is not very efficient.  The alternative is run create the site
> and browse the output, which makes the looking quicker but it takes a long
> time to generate the site.
>
> Is there any way to have printed out, only on failures, what has failed and
> see the stack trace, ie to have the same facility I have in my IDE?
>
> If that is not possible, how do I get the surefire-report plugin to run
> after a test failure (ie during the test phase rather than the site phase.
>
> Many thanks
> Robert Matthews
> --
> View this message in context: http://www.nabble.com/Finding-out-what-test-has-failed-and-why-tf4724947s177.html#a13508821
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Finding out what test has failed and why

Posted by rmatthews <rm...@nakedobjects.org>.


Jörg Schaible wrote:
> 
> rmatthews wrote:
>> When I build with Maven it is running the unit test as
>> expected, however if a
>> test fails then I have no immediate indication why.  If I set
>> printSummary to false I get no indication whatsoever; when  it is
>> true I 
>> get many line
>> telling me things are OK.  The upshot of it is that I am left
>> to browse
>> through many text/xml files in the surefire-report directory
>> to find the
>> problem: this is not very efficient.  The alternative is run create
>> the site and browse the output, which makes the looking quicker but
>> it takes a long time to generate the site.
>> 
>> Is there any way to have printed out, only on failures, what
>> has failed and
>> see the stack trace, ie to have the same facility I have in my IDE?
>> 
>> If that is not possible, how do I get the surefire-report
>> plugin to run
>> after a test failure (ie during the test phase rather than
>> the site phase.
>> 
>> Many thanks
>> Robert Matthews
> 
> Set useFile to false.
> 
> - Jörg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 


Thanks for that.  I have just discovered why it is problem.  I have my set
printSummary to false, which the documentation states is an "Option to print
summary of test suites or just print the test cases that has errors", yet
the errors are not listed during output. As shown in the snippet below:-

:
:
[INFO] Compiling 43 source files to
/home/rcm/no-development/nakedobjects_DEV/nof-reflector-core/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory:
/home/rcm/no-development/nakedobjects_DEV/nof-reflector-core/target/surefire-reports
log4j:WARN No appenders could be found for logger
(org.nakedobjects.nof.reflect.help.SimpleHelpManager).
log4j:WARN Please initialize the log4j system properly.
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] There are test failures.

-- 
View this message in context: http://www.nabble.com/Finding-out-what-test-has-failed-and-why-tf4724947s177.html#a13511452
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Finding out what test has failed and why

Posted by Jörg Schaible <Jo...@Elsag-Solutions.com>.
rmatthews wrote:
> When I build with Maven it is running the unit test as
> expected, however if a
> test fails then I have no immediate indication why.  If I set
> printSummary to false I get no indication whatsoever; when  it is
> true I 
> get many line
> telling me things are OK.  The upshot of it is that I am left
> to browse
> through many text/xml files in the surefire-report directory
> to find the
> problem: this is not very efficient.  The alternative is run create
> the site and browse the output, which makes the looking quicker but
> it takes a long time to generate the site.
> 
> Is there any way to have printed out, only on failures, what
> has failed and
> see the stack trace, ie to have the same facility I have in my IDE?
> 
> If that is not possible, how do I get the surefire-report
> plugin to run
> after a test failure (ie during the test phase rather than
> the site phase.
> 
> Many thanks
> Robert Matthews

Set useFile to false.

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org