You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/10/30 16:17:37 UTC

[GitHub] [maven-surefire] SimonBaars opened a new pull request, #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

SimonBaars opened a new pull request, #575:
URL: https://github.com/apache/maven-surefire/pull/575

   The `forkMode` parameter has been deprecated in Surefire 2.14, and with the upcoming 3.0 release, it's finally time to remove the parameter once and for all. 
   
   ## Reviewer instructions
   Removing the `forkMode` ended up being a quite comprehensive change. Throughout the refactoring/restructuring process, I ran the tests and integration tests often, to ensure equivalent behavior. I re-purposed most `forkMode` tests to test the `forkCount` parameter, removing a few that were per definition redundant.
   
   Each commit should address a "sub-issue" I had to tackle to remove the `forkMode`. If the entire diff looks daunting, I can recommend reviewing commit-by-commit. Each commit should be a version that compiles on its own.
   
   Here are a few more pointers for reviewing:
   - Read [this article](https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html#migrating-the-deprecated-forkmode-parameter-to-forkcount-and-reu) about migrating `forkMode` to `forkCount`.
   - Start with the first commit, where I remove the most important traces of the `forkMode` parameter, before moving on to the entire diff.
   - I removed the migration guide from the docs. Is that okay or would we like to keep it up for now?
   - I left some convenience methods for the different fork modes in the SurefireLauncher, let me know if you'd like me to unfold that.
   - I avoided the term "fork mode" as much as possible, but still left some traces where it made sense.
   
   ## What's next?
   While working on this, I noticed a few codebase styling issues that I'd like to refactor. To keep the diff of this PR sensible, I decided it would be better to open a separate PR for that. So you can expect another PR incoming 😉
   
   ## Checklist
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SUREFIRE-1654) filed 
          for the change (usually before you start working on it). Trivial changes like typos do not 
          require a JIRA issue.  Your pull request should address just this issue, without 
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line and body.
    - [x] Format the pull request title like `[SUREFIRE-XXX] - Fixes bug in ApproximateQuantiles`,
          where you replace `SUREFIRE-XXX` with the appropriate JIRA issue. Best practice
          is to use the JIRA issue title in the pull request title and in the first line of the 
          commit message.
    - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [x] Run `mvn clean install` to make sure basic checks pass. A more thorough check will 
          be performed on your pull request automatically.
    - [x] 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](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   ## License
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] slawekjaranowski commented on pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#issuecomment-1360076969

   Nobody knows - but every removed line of code can help for simplify, so be brave and go forward


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] SimonBaars commented on a diff in pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
SimonBaars commented on code in PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#discussion_r1009937829


##########
surefire-its/src/test/resources/surefire-1993-jpms-providing-modules/application/pom.xml:
##########
@@ -72,7 +72,7 @@
                 </executions>
                 <configuration>
                     <forkCount>1</forkCount>
-                    <forkMode>once</forkMode>
+                    <forkCount>1</forkCount>

Review Comment:
   Good point! I applied these changes with a regex to avoid manual errors, but didn't check closely enough. Will change.



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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] SimonBaars commented on pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
SimonBaars commented on PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#issuecomment-1299003356

   > We should make sure that the migration guide (how to get away from forkMode) ends up somewhere in the release announcements of Surefire 3.0.0 (and if there's a milestone release in between, maybe there as well).
   
   I don't know how to do this. Will you pull this?


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] slawekjaranowski merged pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
slawekjaranowski merged PR #575:
URL: https://github.com/apache/maven-surefire/pull/575


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] SimonBaars commented on pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
SimonBaars commented on PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#issuecomment-1296340037

   Hey, I'm aware of the integration test failures and will try to address them tomorrow.


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] mthmulders commented on a diff in pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
mthmulders commented on code in PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#discussion_r1009862231


##########
surefire-its/src/test/resources/surefire-1993-jpms-providing-modules/application/pom.xml:
##########
@@ -72,7 +72,7 @@
                 </executions>
                 <configuration>
                     <forkCount>1</forkCount>
