Discussion:
[GitHub] srdo commented on issue #206: SUREFIRE-1610: Add skipUTs flag to SurefirePlugin
GitBox
2018-12-09 19:02:49 UTC
Permalink
srdo commented on issue #206: SUREFIRE-1610: Add skipUTs flag to SurefirePlugin
URL: https://github.com/apache/maven-surefire/pull/206#issuecomment-445562341


Thanks for responding.
You could have 'profile' in which you are disabling surefire.
So
mvn verify -Prun-its
Where 'run-its' is a profile in which surefire is disabled
Yes, that's what I'm doing now. It's very verbose, which is why I thought a parameter for it would be nicer:
```
<profile>
<id>integration-tests-only</id>
<properties>
<skipITs>false</skipITs>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
```
I guess you have a problem with the system property used by both plugins the same and you cannot > segregate them. Is it so?
Yes. `skipTests` is used by both plugins, and Surefire doesn't have anything like Failsafe's `skipITs`.
At the same time we should remove skipTests from maven-failsafe-plugin because this was long time associated with unit tests and thus maven-surefire-plugin
Am I understanding you correctly that you're planning to remove `skipTests` from Failsafe? It isn't deprecated yet. Removing it from Failsafe would solve this.

Assuming you don't want to remove `skipTests` from Failsafe, and also don't want a new Surefire parameter, I'm not sure there's a better solution than the profile?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
***@infra.apache.org


With regards,
Apache Git Services
GitBox
2018-12-09 19:20:55 UTC
Permalink
srdo commented on issue #206: SUREFIRE-1610: Add skipUTs flag to SurefirePlugin
URL: https://github.com/apache/maven-surefire/pull/206#issuecomment-445563667


Something like this?
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>${skipThisPlugin}</skipTests>
</configuration>
</plugin>
```
and then set `skipThisPlugin` in the profile. I tried that too, I thought it made the script too confusing to newcomers, since it causes the `skipTests` flag to be ignored. I think it is confusing to do `mvn install -DskipTests` and have it still run the tests.
skipTests has not been deprecated yet because it's a common code for both plugins, but we should try to do it clear in our documentation and deprecate it in Failsafe.
Sounds great. I'll close the PR, if `skipTests` becomes a flag that only applies to Surefire it will solve the issue. The only downside I can see to it is that `mvn install -DskipTests` will run the integration tests, it is convenient to be able to skip all tests without having to do `mvn install -DskipTests -DskipITs`. It's an extremely minor inconvenience though I think.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
***@infra.apache.org


With regards,
Apache Git Services
GitBox
2018-12-09 19:35:03 UTC
Permalink
srdo commented on issue #206: SUREFIRE-1610: Add skipUTs flag to SurefirePlugin
URL: https://github.com/apache/maven-surefire/pull/206#issuecomment-445564735
Regarding a common property, it already exists maven.test.skip, e.g. mvn install -Dmaven.test.skip=true.
Great, then I'm happy. Thanks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
***@infra.apache.org


With regards,
Apache Git Services
GitBox
2018-12-09 20:03:49 UTC
Permalink
srdo commented on issue #206: SUREFIRE-1610: Add skipUTs flag to SurefirePlugin
URL: https://github.com/apache/maven-surefire/pull/206#issuecomment-445566829


Regarding the common property, the docs mention that `maven.test.skip` also skips compiling the tests, so doing `mvn install -Dmaven.test.skip` isn't exactly the same as `mvn -DskipTests -DskipITs`. It might still be useful to have a property for skipping both unit and integration tests, but still compiling them (essentially what `skipTests` does now)?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
***@infra.apache.org


With regards,
Apache Git Services
GitBox
2018-12-09 20:23:39 UTC
Permalink
srdo commented on issue #206: SUREFIRE-1610: Add skipUTs flag to SurefirePlugin
URL: https://github.com/apache/maven-surefire/pull/206#issuecomment-445568319


Makes sense. I just meant that it would be good to have built in, since compiling everything but not running the tests is a pretty common use case (for me at least). I suppose writing `mvn install -DskipTests -DskipITs` isn't that much longer than a common flag would be anyway.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
***@infra.apache.org


With regards,
Apache Git Services
GitBox
2018-12-09 17:50:25 UTC
Permalink
srdo commented on issue #206: SUREFIRE-1610: Add skipUTs flag to SurefirePlugin
URL: https://github.com/apache/maven-surefire/pull/206#issuecomment-445557324


-DskipTests disables both Surefire and Failsafe. The new flag only disables Surefire.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
***@infra.apache.org


With regards,
Apache Git Services
GitBox
2018-12-09 21:20:56 UTC
Permalink
srdo commented on issue #206: SUREFIRE-1610: Add skipUTs flag to SurefirePlugin
URL: https://github.com/apache/maven-surefire/pull/206#issuecomment-445572757


Sure, that makes sense.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
***@infra.apache.org


With regards,
Apache Git Services
GitBox
2018-12-09 18:09:48 UTC
Permalink
srdo commented on issue #206: SUREFIRE-1610: Add skipUTs flag to SurefirePlugin
URL: https://github.com/apache/maven-surefire/pull/206#issuecomment-445558706


I'd like to be able to do the following 4 things:

Run all tests: Possible via `mvn install`.

Run only unit tests: Possible via `mvn test` or `mvn install -DskipITs`

Run no tests: `mvn install -DskipTests`

Run only the integration tests: How do I do this from the command line without the new flag? Running `mvn test` won't run the integration tests. Running `mvn verify` will run the integration tests, but also the unit tests. Running `mvn verify -DskipTests` will skip all the tests.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
***@infra.apache.org


With regards,
Apache Git Services

Loading...