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 2018/12/19 00:06:06 UTC

[maven-surefire] branch testng-jdk12 updated (beb524f -> 6131965)

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

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


 discard beb524f  Build fix (linux-jdk12-maven3.2.x) Surefire1535TestNGParallelSuitesIT.forks2Redirected:86 File doesn't exist: target/surefire-reports-2/TEST-TestSuite.xml
     new 6131965  Build fix (linux-jdk12-maven3.2.x) Surefire1535TestNGParallelSuitesIT.forks2Redirected:86 File doesn't exist: target/surefire-reports-2/TEST-TestSuite.xml

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   (beb524f)
            \
             N -- N -- N   refs/heads/testng-jdk12 (6131965)

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 1 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:
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[maven-surefire] 01/01: Build fix (linux-jdk12-maven3.2.x) Surefire1535TestNGParallelSuitesIT.forks2Redirected:86 File doesn't exist: target/surefire-reports-2/TEST-TestSuite.xml

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

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

commit 61319655b45945d40ee128bc1df7abe4d9923a5f
Author: Tibor17 <ti...@apache.org>
AuthorDate: Wed Dec 19 01:01:36 2018 +0100

    Build fix (linux-jdk12-maven3.2.x) Surefire1535TestNGParallelSuitesIT.forks2Redirected:86 File doesn't exist: target/surefire-reports-2/TEST-TestSuite.xml
---
 Jenkinsfile                                        |  2 +-
 .../maven/surefire/its/fixture/TestFile.java       |  2 +-
 .../jiras/Surefire1535TestNGParallelSuitesIT.java  | 51 +++++++++++++++++++++-
 .../surefire-1535-parallel-testng/pom.xml          | 10 ++++-
 4 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 5166d0f..559e7b3 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,7 +31,7 @@ properties(
 )
 
 final def oses = ['linux':'ubuntu && !H24', 'windows':'Windows']
