maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eddie Webb (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SUREFIRE-1615) surefire.includesProperty is ignored
Date Fri, 14 Dec 2018 01:45:00 GMT

    [ https://issues.apache.org/jira/browse/SUREFIRE-1615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16720811#comment-16720811
] 

Eddie Webb edited comment on SUREFIRE-1615 at 12/14/18 1:44 AM:
----------------------------------------------------------------

I pulled the code and debug a little, it actually _does_ read the file, but when it calls
getIncludes() it adds additional entries from somewhere, I suspect a parent in the framework
I am using (spring boot)
 [https://github.com/apache/maven-surefire/blob/d86d649181ded89c440e0440659938f1c71c9dcc/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java#L2000]

array grows from my single entry to total 3
{code:java}
#log output I added around line 200
>>>> Before "maybeAppend"
java.util.ArrayList@12e0f1cb[size=1]
>>>> After
[Ljava.lang.Object;@118ffcfd[{**/*IT*,**/*Tests.java,**/*Test.java}]{code}
 
h3. h3. Workaround

In case other folks see this curious behavior, I had to add a garbage include in my pom to
override it. Empty elements will not work.
{code:java}
<build>
<plugins>
<plugin>	
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M2-SNAPSHOT</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<includes>
<include>NOTHING_MATCHES_THIS</include>
</includes>
</configuration>
</plugin>{code}
I don't have reason to believe this is an issue with plugin any longer, apologies.  Though
it is a user experience issue that  I have no way to override behavior from the command line
since <includes> from a parent pom will _always_  be appended to file lists.
 x


was (Author: eddiewebb):
I pulled the code and debug a little, it actually _does_ read the file, but when it calls
getIncludes() it adds additional entries from somewhere, I suspect a parent in the framework
I am using (spring boot)
[https://github.com/apache/maven-surefire/blob/d86d649181ded89c440e0440659938f1c71c9dcc/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java#L2000]

array grows from my single entry to total 3
{code:java}
#log output I added around line 200
>>>> Before "maybeAppend"
java.util.ArrayList@12e0f1cb[size=1]
>>>> After
[Ljava.lang.Object;@118ffcfd[{**/*IT*,**/*Tests.java,**/*Test.java}]{code}
 
h3. h3. Workaround

In case other folks see this curious behavior, I had to add a garbage include in my pom to
override it. Empty elements will not work.
{code:java}
<build>
<plugins>
<plugin>	
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M2-SNAPSHOT</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<includes>
<include>NOTHING_MATCHES_THIS</include>
</includes>
</configuration>
</plugin>{code}


I don't have reason to believe this is an issue with plugin any longer, apologies.
x

> surefire.includesProperty is ignored
> ------------------------------------
>
>                 Key: SUREFIRE-1615
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1615
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.22.1, 3.0.0-M2
>         Environment: 
>            Reporter: Eddie Webb
>            Priority: Major
>
> Docs say that user property for <includesFile> is `surefire.includesFile` [https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#includesFile]
>  
> However surefire appears to ignore that file, and run all tests.
> Given a filetree
> {code:java}
> tree src/test/
> tree src/test/
> src/test/
> └── java
>     └── com
>         └── edwardawebb
>             └── circleci
>                 └── demo
>                     ├── AClassOfVerySlowTests.java
>                     ├── BuildInfoControllerTests.java
>                     ├── BuildInfoTests.java
>                     ├── HomeControllerTests.java
>                     ├── SplittingTestBTests.java
>                     └── it
>                         ├── AboutPageIT.java
>                         ├── AbstractWebIT.java
>                         ├── HeadlessFlowTests.java
>                         └── HomePageIT.java{code}
>  and a file like
> {code:java}
> **/BuildInfoControllerTests.java
> {code}
>  
>  
> When I run 
> {code:java}
> ./mvnw test -B  -Dsurefire.includesFile=index_test_list.txt
> {code}
> I would expect a single class be executed, instead all the tests matching the default
pattern (6 of the files above)
> Actual results run all **/*Test*.java classes
> {code:java}
> [INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ blueskygreenbuilds ---
> [INFO] 
> [INFO] -------------------------------------------------------
> [INFO] T E S T S
> [INFO] -------------------------------------------------------
> [INFO] Running com.edwardawebb.circleci.demo.AClassOfVerySlowTests
> [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.819 s - in com.edwardawebb.circleci.demo.AClassOfVerySlowTests
> [INFO] Running com.edwardawebb.circleci.demo.BuildInfoControllerTests
> [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.edwardawebb.circleci.demo.BuildInfoControllerTests
> [INFO] Running com.edwardawebb.circleci.demo.BuildInfoTests
> [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 s - in com.edwardawebb.circleci.demo.BuildInfoTests
> [INFO] Running com.edwardawebb.circleci.demo.HomeControllerTests
> [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.edwardawebb.circleci.demo.HomeControllerTests
> [INFO] Running com.edwardawebb.circleci.demo.it.HeadlessFlowTests
> [WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.244 s - in
com.edwardawebb.circleci.demo.it.HeadlessFlowTests
> [INFO] Running com.edwardawebb.circleci.demo.SplittingTestBTests
> [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.008 s - in com.edwardawebb.circleci.demo.SplittingTestBTests
> [INFO] 
> [INFO] Results:
> [INFO] 
> [WARNING] Tests run: 12, Failures: 0, Errors: 0, Skipped: 1
> {code}
> .



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message