You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by nikgupta <ni...@gmail.com> on 2008/11/09 16:26:47 UTC
Stop Clover re-running tests if they've already run
I want that my test cases should run only once.
Right now the test cases run once for sure-fire and then for clover.
I have tried some things :
This is the project's pom
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.2</version>
<configuration>
<skip>true</skip>
<forkMode>none</forkMode>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<reportsDirectory>${pom.basedir}/target/reports/surefire</reportsDirectory>
</configuration>
<executions>
<execution>
<id>it</id>
<phase>test</phase>
<goals>
<goal name="test">test</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
This is the child pom (core's pom)
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<configuration>
<licenseLocation>${pom.basedir}/src/test/resources/clover.license</licenseLocation>
<targetPercentage>${build.tests.code.coverage.percentage}</targetPercentage>
<outputDirectory>${pom.basedir}/target/reports/clover</outputDirectory>
<contextFilters>@deprecated</contextFilters>
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>instrument</goal>
<goal>clover</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
Now after doing this when the test case run for sure-fire they are skipped.
And when the clover plugin runs it calls the sure-fire plugin with the
execution goal id as 'it' .This works fine
now when the clover has generated the clover.db , it again run the sure-fire
plugin with the execution goal with id as 'it'. Now i don;t wont this plugin
to be executed again.
Is there a way by which this execution with 'id' gets exectued only once. Or
is there a way by which i can check if the clover.db is generated so the
test cases should not get executed.
Please let me know if there is some way.
--
View this message in context: http://www.nabble.com/Stop-Clover-re-running-tests-if-they%27ve-already-run-tp20407359p20407359.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: Stop Clover re-running tests if they've already run
Posted by Martin Gainty <mg...@hotmail.com>.
Most implementations I've seen create a pid file (with the 4 digit pid in the work folder)
if the pid is not there <re>run the task
FWIW
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.
> Date: Sun, 9 Nov 2008 07:26:47 -0800
> From: nikgupta@gmail.com
> To: users@maven.apache.org
> Subject: Stop Clover re-running tests if they've already run
>
>
> I want that my test cases should run only once.
> Right now the test cases run once for sure-fire and then for clover.
>
> I have tried some things :
>
> This is the project's pom
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>2.2</version>
> <configuration>
> <skip>true</skip>
> <forkMode>none</forkMode>
> <suiteXmlFiles>
>
> <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
> </suiteXmlFiles>
>
> <reportsDirectory>${pom.basedir}/target/reports/surefire</reportsDirectory>
> </configuration>
> <executions>
> <execution>
> <id>it</id>
> <phase>test</phase>
> <goals>
> <goal name="test">test</goal>
> </goals>
> <configuration>
> <skip>true</skip>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
>
> This is the child pom (core's pom)
> <plugin>
> <groupId>com.atlassian.maven.plugins</groupId>
> <artifactId>maven-clover2-plugin</artifactId>
> <configuration>
>
> <licenseLocation>${pom.basedir}/src/test/resources/clover.license</licenseLocation>
>
> <targetPercentage>${build.tests.code.coverage.percentage}</targetPercentage>
>
> <outputDirectory>${pom.basedir}/target/reports/clover</outputDirectory>
> <contextFilters>@deprecated</contextFilters>
> </configuration>
> <executions>
> <execution>
> <phase>test</phase>
> <goals>
> <goal>instrument</goal>
> <goal>clover</goal>
> <goal>check</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>
> Now after doing this when the test case run for sure-fire they are skipped.
> And when the clover plugin runs it calls the sure-fire plugin with the
> execution goal id as 'it' .This works fine
>
> now when the clover has generated the clover.db , it again run the sure-fire
> plugin with the execution goal with id as 'it'. Now i don;t wont this plugin
> to be executed again.
>
> Is there a way by which this execution with 'id' gets exectued only once. Or
> is there a way by which i can check if the clover.db is generated so the
> test cases should not get executed.
>
> Please let me know if there is some way.
> --
> View this message in context: http://www.nabble.com/Stop-Clover-re-running-tests-if-they%27ve-already-run-tp20407359p20407359.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
>
_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live
http://clk.atdmt.com/MRT/go/119462413/direct/01/