maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebastian Paul (JIRA)" <j...@codehaus.org>
Subject [jira] (SUREFIRE-1024) "verify" goal ignores "dependenciesToScan" parameter when checking tests existence
Date Thu, 02 Apr 2015 08:49:18 GMT

    [ https://jira.codehaus.org/browse/SUREFIRE-1024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=365994#comment-365994
] 

Sebastian Paul commented on SUREFIRE-1024:
------------------------------------------

Tibor, I was able to reproduce the problem with your provided project, after I changed packaging
to *POM*.

{code}
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pokus 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ pokus ---
[INFO] Deleting D:\Dev\sc\workspace\surefire-1024-works-for-me\project\target
[INFO]
[INFO] --- maven-failsafe-plugin:2.18.1:integration-test (integration-test) @ pokus ---
[INFO] Failsafe report directory: D:\Dev\sc\workspace\surefire-1024-works-for-me\project\target\failsafe-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running a1.A1IT
class a1.A1IT
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.01 sec - in a1.A1IT

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform
dependent! The
 provided by the POM property ${project.reporting.outputEncoding}.
[INFO]
[INFO] --- maven-failsafe-plugin:2.18.1:verify (verify) @ pokus ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.960 s
[INFO] Finished at: 2015-04-02T10:45:24+02:00
[INFO] Final Memory: 8M/155M
[INFO] ------------------------------------------------------------------------
{code}

Verify claims, there were no tests to run.

> "verify" goal ignores "dependenciesToScan" parameter when checking tests existence
> ----------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1024
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-1024
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Failsafe Plugin
>    Affects Versions: 2.16
>            Reporter: Dmitry Kholodilov
>             Fix For: 3.0
>
>         Attachments: surefire-1024-works-for-me.zip, verify_goal_ignores_dependenciesToScan_parameter_when_checking_tests_existence.patch
>
>
> Consider Maven project with packaging=pom that executes tests from some external jar:
> {code:xml}
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>test</groupId>
>     <artifactId>test</artifactId>
>     <version>test</version>
>     <packaging>pom</packaging>
>     <dependencies>
>         <dependency>
>             <groupId>test</groupId>
>             <artifactId>tests-jar</artifactId>
>             <version>1.0</version>
>             <classifier>tests</classifier>
>         </dependency>
>         <dependency>
>             <groupId>org.testng</groupId>
>             <artifactId>testng</artifactId>
>             <version>6.8</version>
>         </dependency>
>     </dependencies>
>     <build>
>                 <plugins>
>                     <plugin>
>                         <artifactId>maven-failsafe-plugin</artifactId>
>                         <version>2.17-SNAPSHOT</version>
>                         <configuration>
>                             <dependenciesToScan>
>                                 <dependency>test:tests-jar</dependency>
>                             </dependenciesToScan>
>                         </configuration>
>                         <executions>
>                             <execution>
>                                 <id>integration-test</id>
>                                 <phase>integration-test</phase>
>                                 <goals>
>                                     <goal>integration-test</goal>
>                                 </goals>
>                             </execution>
>                             <execution>
>                                 <id>verify</id>
>                                 <phase>verify</phase>
>                                 <goals>
>                                     <goal>verify</goal>
>                                 </goals>
>                             </execution>
>                         </executions>
>                     </plugin>
>                 </plugins>
>     </build>
> </project>
> {code}
> (real use case is execution of prebuilt end-to-end tests of some system after its deployment)
> When we run `mvn clean verify` on such project, failsafe plugin's "verify" goal reports
the following:
> {noformat}
> [INFO] --- maven-failsafe-plugin:2.16:verify (verify) @ test ---
> [INFO] No tests to run.
> {noformat}
> Consequently, even if there are test failures, build success is reported.
> The reason of such behavior is that VerifyMojo ignores "dependenciesToScan" parameter.
So, the fix is easy - check its existence along with "testClassesDirectory" existence, the
same way as implemented in AbstractSurefireMojo.
> The patch in attachment includes integration test that checks for build failure when
there is failed test from dependency jar.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Mime
View raw message