[TASK] Run phpLint and phpUnit in different travis builds 25/22625/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 27 Jul 2013 18:15:05 +0000 (20:15 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 27 Jul 2013 19:07:46 +0000 (21:07 +0200)
phpLint checks php files for compilation errors in travis before
the unit tests are executed. This takes quite some time.
The patch configures travis to run phpLint and phpUnit in different
builds to speed up the process. Additionally, phpLint environment
does not clone phpunit and the introduction package and does no
database initialization.

Change-Id: Ie25ade5b6a8fcf4c4dc0752fc8662c433ea3c33c
Resolves: #50492
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/22624
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
(cherry picked from commit cae1c18432a6306a28590605f5e5a70be8a8c63d)
Reviewed-on: https://review.typo3.org/22625

.travis.yml

index 1852db4..1be01b3 100644 (file)
@@ -4,7 +4,8 @@ php:
   - 5.4
 
 env:
-  - DB=mysql
+  - DB=mysql PHPUNIT=1
+  - DB=none PHPLINT=1
 
 services:
   - memcached
@@ -19,11 +20,11 @@ before_script:
   - if [[ "$TRAVIS_PHP_VERSION" == "5.3" ]]; then installPhpModule -y apc; fi
 
 # Install rudimentary TYPO3
-  - git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Distributions/Introduction.git build-environment/Introduction
-  - mv build-environment/typo3conf .
-  - git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Extensions/phpunit.git typo3conf/ext/phpunit/
-  - mkdir fileadmin
-  - mkdir uploads
+  - if [[ "$PHPUNIT" == "1" ]]; then git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Distributions/Introduction.git build-environment/Introduction; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then mv build-environment/typo3conf .; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Extensions/phpunit.git typo3conf/ext/phpunit/; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then mkdir fileadmin; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then mkdir uploads; fi
   - if [[ "$DB" == "mysql" ]]; then mysql -e "DROP DATABASE IF EXISTS typo3_test;" -uroot; fi
   - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS typo3_test;" -uroot; fi
   - if [[ "$DB" == "mysql" ]]; then mysql -uroot typo3_test < build-environment/Introduction/typo3conf/ext/introduction/Resources/Private/Subpackages/Introduction/Database/introduction.sql; fi
@@ -32,5 +33,5 @@ before_script:
   - if [[ "$DB" == "mysql" ]]; then mysql -uroot typo3_test < build-environment/dbimport/phpunit.sql; fi
 
 script:
-  - phpLint all
-  - php $PWD/typo3/cli_dispatch.phpsh phpunit -c typo3/sysext/core/Build/UnitTests.xml
+  - if [[ "$PHPLINT" == "1" ]]; then phpLint all; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then php $PWD/typo3/cli_dispatch.phpsh phpunit -c typo3/sysext/core/Build/UnitTests.xml; fi