From bdaab73967ac4242fb7bc15fd777b65e2d0ecdb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 11:22:18 +0100 Subject: [PATCH 01/10] Squeeze lint into test build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the setup costs are quite high, so do both steps at once - lint only changed files - always generate locales for tests to simplify code Signed-off-by: Michal Čihař --- .travis.yml | 3 ++- test/ci-lint | 7 +++++-- test/ci-selenium | 2 -- test/ci-test | 2 -- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9c9202a25c..43a6b5d48a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,6 @@ sudo: false env: matrix: - CI_MODE=test - - CI_MODE=lint global: - TESTSUITE_USER=root - TESTSUITE_PASSWORD=root @@ -39,6 +38,8 @@ before_script: script: - ant clean + - ant locales + - if [ $CI_MODE = test ] ; then ./test/ci-lint ; fi - ./test/ci-$CI_MODE after_script: diff --git a/test/ci-lint b/test/ci-lint index 57ab51661f..f4ae3eb7cc 100755 --- a/test/ci-lint +++ b/test/ci-lint @@ -1,4 +1,7 @@ #!/bin/sh -ant locales lint - +if [ -z "$TRAVIS_COMMIT_RANGE" ] ; then + ant lint +else + git diff --name-only $TRAVIS_COMMIT_RANGE -- '*.php' | xargs -n1 -r php -l +fi diff --git a/test/ci-selenium b/test/ci-selenium index 0c05b3fdf1..c964e387df 100755 --- a/test/ci-selenium +++ b/test/ci-selenium @@ -1,7 +1,5 @@ #!/bin/sh -ant locales - export PHPUNIT_ARGS="--group selenium --debug" ant phpunit-nocoverage diff --git a/test/ci-test b/test/ci-test index da8bd65c60..e427dfb727 100755 --- a/test/ci-test +++ b/test/ci-test @@ -1,7 +1,5 @@ #!/bin/sh -ant locales - export PHPUNIT_ARGS="--exclude-group selenium" if [ "$TRAVIS_PHP_VERSION" = "hhvm" ] ; then From f3425986b5cad507df7ead6f758ba08bd91a14e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 11:24:04 +0100 Subject: [PATCH 02/10] Generate locales without ant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes ant overhead. Signed-off-by: Michal Čihař --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 43a6b5d48a..8f53f9854b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ before_script: script: - ant clean - - ant locales + - ./scripts/generate-mo --quiet - if [ $CI_MODE = test ] ; then ./test/ci-lint ; fi - ./test/ci-$CI_MODE From b4326fcc3d6e30a90a03af9718e3f4a13347ceda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 11:24:33 +0100 Subject: [PATCH 03/10] Remove and cleanup from Travis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It should not be necessary at all as we start with clean environment. Signed-off-by: Michal Čihař --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8f53f9854b..f0c4fe7fea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,6 @@ before_script: - ./test/start-local-server script: - - ant clean - ./scripts/generate-mo --quiet - if [ $CI_MODE = test ] ; then ./test/ci-lint ; fi - ./test/ci-$CI_MODE From 0b0e99cc02e1d1f5f04eb739a3f748a5a02604c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 11:31:57 +0100 Subject: [PATCH 04/10] Remove no longer needed exclude MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- phpunit.xml.dist | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ab6d82156b..959ac0e46d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -47,8 +47,6 @@ test/ examples - - scripts From 4f375697734e03ff63293f28b24107e04c8056cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 11:46:24 +0100 Subject: [PATCH 05/10] Do not use ant on Travis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is just additional overhead without real benefit. Signed-off-by: Michal Čihař --- .travis.yml | 2 +- test/ci-lint | 2 +- test/ci-selenium | 4 +--- test/ci-test | 15 +++++++++------ 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index f0c4fe7fea..f566842b8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,7 +67,7 @@ matrix: before_install: - brew tap homebrew/php - brew update - - brew install ant gettext php70 mariadb + - brew install gettext php70 mariadb - brew link --force gettext - curl https://getcomposer.org/installer | php - ln -s "`pwd`/composer.phar" /usr/local/bin/composer diff --git a/test/ci-lint b/test/ci-lint index f4ae3eb7cc..12ee34618a 100755 --- a/test/ci-lint +++ b/test/ci-lint @@ -1,7 +1,7 @@ #!/bin/sh if [ -z "$TRAVIS_COMMIT_RANGE" ] ; then - ant lint + find . -name '*.php' -not -path './vendor/*' | xargs -n1 -r php -l else git diff --name-only $TRAVIS_COMMIT_RANGE -- '*.php' | xargs -n1 -r php -l fi diff --git a/test/ci-selenium b/test/ci-selenium index c964e387df..d5d6b91dfb 100755 --- a/test/ci-selenium +++ b/test/ci-selenium @@ -1,5 +1,3 @@ #!/bin/sh -export PHPUNIT_ARGS="--group selenium --debug" - -ant phpunit-nocoverage +./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --debug diff --git a/test/ci-test b/test/ci-test index e427dfb727..1bd4497897 100755 --- a/test/ci-test +++ b/test/ci-test @@ -1,9 +1,12 @@ #!/bin/sh -export PHPUNIT_ARGS="--exclude-group selenium" +case "$TRAVIS_PHP_VERSION" in + hhvm*) + CONFIG=phpunit.xml.hhvm + ;; + *) + CONFIG=phpunit.xml.dist + ;; +esac -if [ "$TRAVIS_PHP_VERSION" = "hhvm" ] ; then - ant phpunit-hhvm -else - ant phpunit -fi +./vendor/bin/phpunit --configuration $CONFIG --exclude-group selenium From db62cf1bf4392fc7b3f02023c6a8627b33667c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 14:32:33 +0100 Subject: [PATCH 06/10] There is no phpenv on OSX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f566842b8b..ca7b49f7a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: install: - ./test/ci-install-$CI_MODE - - if [ $TRAVIS_PHP_VERSION != "hhvm" ] ; then phpenv config-add test/php-noprofile.ini ; fi + - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then case "$TRAVIS_PHP_VERSION" in hhvm*) ;; *) phpenv config-add test/php-noprofile.ini ;; esac ; fi before_script: - export PATH=~/.composer/vendor/bin/:$PATH From 2fea612791032f54fa5a873f0c26772fcbd914c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 16:53:23 +0100 Subject: [PATCH 07/10] Simplify code for skipping not supported PHP versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- test/install-runkit | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/install-runkit b/test/install-runkit index 180d4ca139..fdd8409b5b 100755 --- a/test/install-runkit +++ b/test/install-runkit @@ -6,9 +6,12 @@ if [ -n "$GATEWAY_INTERFACE" ] ; then exit 1 fi -if [ "$TRAVIS_PHP_VERSION" = "nightly" -o "$TRAVIS_PHP_VERSION" = "hhvm" -o "$TRAVIS_PHP_VERSION" = "7.0" -o "$TRAVIS_PHP_VERSION" = "7.1" -o "$TRAVIS_OS_NAME" = "osx" ] ; then - exit 0 -fi +# These do not support runkit +case "$TRAVIS_PHP_VERSION" in + hhvm*|7.0|7.1|nightly) + exit 0 + ;; +esac set -e set -x From 2b42777cdf3739e260c86a797dd4621a4bfc23f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 12:08:34 +0100 Subject: [PATCH 08/10] Leverage pip cache instead of using apt packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- .travis.yml | 3 +-- test/ci-install-docs | 4 ++-- test/ci-install-release | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ca7b49f7a1..5a53f2088f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,15 +74,14 @@ matrix: - mysql.server start cache: + pip: true directories: - $HOME/.composer/cache/ - $HOME/browserstack - $HOME/runkit - - $HOME/.cache/pip addons: apt: packages: - git - - python-coverage sources: - git-core diff --git a/test/ci-install-docs b/test/ci-install-docs index 624e0084f1..dcef8521fb 100755 --- a/test/ci-install-docs +++ b/test/ci-install-docs @@ -2,5 +2,5 @@ # We use 1.5 to be able to deal with gzip only sites in linkcheck (such as tcpdf.org) -pip install --user 'Sphinx>=1.5a2' 'requests[security]' - +pip install --user --upgrade pip wheel +pip install --user 'Sphinx' 'requests[security]' diff --git a/test/ci-install-release b/test/ci-install-release index f6cecab51a..32cccf2b6a 100755 --- a/test/ci-install-release +++ b/test/ci-install-release @@ -1,3 +1,3 @@ #!/bin/sh -pip install --user Sphinx +./test/ci-install-docs From a06669d83d91acf56d43d241bc0677aa3334714a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 16:59:46 +0100 Subject: [PATCH 09/10] Document why we install some packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5a53f2088f..05f516f24d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,6 +79,8 @@ cache: - $HOME/.composer/cache/ - $HOME/browserstack - $HOME/runkit +# Install APT packages +# - git > 2.5.1 needed for worktrees addons: apt: packages: From 3fdf3438996a7a1e019ce6316b587db69c7ad8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 1 Mar 2017 17:48:08 +0100 Subject: [PATCH 10/10] Use installed pip for better caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- test/ci-install-docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ci-install-docs b/test/ci-install-docs index dcef8521fb..02f74a0b54 100755 --- a/test/ci-install-docs +++ b/test/ci-install-docs @@ -3,4 +3,4 @@ # We use 1.5 to be able to deal with gzip only sites in linkcheck (such as tcpdf.org) pip install --user --upgrade pip wheel -pip install --user 'Sphinx' 'requests[security]' +~/.local/bin/pip install --user 'Sphinx' 'requests[security]'