You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nascif Abousalh-Neto <Na...@sas.com> on 2005/03/03 00:17:55 UTC

Redundancy on unit test execution

Hi,

I am using maven multiproject tool to build a project which has two subprojects. I have Junit reports in both the top level (through a Dashboard aggregator) and at each project level. I am also using Jcoverage and Checkstyle reports.

I added some automated UI testing using Abbot and started to notice during the Maven run windows that should be activated only once are displayed multiple times. Checking the logs, I found out that the Junit testcases (goal test:test) are being executed FIVE times! 

Isn't there any kind of checking like in the javac compiler to verify the results of a previous run and skip the subsequent calls? For example, the timestamps in the generated xdocs files could be compared with the ones in the generated jar files. 

>From the logs, here is a summary from what activates the testcase execution.

1) First it is called as part of the default Maven execution, just after java:compile
multiproject:site:
build:start:
dist:build-setup:
xdoc:init:
java:prepare-filesystem:
java:compile:
java:jar-resources:
test:prepare-filesystem:
test:test-resources:
test:compile:
test:test:
jar:jar:
site:
xdoc:register-reports:

2) Then there is a run triggered by junit-report:
junit-report:report:
java:prepare-filesystem:
java:compile:
java:jar-resources:
test:prepare-filesystem:
test:test-resources:
test:compile:
test:test:
maven-junit-report-plugin:report:

3) One more for junit-report:
maven-jcoverage-plugin:report:
java:prepare-filesystem:
java:compile:
jcoverage:on:
java:jar-resources:
test:prepare-filesystem:
test:test-resources:
test:compile:
test:test:
jcoverage 1.0.5 copyright (c)2003 jcoverage ltd. http://jcoverage.com/
jcoverage:html-report:

4) Again for the Junit Dashboard aggregator:
    [echo] Generating data for aggregator [junittests]
    [echo] Calling goal [junit-report:report] to generate data...
junit-report:report:
java:prepare-filesystem:
java:compile:
java:jar-resources:
test:prepare-filesystem:
test:test-resources:
test:compile:
test:test:
    [echo] Generating data for aggregator [junitpassrate]

5) And finally one for the Jcoverage aggregator!
    [echo] Generating data for aggregator [jcoveragelipc]
    [echo] Calling goal [maven-jcoverage-plugin:report] to generate data...
maven-jcoverage-plugin:report:
java:prepare-filesystem:
java:compile:
instrumenting the class-files...
jcoverage:on:
java:jar-resources:
test:prepare-filesystem:
test:test-resources:
test:compile:
test:test:
jcoverage 1.0.5 copyright (c)2003 jcoverage ltd. http://jcoverage.com/
jcoverage is licensed under the GNU General Public License
jcoverage comes with ABSOLUTELY NO WARRANTY
Generate report for c:\home\playpen\ips\Products\InventoryReplenishmentPlanning\IrpClient/target/jcoverage/coverage.xml file.
OutputDir = c:/home/bin/apache-2.0.49/Apache2/htdocs/maven/irpclient/jcoverage

Any suggestions on how to address this problem? For a small project is not a big deal for a large one it can seriously affect performance. Can it be addressed with maven.xml hooks or would it require changes in the maven plugins?

Regards,
  Nascif A. Abousalh-Neto


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