-                    <forkMode>once</forkMode>
+                    <forkCount>1</forkCount>

Review Comment:
   Nit: this one seems a duplicate of the line above.



##########
surefire-its/src/test/resources/surefire-1041-exception-in-junit-runner/pom.xml:
##########
@@ -35,7 +35,7 @@
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <forkMode>once</forkMode>
+          <forkCount>1</forkCount>

Review Comment:
   Nit: this one seems a duplicate of the line above.



##########
surefire-its/src/test/resources/surefire-1136-cwd-propagation-in-forked-mode/pom.xml:
##########
@@ -55,7 +55,7 @@
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <!-- To override fork mode from parrent pom.xml -->
-          <forkMode>once</forkMode>
+          <forkCount>1</forkCount>

Review Comment:
   Nit: this one seems a duplicate of the line below.



##########
surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/pom.xml:
##########
@@ -62,7 +62,7 @@
                     <artifactId>maven-surefire-plugin</artifactId>
                     <version>${surefire.version}</version>
                     <configuration>
-                        <forkMode>once</forkMode>
+                        <forkCount>1</forkCount>

Review Comment:
   Nit: this one seems a duplicate of the line below.



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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] SimonBaars commented on pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
SimonBaars commented on PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#issuecomment-1315080366

   @mthmulders We need another review for this PR, so ideally it won't lay dormant for too long. Do you know someone to include?


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] slawekjaranowski commented on pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#issuecomment-1315906113

   @SimonBaars  Thanks ... I will try to review and test in a few days


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] slawekjaranowski commented on pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#issuecomment-1317415615

   First check:
   
   - `org.apache.maven.surefire.api.provider.SurefireProvider` - `forkMode` in comments - to think, discover correct descriptions
   
   - `org.apache.maven.surefire.its.jiras.Surefire146ForkPerTestNoSetupIT` - mentions test for forkMode=pertest - check if is still needed
   
   - `surefire-its/src/test/resources/surefire-146-forkPerTestNoSetup/pom.xml` - `forkMode=pertest` in description
   
   


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] SimonBaars commented on pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
SimonBaars commented on PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#issuecomment-1299683827

   Hey, I resolved the failing tests (except for `ubuntu-latest jdk-18-temurin`, but that also fails on`master`). Can someone else do a review? Maybe @slawekjaranowski since you also chipped in on the other PR 😊 
   


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] michael-o commented on pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#issuecomment-1315839448

   @SimonBaars Thank you for the massive work. I guess we owe a pack of Amstel.
   
   * Did you try a custom build against our Core ITs?
   * Did you search our [https://github.com/apache/maven-sources/tree/submodules](Maven Sources] for this deprecated param, replace and see how it goes?


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-surefire] mthmulders commented on pull request #575: [SUREFIRE-1654] Remove deprecated `forkMode` parameter

Posted by GitBox <gi...@apache.org>.
mthmulders commented on PR #575:
URL: https://github.com/apache/maven-surefire/pull/575#issuecomment-1315832049

   > > We should make sure that the migration guide (how to get away from forkMode) ends up somewhere in the release announcements of Surefire 3.0.0 (and if there's a milestone release in between, maybe there as well).
   > 
   > I don't know how to do this. Will you pull this?
   
   In hindsight, it might be a better approach to keep the content in **maven-surefire-plugin/src/site/apt/examples/fork-options-and-parallel-execution.apt.vm**. We should update it - instead of
   
   > Although that parameter is still supported for backward compatibility, users are strongly encouraged to migrate their configuration and use <<\<forkCount>>> and <<\<reuseForks>>> instead.
   
   We might want to go for something like 
   
   > Starting with 3.0.0-M8, this parameter is no longer available. Users should have migrated their configuration to use <<\<forkCount>>> and <<\<reuseForks>>> instead.


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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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