Skip to content

[SUREFIRE-823] Decouple -DskipTests from Failsafe plugin#3371

Open
olamy wants to merge 1 commit into
apache:masterfrom
olamy:gh-1766-disable-skipTests-it-tests
Open

[SUREFIRE-823] Decouple -DskipTests from Failsafe plugin#3371
olamy wants to merge 1 commit into
apache:masterfrom
olamy:gh-1766-disable-skipTests-it-tests

Conversation

@olamy

@olamy olamy commented Jun 3, 2026

Copy link
Copy Markdown
Member

The Failsafe plugin's skipTests parameter is no longer bound to the
skipTests user property. -DskipTests now only skips Surefire (unit tests)
while leaving Failsafe (integration tests) untouched.

Use -DskipITs to skip integration tests from the command line, or
-Dmaven.test.skip to skip both. The plugin configuration
element is still honoured when set explicitly.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean install).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@olamy olamy added the enhancement New feature or request label Jun 3, 2026
@olamy
olamy force-pushed the gh-1766-disable-skipTests-it-tests branch from 0e0cbdd to 2a7a3e9 Compare June 30, 2026 17:59
Signed-off-by: Olivier Lamy <olamy@apache.org>
@olamy
olamy force-pushed the gh-1766-disable-skipTests-it-tests branch from 2a7a3e9 to b3333c7 Compare July 12, 2026 08:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements SUREFIRE-823 by changing the Maven Failsafe Plugin so that the -DskipTests user property no longer skips integration tests; it now only affects the Maven Surefire Plugin (unit tests). The change is validated via a new integration test fixture and accompanying IT, and is documented in both plugin sources and site docs.

Changes:

  • Decouple Failsafe’s legacy skipTests parameter from the skipTests user property by removing @Parameter(property = "skipTests") bindings and keeping <skipTests> config support via a deprecated, config-only parameter.
  • Add a new integration-test fixture project and IT coverage to verify behavior for -DskipTests, -DskipITs, and -Dmaven.test.skip.
  • Update user-facing documentation and Javadocs to describe the new skip semantics.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
surefire-its/src/test/resources/failsafe-1766-skip-decoupled/src/test/java/MyTest.java Adds a unit test class used by the new IT fixture to validate Surefire behavior.
surefire-its/src/test/resources/failsafe-1766-skip-decoupled/src/test/java/MyIT.java Adds an integration test class used by the new IT fixture to validate Failsafe behavior.
surefire-its/src/test/resources/failsafe-1766-skip-decoupled/pom.xml Defines a minimal project using both Surefire and Failsafe to exercise skip behavior end-to-end.
surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1766SkipTestsDecoupledIT.java Adds integration tests asserting skipTests only skips Surefire, while skipITs / maven.test.skip behave as expected.
maven-surefire-plugin/src/site/apt/examples/skipping-tests.apt.vm Updates documentation to explain the new -DskipTests vs -DskipITs semantics (one section still needs correction per review comment).
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java Updates Javadoc on skipTests to reflect that Failsafe no longer binds to the skipTests user property.
maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java Makes skipTests config-only (not bound to the user property) and deprecates it in favor of skipITs.
maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java Introduces a deprecated, config-only skipTests parameter and overrides isSkipTests() so -DskipTests no longer skips IT execution.

Comment on lines 92 to +94
Since <<<skipTests>>> is also supported by the ${thatPlugin} Plugin, this will have the effect
of not running any tests. If, instead, you want to skip only the integration tests
being run by the ${thisPlugin} Plugin, you would use the <<<skipITs>>> property instead:
of not running any tests. If, instead, you want to skip only the integration tests
being run by the ${thatPlugin} Plugin, you would use the <<<skipITs>>> property instead:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants