From 1ac772884ce865e4700e2fd790f1ecdad228bb10 Mon Sep 17 00:00:00 2001 From: Ben Keith Date: Tue, 20 Mar 2018 12:28:16 -0400 Subject: [PATCH 1/5] Update from testing php 5.3-5.5 to 5.6-7.2 --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b197ab..dec0f87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,10 @@ language: php # PHP versions php: - - "5.3" - - "5.4" - - "5.5" + - "5.6" + - "7.0" + - "7.1" + - "7.2" # WordPress versions env: From 649f6838e8778cb1fc091ecc1257fbd6fb884c62 Mon Sep 17 00:00:00 2001 From: Ben Keith Date: Tue, 20 Mar 2018 12:29:28 -0400 Subject: [PATCH 2/5] Update tests from Wordpress 3.8.14-4.5.5 to 3.8-4.9, to use latest patch releases --- .travis.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index dec0f87..de61c0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,16 +16,19 @@ php: # WordPress versions env: - - WP_VERSION=3.8.14 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=3.9.12 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.0.11 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.1.11 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.2.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.3.4 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.4.3 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.5.2 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=3.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=3.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.0 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.1 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.2 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.3 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.4 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.5 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.6 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.7 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress -# Only test the bootstrap-unit-tests branch for now branches: only: - master From 09d72a8aa6a7c205ab54e8f1cd362879dd90a0d3 Mon Sep 17 00:00:00 2001 From: Ben Keith Date: Tue, 20 Mar 2018 15:52:41 -0400 Subject: [PATCH 3/5] Drastically reduce the number of builds that are made with Travis Based on research in https://github.com/npr/pmp-php-sdk/issues/36, Travis CI runs tests using the following PHPUnit versions: - PHP 5.6: PHPUnit 5.7.23 - PHP 7: PHPUnit 6.4.3 - PHP 7.1: PHPUnit 6.4.3 - PHP 7.2: PHPUnit 7.0.2 This commit reduces the number of tests that are run by more than two thirds. Before, we were running 4 different PHP versions and 11 diffferent WordPress versions. Many of those combinations were incompatible, for different reasons: 1. There are PHP warnings about deprecated PHP-4-style constructors. 2. Requires PHPUnit 5 because PHPUnit 6 support was not included until WordPress 4.7. 3. Unless there's been an update since [this trac thread](https://core.trac.wordpress.org/ticket/39822), WordPress tests still assume PHPUnit 6, and Travis runs PHP 7.2 tests with PHPUnit 7 | phpunit | 5.7 | 6.4 | 6.4 | 7.0 | | | | php | 5.6 | 7.0 | 7.1 | 7.2 | | | | WP | | | | | wp release year | then-current php | |---------|-----|-----|-----|-----|-----------------|------------------| | 3.8 | | 1 | 1 | 1 | 2013 | | | 3.9 | | 1 | 1 | 1 | 2014 | 5.5 | | 4.0 | | 1 | 1 | 1 | 2014 | 5.5 | | 4.1 | | 1 | 1 | 1 | 2014 | 5.5 | | 4.2 | | 2 | 2 | 2 | 2015 | 5.6 | | 4.3 | | 2 | 2 | 2 | 2015 | 5.6 | | 4.4 | | 2 | 2 | 2 | 2015 | 7.0 | | 4.5 | | 2 | 2 | 2 | 2016 | 7.0 | | 4.6 | | 2 | 2 | 2 | 2016 | 7.0 | | 4.7 | | | | 3 | 2016 | 7.1 | | 4.8 | | | | 3 | 2017 | 7.1 | | 4.9 | | | | 3 | 2017 | 7.2 | Accordingly, this commit removes PHP 7.2 from tests, and replaces the separate lists of PHP and WordPress versions with one list of selected PHP and WordPress versions. --- .travis.yml | 75 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index de61c0a..88bb5fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,26 +8,65 @@ sudo: false language: php # PHP versions -php: - - "5.6" - - "7.0" - - "7.1" - - "7.2" +# php: +# - "5.6" +# - "7.0" +# - "7.1" +# - "7.2" # WordPress versions -env: - - WP_VERSION=3.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=3.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.0 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.1 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.2 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.3 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.4 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.5 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.6 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.7 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# env: +# - WP_VERSION=3.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.0 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.1 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.2 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.3 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.4 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.5 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.6 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.7 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress +# - WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + +# for a breakdown of why these versions were chosen, see https://github.com/INN/WP-DS-NPR-API/issues/12#issuecomment-374730094 +matrix: + include: + - php: 5.6 + env: WP_VERSION=3.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=3.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.0 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.1 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.2 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.3 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.4 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.5 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.6 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.7 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 5.6 + env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 7.0 + env: WP_VERSION=4.7 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 7.0 + env: WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 7.0 + env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 7.1 + env: WP_VERSION=4.7 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 7.1 + env: WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + - php: 7.1 + env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress branches: only: From 0130703cd17b3ffe494cd8239286bf828cb849e9 Mon Sep 17 00:00:00 2001 From: Ben Keith Date: Tue, 20 Mar 2018 16:22:52 -0400 Subject: [PATCH 4/5] Reduce number of builds by removing WP 4.7 in PHP > 7 Updated version of the table in https://github.com/INN/WP-DS-NPR-API/pull/13/commits/09d72a8aa6a7c205ab54e8f1cd362879dd90a0d3: Based on research in npr/pmp-php-sdk#36, Travis CI runs tests using the following PHPUnit versions: - PHP 5.6: PHPUnit 5.7.23 - PHP 7: PHPUnit 6.4.3 - PHP 7.1: PHPUnit 6.4.3 - PHP 7.2: PHPUnit 7.0.2 Reasons that given versions of WordPress have tests incompatible with travis-ci.org: 1. There are PHP warnings about deprecated PHP-4-style constructors. 2. Requires PHPUnit 5 because PHPUnit 6 support was not included until WordPress 4.7. 3. Unless there's been an update since [this trac thread](https://core.trac.wordpress.org/ticket/39822), WordPress tests still assume PHPUnit 6, and Travis runs PHP 7.2 tests with PHPUnit 7 | phpunit | 5.7 | 6.4 | 6.4 | 7.0 | | | | php | 5.6 | 7.0 | 7.1 | 7.2 | | | | WP | | | | | wp release year | then-current php | |---------|-----|-----|-----|-----|-----------------|------------------| | 3.8 | | 1 | 1 | 1 | 2013 | | | 3.9 | | 1 | 1 | 1 | 2014 | 5.5 | | 4.0 | | 1 | 1 | 1 | 2014 | 5.5 | | 4.1 | | 1 | 1 | 1 | 2014 | 5.5 | | 4.2 | | 2 | 2 | 2 | 2015 | 5.6 | | 4.3 | | 2 | 2 | 2 | 2015 | 5.6 | | 4.4 | | 2 | 2 | 2 | 2015 | 7.0 | | 4.5 | | 2 | 2 | 2 | 2016 | 7.0 | | 4.6 | | 2 | 2 | 2 | 2016 | 7.0 | | 4.7 | | 2 | 2 | 2 | 2016 | 7.1 | | 4.8 | | | | 3 | 2017 | 7.1 | | 4.9 | | | | 3 | 2017 | 7.2 | --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88bb5fc..017325e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,14 +55,10 @@ matrix: env: WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - php: 5.6 env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - php: 7.0 - env: WP_VERSION=4.7 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - php: 7.0 env: WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - php: 7.0 env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - - php: 7.1 - env: WP_VERSION=4.7 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - php: 7.1 env: WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - php: 7.1 From 899e38dcc0bac1c6aecf3700b8ebbf107273cf4a Mon Sep 17 00:00:00 2001 From: Ben Keith Date: Tue, 20 Mar 2018 16:48:20 -0400 Subject: [PATCH 5/5] Comment the include matrix on PHPUnit versions --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 017325e..2975f05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ language: php # for a breakdown of why these versions were chosen, see https://github.com/INN/WP-DS-NPR-API/issues/12#issuecomment-374730094 matrix: include: + # PHPUnit 5 - php: 5.6 env: WP_VERSION=3.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - php: 5.6 @@ -55,14 +56,17 @@ matrix: env: WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - php: 5.6 env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + # PHPUnit 6 - php: 7.0 env: WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - php: 7.0 env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + # PHPUnit 6 - php: 7.1 env: WP_VERSION=4.8 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress - php: 7.1 env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress + # PHPUnit 7 not supported by WordPress branches: only: