Commit Graph

80 Commits

Author SHA1 Message Date
Rodrigo Primo c17aba608e Add a new Travis job to run WC unit tests using WordPress nightly
Doing this to help us find problems in the upcoming versions of WordPress.
2019-01-16 09:09:54 -02:00
Rodrigo Primo 540d10cbc0 Use WP latest instead of 5.0-beta3 to run the PHP 7.3 Travis build job
Now that WP 5.0 has been released, we don't need to use 5.0-beta3 anymore to run the PHP 7.3 Travis build job.
2018-12-19 11:53:46 -02:00
Rodrigo Primo 87e47cd1a8 Use the "name" config property to better identify build jobs 2018-12-19 11:08:32 -02:00
Rodrigo Primo 644f6b1cba Use separate Travis build jobs to run e2e tests and PHPCS
This commit creates two new Travis build jobs, one to run the e2e tests and another to run PHPCS. Doing this, instead of running those two checks in the same build job as the PHP 7.2 unit tests, should make the total build time shorter and it should make it easier to see why the build failed.
2018-12-06 09:14:13 -02:00
Rodrigo Primo 522df96217 Make sure PHPUnit tests runs when using PHP 7.2+ in the Travis builds
Due to a recent change in the Travis environment, WooCommerce unit tests stopped working with the following error (see for example https://travis-ci.org/woocommerce/woocommerce/jobs/463470674#L876) in the PHP 7.2 and 7.3 build jobs:

Fatal error: Class PHPUnit_Util_Test may not inherit from final class (PHPUnit\Util\Test) in /tmp/wordpress-tests-lib/includes/phpunit6-compat.php on line 18

This error is happening because Travis started ignoring the PHPUnit version that we install manually via Composer (f7bc3fb851/tests/bin/travis.sh (L6)) and started using the PHPUnit version that is shipped with each of its PHP docker images. This means that for the docker images running PHP 7.2 and 7.3, PHPUnit 7 is used but the WordPress unit test framework is not compatible with PHPUnit 7 (see WordPress core ticket https://core.trac.wordpress.org/ticket/43218) and produces the error above. I believe that this is happening because Travis changed the directory where it installs composer global packages from `$HOME/.composer/` to `$HOME/.config/composer/` (https://github.com/travis-ci/travis-ci/issues/7289#issuecomment-427333966) and we add `$HOME/.composer/vendor/bin:$PATH` to the `$PATH`. So this commit simply updates the path in the line where we add it to the `$PATH`.

I tried to use `composer exec` instead of updating `$PATH` but that didn't work for PHP 5.2.
2018-12-05 15:15:49 -02:00
Rodrigo Primo 4c581f5a87 Remove PHP 7.3 from the list of build jobs that are allowed to fail
Now that all the required changes to make WooCommerce work fine with PHP 7.3 were implemented, it is safe to remove PHP 7.3 from the list of Travis build jobs that are allowed to fail.
2018-11-21 12:30:06 -02:00
Rodrigo Primo 68abf960f4 Use WP 5.0-beta5 when running PHP 7.3 in Travis
To make it easier to test WC running the upcoming PHP 7.3, this commit changes the PHP 7.3 Travis build to run unit tests using WP 5.0-beta5. This way we won't display WP core warnings related to PHP 7.3 that were already fixed in the upcoming WP version and will be able to see only WC related warnings.

My initial plan was to use WP nightly but that didn't work as nightly is still build from trunk and WP 5.0 development is being done on another branch (https://make.wordpress.org/core/2018/10/05/wordpress-5-0-commit-management/).
2018-11-20 14:43:27 -02:00
Rodrigo Primo 9fac8cc8ad Remove xdebug.ini only if it exists
This commit adds an if to check if xdebug.ini exists before trying to remove it. Doing this to avoid a build error in PHP versions where the file doesn't exist like PHP 7.3.
2018-10-16 10:36:25 -03:00
Rodrigo Primo fcf4e56d0d Add upcoming PHP 7.3 to the list of versions tested in Travis 2018-10-16 10:22:29 -03:00
Rodrigo Primo 67b5b270f3 Retry e2e tests automatically in case of failure
Tests should be consistent. That is true for our unit tests suite, but it is something that is harded to achieve for functional tests. Our end to end tests often times fail due to factors outside of our control, and simply manually restarting the Travis build is enough to make them pass (example: https://github.com/woocommerce/woocommerce/pull/21150#issuecomment-415132390). This commits uses `travis_retry` to make Travis automatically retry a maximum of three times to run WC e2e tests in case of a failure.
2018-08-23 16:20:41 -03:00
Gerhard Potgieter 8aba169654 Switch travis codecoverage from xdebug to phpdbg (#20857)
This commit changes the travis codecoverage from using xdebug to phpdbg, phpdbg seems much faster and gives similar results.

Reason for switching is we have been running into constant timeouts on our codecoverage due to the 50min job limit on travis, which means our codecoverage has not been updated in a couple of months.

* Remove xdebug as it slows tests down, switch to using phpdbg for code coverage.

* Update parameters for phpdbg

* It is qrr not qqr

* Include vendor/bin path when using phpdbg

* Use PHP 7.1 to run phpdbg

* Update phpunit dire

* Include $HOME in phpdbg call to phpunit

* Set no memory limit to avoid out of memory errors.

* Assign timeout group to test_request_url test for paypal and do not execute that on coverage as it causes a memeory timeout. Test needs optimization to run for code coverage.

* @covers usage for methods should be prefixed with ::
2018-07-20 09:34:43 -03:00
Brent Sessions e372d55a3c Run e2e tests on Travis builds (#18374) 2018-01-18 16:42:19 -02:00
Rodrigo Primo c524f5b77f Run unit tests against PHP 7.2 as well on Travis 2017-12-11 13:56:47 -02:00
Claudio Sanches 39e27196c4
Merge pull request #17853 from rodrigoprimo/fix/run-phpcs-only-once
Don't run PHPCS on the code coverage Travis job
2017-11-22 12:16:34 -02:00
Rodrigo Primo 47154cf29a Don't run PHPCS on the code coverage Travis job
PR #17680 added a new PHP 7.1 Travis build job to generate code coverage report. PHPCS was configured to run on all PHP 7.1 build jobs. So this means that after #17680 was merged, Travis started running PHPCS twice.

This commit fixes this issue by setting a new environment variable called `$RUN_PHPCS` and using this variable, instead of the PHP version, to decide when to run PHPCS.
2017-11-21 18:17:55 -02:00
Rodrigo Primo 742cd367b0 Prevent Travis builds duplication
This commit changes Travis configuration file to specify a list of branches that it should build. This way Travis will only create a new build when a commit is pushed to the master branch and release branches and when tags are created. The behavior for PRs is not modified and PR creation and updates will still trigger builds.

Doing this to speed up Travis build by preventing it from running two builds for PR that are created from a branch of the same repository. Before this change, Travis would create a build when the branch is pushed to GitHub (continuous-integration/travis-ci/push) and another one when the PR is created (continuous-integration/travis-ci/pr). For an example, see https://github.com/woocommerce/woocommerce/pull/17680.
2017-11-21 11:28:12 -02:00
Mike Jolley 387093cd27
Merge pull request #17687 from rodrigoprimo/update/remove-unnecessary-travis-config
Travis configuration cleanup
2017-11-14 10:21:15 +00:00
Rodrigo Primo 5078359eca Remove unnecessary Travis environment variable PHP_LATEST_STABLE 2017-11-13 17:24:52 -02:00
Rodrigo Primo 9188f814c3 Remove unused Travis environment variable
This commit removes the unused Travis enrivonment variable PHP_LATEST_STABLE.
2017-11-13 17:22:46 -02:00
Rodrigo Primo d847323867 Remove unnecessary Travis configuration
It is not necessary to declare environment variables for a specific build job if they are the same as the environment variables declared for all build jobs.
2017-11-13 17:18:31 -02:00
Rodrigo Primo 2dcb04e2e2 Generate code coverage report on a separate non-blocking Travis job
Travis build is taking about 40 minutes to complete, and that is mostly because of the generation of the code coverage report.

To address that, this commit changes Travis configuration to run the command to generate code coverage report on a separate non-blocking Travis job. This way once the jobs that run the tests finishes, Travisi will mark the build as successful and will keep running code coverage on a separate job.
2017-11-13 15:57:11 -02:00
Claudio Sanches c95137f9c0 Moved phpcs after phpunit 2017-10-10 10:50:22 -03:00
Claudio Sanches ab04636ef0 Adds PHPCS in Travis CI 2017-10-09 17:31:15 -03:00
Claudio Sanches cd554c1bdf Restored tests/bin/phpunit.sh 2017-10-05 13:14:56 -03:00
Mike Jolley 212449f391 Only generate coverage on 7.x 2017-09-26 14:09:27 +01:00
Mike Jolley 66f253e4a3 phpunit tweak 2017-09-26 13:29:13 +01:00
Mike Jolley be014346f1 Travis 2017-09-26 13:24:11 +01:00
Mike Jolley 80748089c4 Travis 2017-09-26 13:18:56 +01:00
Mike Jolley a028bcaec3 Codecov config 2017-09-26 12:59:15 +01:00
Mike Jolley 2f294a47d8 version 2017-08-22 12:02:47 +01:00
Mike Jolley 901a70268b test tweak 2017-08-22 11:02:39 +01:00
Claudio Sanches c5055ed2f7 Tidy up Scrutinizer, PHPUnit and Travis config 2017-07-21 14:25:27 -03:00
Claudio Sanches 4251bd5614 Move code coverage to Scrutinizer 2017-07-20 16:50:12 -03:00
Mike Jolley a7fec4475f 5.3 does not like dist 2017-07-20 15:55:45 +01:00
Mike Jolley 80cbba49d6 More test tweaks 2017-07-20 15:41:28 +01:00
Mike Jolley b14c719fc0 Travis 2017-07-20 12:39:46 +01:00
Mike Jolley 1c26587948 travis 2017-07-20 12:12:29 +01:00
Mike Jolley 3fbba9d869 More travis config 2017-07-20 12:00:21 +01:00
Mike Jolley aa7f823763 Travis config 2017-07-20 11:42:53 +01:00
Mike Jolley c569d4fd81 Travis 2017-07-20 11:23:37 +01:00
Akeda Bagus 53807185a8
Fixed typos.
These typos are catched by `misspell` program.

```
find . -type f | grep -v assets | grep -v dummy-data | grep -v i18n | grep -v node_modules | grep -v .git | grep -v apigen |  xargs misspell -w
```

Some results were excluded because of 3rd party ownership and non-english
sentences.
2017-07-10 12:56:28 +07:00
Ramon van Belzen f186922683 travis-ci: remove hhvm from testing matrix 2017-05-29 18:12:30 +02:00
Mike Jolley cbe6934f61 Try in sh file so 5.2 does not break 2017-03-14 17:17:35 +00:00
Mike Jolley 0aad398144 Add to travis yml 2017-03-14 17:11:02 +00:00
Jon Surrell b67a3e0119 Unquote 7.1 in .travis.yml 2017-01-17 10:07:10 +01:00
Jon Surrell 9069bce4d3 Change travis setup to exclude coverage from all but latest stable
Add PHP_LATEST_STABLE env to travis

Use same bash conditional for test scripts
2017-01-16 21:11:21 +01:00
Jon Surrell 9d0d707c8a Allow failure for PHP 5.3 travis builds
Builds on this particular box fail randomly and very frequently.
2017-01-13 07:46:37 +01:00
Mike Jolley ab76036c1f Enable 7.1 tests 2017-01-11 12:58:10 +00:00
Mike Jolley fcf0ab0ba5 Tweak travis code to reduce test times. 2016-12-07 18:44:18 +00:00
Mike Jolley d1f4177c97 Allow fail because WP notices in tests. 2016-12-06 16:57:35 +00:00