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 2008/05/14 16:50:54 UTC

Getting to the failed tests quickly

Hi

I am using surefire to run our unit tests.  All goes well until a test fails
then I have to do some major seaching to find the problem.  The problem is
that there are loads of files created for the set of tests (one per class)
and no indication of which file I should look in.

I have turned off the summary to cut down the amount of console output - it
tells me about all the tests that pass - whereas I am only interested in
what has failed. 

My configuration is as follows (within the build section):

  <plugin>
  	<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.4.2</version>
  	<configuration>
  			<excludes>
  					<exclude>**/Test*.java</exclude>
  			</excludes>
  			<useFile>true</useFile> 
  			<printSummary>false</printSummary>
  		
<outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
  	</configuration>
  </plugin>

The output shows me:

  [INFO] [surefire:test]
  [INFO] Surefire report directory:
C:\no-development\nakedobjects_DEV_3.1\nof-core\target\surefire-reports
  [INFO]
------------------------------------------------------------------------
  [ERROR] BUILD FAILURE
  [INFO]
------------------------------------------------------------------------
  [INFO] There are test failures.
  
  Please refer to
C:\no-development\nakedobjects_DEV_3.1\nof-core\target\surefire-reports for
the individual test results.

At which point I am left with a couple dozen files to trawl through to find
the problem.

Is there a way: a) to display on the console the failing tests only; or b)
to combine all report files into one so that I can simply open one file and
see all the problems.

Many thanks
Robert Matthews


-- 
View this message in context: http://www.nabble.com/Getting-to-the-failed-tests-quickly-tp17232976p17232976.html
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: Getting to the failed tests quickly

Posted by Brian Fox <br...@reply.infinity.nu>.
You can also use -Dsurefile.useFile=false to output the error to  
stdout. I do this in Hudson also so that the emails contain the error.


--Brian

On May 14, 2008, at 12:39 PM, "Adam Hardy" <adam.maven@cyberspaceroad.com 
 > wrote:

> Wayne Fay on 14/05/08 16:03, wrote:
> >> I am using surefire to run our unit tests.  All goes well until a  
> test fails
> >> then I have to do some major seaching to find the problem.  The  
> problem is
> >> that there are loads of files created for the set of tests (one  
> per class)
> >> and no indication of which file I should look in.
> >
> > If you simply sort the output files by size (in a file manager
> > interface or simply CLI), you will notice the successful tests will
> > all be a particular file size (within a range, but the files are
> > small) and then the failing tests are double that size or larger.
>
> I just run site in continuum and look at the report -
>
> or if you are cmd line-oriented, just cat the appropriate
> target/surefire-reports/TEXT-com.mycompany.package.Test.xml
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Getting to the failed tests quickly

Posted by Adam Hardy <ad...@cyberspaceroad.com>.
Wayne Fay on 14/05/08 16:03, wrote:
>> I am using surefire to run our unit tests.  All goes well until a test fails
>> then I have to do some major seaching to find the problem.  The problem is
>> that there are loads of files created for the set of tests (one per class)
>> and no indication of which file I should look in.
> 
> If you simply sort the output files by size (in a file manager
> interface or simply CLI), you will notice the successful tests will
> all be a particular file size (within a range, but the files are
> small) and then the failing tests are double that size or larger.

I just run site in continuum and look at the report -

or if you are cmd line-oriented, just cat the appropriate 
target/surefire-reports/TEXT-com.mycompany.package.Test.xml



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


Re: Getting to the failed tests quickly

Posted by Wayne Fay <wa...@gmail.com>.
> I am using surefire to run our unit tests.  All goes well until a test fails
> then I have to do some major seaching to find the problem.  The problem is
> that there are loads of files created for the set of tests (one per class)
> and no indication of which file I should look in.

If you simply sort the output files by size (in a file manager
interface or simply CLI), you will notice the successful tests will
all be a particular file size (within a range, but the files are
small) and then the failing tests are double that size or larger.

Wayne

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