From 87310e5abcfdef98b8a5863796f0943fb03fd307 Mon Sep 17 00:00:00 2001
From: Christian Kuhn <lolli@schwarzbu.ch>
Date: Tue, 6 May 2014 20:15:39 +0200
Subject: [PATCH] [TASK] Find functional tests automatically, optimize
 travis-ci

Simalar to UnitTests.xml, FunctionalTests.xml no longer register
single test suites but find all functional tests cases using a
wildcard.

For travis-ci, single tests cases are now given to parallel using
gnu find. This leads to a nice performance improvement on travis
since more but shorter processes are executed, sharing the available
hardware more effectively.

Change-Id: I8dc34ed2fcc1ae8390bc05dbe6f5e7009af17a36
Resolves: #58578
Related: #58533
Releases: 6.2
Reviewed-on: https://review.typo3.org/29901
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
---
 .travis.yml                                 |  2 +-
 typo3/sysext/core/Build/FunctionalTests.xml | 21 ++-------------------
 2 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 4ee44be4cfb4..25ff7fe50c16 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -47,7 +47,7 @@ script:
     export typo3DatabaseHost="localhost";
     export typo3DatabaseUsername="root";
     export typo3DatabasePassword="";
-    grep directory typo3/sysext/core/Build/FunctionalTests.xml | awk '{print $1}' | sed 's%<directory>\(\.\./\)*\(typo3/sysext.*\)</directory>$%\2%g' | parallel --gnu 'echo; echo "Running functional {} tests"; ./bin/phpunit --colors -c typo3/sysext/core/Build/FunctionalTests.xml {}'
+    find . -wholename '*typo3/sysext/*/Tests/Functional/*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; ./bin/phpunit --colors -c typo3/sysext/core/Build/FunctionalTests.xml {}'
   - >
     echo;
     echo "Running php lint";
diff --git a/typo3/sysext/core/Build/FunctionalTests.xml b/typo3/sysext/core/Build/FunctionalTests.xml
index ee538fd09786..db3cc77b72e1 100644
--- a/typo3/sysext/core/Build/FunctionalTests.xml
+++ b/typo3/sysext/core/Build/FunctionalTests.xml
@@ -24,25 +24,8 @@
 	verbose="false"
 >
 	<testsuites>
-		<testsuite name="EXT:core tests">
-			<directory>../../../../typo3/sysext/core/Tests/Functional/</directory>
-		</testsuite>
-		<testsuite name="EXT:frontend tests">
-			<directory>../../../../typo3/sysext/frontend/Tests/Functional/</directory>
-		</testsuite>
-		<testsuite name="EXT:impexp tests">
-			<directory>../../../../typo3/sysext/impexp/Tests/Functional/</directory>
-		</testsuite>
-		<testsuite name="EXT:workspaces tests">
-			<directory>../../../../typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/</directory>
-			<directory>../../../../typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/</directory>
-			<directory>../../../../typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/</directory>
-			<directory>../../../../typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/</directory>
-			<directory>../../../../typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/</directory>
-			<directory>../../../../typo3/sysext/workspaces/Tests/Functional/Service/</directory>
-		</testsuite>
-		<testsuite name="EXT:extbase tests">
-			<directory>../../../../typo3/sysext/extbase/Tests/Functional/</directory>
+		<testsuite name="Core tests">
+			<directory>../../../../typo3/sysext/*/Tests/Functional/</directory>
 		</testsuite>
 	</testsuites>
 </phpunit>
-- 
GitLab