-final def mavens = env.BRANCH_NAME == 'master' ? ['3.5.x', '3.3.x', '3.2.x'] : ['3.5.x']
+final def mavens = ['3.5.x', '3.3.x', '3.2.x']
 final def jdks = [12, 11, 8, 7]
 
 final def options = ['-e', '-V', '-B', '-nsu', '-P', 'run-its']
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/TestFile.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/TestFile.java
index 29e8038..6bead34 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/TestFile.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/TestFile.java
@@ -121,7 +121,7 @@ public class TestFile
     {
         try
         {
-            return FileUtils.readFileToString( file );
+            return FileUtils.readFileToString( file, encoding );
         }
         catch ( IOException e )
         {
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java
index ec6ea34..b6e534e 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java
@@ -31,6 +31,7 @@ import java.nio.charset.Charset;
 import static org.hamcrest.CoreMatchers.anyOf;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.CoreMatchers.is;
+import static org.fest.assertions.Assertions.assertThat;
 
 public class Surefire1535TestNGParallelSuitesIT
         extends SurefireJUnit4IntegrationTestCase
@@ -38,8 +39,8 @@ public class Surefire1535TestNGParallelSuitesIT
     private static final Charset UTF8 = Charset.forName( "UTF-8" );
     private static final String TEST_RESULT_1 = platformEncoding( "Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, " );
     private static final String TEST_RESULT_2 = platformEncoding( "Tests run: 2, Failures: 0, Errors: 0, Skipped: 0" );
-    private static final String SUITE1 = platformEncoding( "Suite1.xml" );
-    private static final String SUITE2 = platformEncoding( "Suite2.xml" );
+    private static final String SUITE1 = platformEncoding( "Suite1" );
+    private static final String SUITE2 = platformEncoding( "Suite2" );
     private static final String TEST1 = platformEncoding( "test 1" );
     private static final String TEST2 = platformEncoding( "test 2" );
     private static final String TEST_SUITE = platformEncoding( "Running TestSuite" );
@@ -55,10 +56,23 @@ public class Surefire1535TestNGParallelSuitesIT
         TestFile testFile = validator.getSurefireReportsFile( "../surefire-reports-1/TEST-TestSuite.xml", UTF8 );
         testFile.assertFileExists();
         testFile.assertContainsText( "<testcase name=\"test\" classname=\"it.ParallelTest" );
+        String xml = testFile.readFileToString();
+        boolean parallelTest11 = xml.contains( "<testcase name=\"test\" classname=\"it.ParallelTest1\"" );
+        boolean parallelTest12 = xml.contains( "<testcase name=\"test\" classname=\"it.ParallelTest2\"" );
+        assertThat( parallelTest11 ^ parallelTest12 )
+                .isTrue();
 
         testFile = validator.getSurefireReportsFile( "../surefire-reports-2/TEST-TestSuite.xml", UTF8 );
         testFile.assertFileExists();
         testFile.assertContainsText( "<testcase name=\"test\" classname=\"it.ParallelTest" );
+        xml = testFile.readFileToString();
+        boolean parallelTest21 = xml.contains( "<testcase name=\"test\" classname=\"it.ParallelTest1\"" );
+        boolean parallelTest22 = xml.contains( "<testcase name=\"test\" classname=\"it.ParallelTest2\"" );
+        assertThat( parallelTest21 ^ parallelTest22 )
+                .isTrue();
+
+        assertThat( parallelTest11 && parallelTest22 || parallelTest12 && parallelTest21 )
+                .isTrue();
 
         validator.assertThatLogLine( containsString( TEST_RESULT_2 ), is( 1 ) )
                 .assertThatLogLine( containsString( TEST_RESULT_1 ), is( 2 ) )
@@ -81,10 +95,43 @@ public class Surefire1535TestNGParallelSuitesIT
         TestFile testFile = validator.getSurefireReportsFile( "../surefire-reports-1/TEST-TestSuite.xml", UTF8 );
         testFile.assertFileExists();
         testFile.assertContainsText( "<testcase name=\"test\" classname=\"it.ParallelTest" );
+        String xml = testFile.readFileToString();
+        boolean parallelTest11 = xml.contains( "<testcase name=\"test\" classname=\"it.ParallelTest1\"" );
+        boolean parallelTest12 = xml.contains( "<testcase name=\"test\" classname=\"it.ParallelTest2\"" );
+        assertThat( parallelTest11 ^ parallelTest12 )
+                .isTrue();
+        String log = validator.getSurefireReportsFile( "../surefire-reports-1/TestSuite-output.txt", UTF8 )
+                .readFileToString();
+        assertThat( log.contains( TEST1 ) )
+                .isEqualTo( parallelTest11 );
+        assertThat( log.contains( SUITE1 ) )
+                .isEqualTo( parallelTest11 );
+        assertThat( log.contains( TEST2 ) )
+                .isEqualTo( parallelTest12 );
+        assertThat( log.contains( SUITE2 ) )
+                .isEqualTo( parallelTest12 );
 
         testFile = validator.getSurefireReportsFile( "../surefire-reports-2/TEST-TestSuite.xml", UTF8 );
         testFile.assertFileExists();
         testFile.assertContainsText( "<testcase name=\"test\" classname=\"it.ParallelTest" );
+        xml = testFile.readFileToString();
+        boolean parallelTest21 = xml.contains( "<testcase name=\"test\" classname=\"it.ParallelTest1\"" );
+        boolean parallelTest22 = xml.contains( "<testcase name=\"test\" classname=\"it.ParallelTest2\"" );
+        assertThat( parallelTest21 ^ parallelTest22 )
+                .isTrue();
+        log = validator.getSurefireReportsFile( "../surefire-reports-2/TestSuite-output.txt", UTF8 )
+                .readFileToString();
+        assertThat( log.contains( TEST1 ) )
+                .isEqualTo( parallelTest21 );
+        assertThat( log.contains( SUITE1 ) )
+                .isEqualTo( parallelTest21 );
+        assertThat( log.contains( TEST2 ) )
+                .isEqualTo( parallelTest22 );
+        assertThat( log.contains( SUITE2 ) )
+                .isEqualTo( parallelTest22 );
+
+        assertThat( parallelTest11 && parallelTest22 || parallelTest12 && parallelTest21 )
+                .isTrue();
 
         validator.assertThatLogLine( containsString( TEST_RESULT_2 ), is( 1 ) )
                 .assertThatLogLine( containsString( TEST_RESULT_1 ), is( 2 ) )
diff --git a/surefire-its/src/test/resources/surefire-1535-parallel-testng/pom.xml b/surefire-its/src/test/resources/surefire-1535-parallel-testng/pom.xml
index 4fcc715..6aa6599 100644
--- a/surefire-its/src/test/resources/surefire-1535-parallel-testng/pom.xml
+++ b/surefire-its/src/test/resources/surefire-1535-parallel-testng/pom.xml
@@ -37,8 +37,8 @@
         <dependency>
             <groupId>org.testng</groupId>
             <artifactId>testng</artifactId>
-            <version>5.7</version>
-            <classifier>jdk15</classifier>
+            <version>6.13.1</version>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 
@@ -71,6 +71,12 @@
                         <suiteXmlFile>src/test/resources/Suite1.xml</suiteXmlFile>
                         <suiteXmlFile>src/test/resources/Suite2.xml</suiteXmlFile>
                     </suiteXmlFiles>
+                    <properties>
+                        <property>
+                            <name>surefire.testng.verbose</name>
+                            <value>1</value>
+                        </property>
+                    </properties>
                 </configuration>
             </plugin>
         </plugins>