You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2021/05/08 21:34:11 UTC

[maven-surefire] branch userDir updated (4d17174 -> 190b5ff)

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a change to branch userDir
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git.


 discard 4d17174  https://github.com/quarkusio/quarkus/issues/16195
     new e324af5  [SUREFIRE-1912] user.dir should not be set lazily within the surefire fork JVM
     new 190b5ff  [SUREFIRE-1913] system properties should be restored after the in-process tests have been executed

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (4d17174)
            \
             N -- N -- N   refs/heads/userDir (190b5ff)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../maven/plugin/surefire/AbstractSurefireMojo.java      | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

[maven-surefire] 02/02: [SUREFIRE-1913] system properties should be restored after the in-process tests have been executed

Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch userDir
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit 190b5ff3c31cd21f21c386df55f3f9625fc33811
Author: tibordigana <ti...@gmail.com>
AuthorDate: Sat May 8 23:33:46 2021 +0200

    [SUREFIRE-1913] system properties should be restored after the in-process tests have been executed
---
 .../maven/plugin/surefire/AbstractSurefireMojo.java      | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index d95c6a5..5109fde 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -1302,11 +1302,19 @@ public abstract class AbstractSurefireMojo
 
         if ( isNotForking() )
         {
-            createCopyAndReplaceForkNumPlaceholder( effectiveProperties, 1 ).copyToSystemProperties();
+            Properties originalSystemProperties = (Properties) System.getProperties().clone();
+            try
+            {
+                createCopyAndReplaceForkNumPlaceholder( effectiveProperties, 1 ).copyToSystemProperties();
 
-            InPluginVMSurefireStarter surefireStarter = createInprocessStarter( provider, classLoaderConfiguration,
-                    runOrderParameters, scanResult, platform, testClasspathWrapper );
-            return surefireStarter.runSuitesInProcess( scanResult );
+                InPluginVMSurefireStarter surefireStarter = createInprocessStarter( provider, classLoaderConfiguration,
+                        runOrderParameters, scanResult, platform, testClasspathWrapper );
+                return surefireStarter.runSuitesInProcess( scanResult );
+            }
+            finally
+            {
+                System.setProperties( originalSystemProperties );
+            }
         }
         else
         {

[maven-surefire] 01/02: [SUREFIRE-1912] user.dir should not be set lazily within the surefire fork JVM

Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch userDir
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit e324af522507e919c16a17f2d80935e2cc110f31
Author: tibordigana <ti...@gmail.com>
AuthorDate: Tue May 4 21:54:02 2021 +0200

    [SUREFIRE-1912] user.dir should not be set lazily within the surefire fork JVM
---
 .../org/apache/maven/plugin/surefire/AbstractSurefireMojo.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 18cfa72..d95c6a5 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -1222,7 +1222,6 @@ public abstract class AbstractSurefireMojo
                                                              getUserProperties(), sysProps );
 
         result.setProperty( "basedir", getBasedir().getAbsolutePath() );
-        result.setProperty( "user.dir", getWorkingDirectory().getAbsolutePath() );
         result.setProperty( "localRepository", getLocalRepository().getBasedir() );
         if ( isForking() )
         {
@@ -1246,10 +1245,16 @@ public abstract class AbstractSurefireMojo
                         );
             }
         }
+        else
+        {
+            result.setProperty( "user.dir", getWorkingDirectory().getAbsolutePath() );
+        }
+
         if ( getConsoleLogger().isDebugEnabled() )
         {
             showToLog( result, getConsoleLogger() );
         }
+
         return result;
     }