Commit Graph

173 Commits

Author SHA1 Message Date
Julia Amosova 8fb30e8f5b Add `npm run build` to travis / docker setup 2019-12-03 21:24:58 +00:00
Julia Amosova f95e3c0e11 More Travis + Docker setup tweaks 2019-12-03 19:17:32 +00:00
Julia Amosova 4b26146613 Additional Travis + Docker setup tweaks 2019-12-03 19:07:43 +00:00
Julia Amosova 37e367f379 Resolve conflicts with master branch 2019-12-03 18:49:28 +00:00
Julia Amosova 4c8c4a8dbf Adjust Travis + Docker setup 2019-12-03 18:43:33 +00:00
Rodrigo Primo c3f92f148f Use latest PHP version to run Travis build jobs
This commit updates Travis configuration to use the latest PHP version
to run build jobs for e2e tests, coding standard checks, unit test code
coverage and for running unit tests using WP nightly. For those jobs we
want to always use the latest PHP version.
2019-12-02 11:50:36 -03:00
Rodrigo Primo 1ce283eb65 Use PHP 7.4 instead of PHP 7.4snapshot in Travis
This commit simply updates the PHP 7.4 version that is used in Travis
now that PHP 7.4 has been officially released. Previously we were using
RC versions to test the upcoming release.
2019-12-02 11:15:38 -03:00
Julia Amosova a7e582b1bb Update docker-compose file & setup running e2e tests on Travis CI 2019-11-26 20:34:00 +00:00
Gerhard e0e05928c8 Move E2E tests to allowed_failures section while we wrap up new e2e tests. 2019-11-25 13:37:30 +02:00
Rodrigo Primo 3482dd3a79 Remove PHP 7.4 job from the list of Travis jobs allowed to fail
Now that WP fixed all the PHP 7.4 related notices and that the WC unit
tests are passing when running against this PHP version, we can remove
the PHP 7.4 from the list of Travis jobs that are allowed to fail.
2019-09-23 14:38:27 -03:00
Rodrigo Primo 9399224f9e Add PHP 7.4 to the list of Travis build jobs
This commit adds the upcoming PHP 7.4 to the list of Travis build jobs
so that we can start testing WooCommerce with this new version of PHP
that is scheduled to be released in November.
2019-08-23 08:34:30 -03:00
Gerhard 4eae977494 Chrome beta 2019-08-05 15:09:49 +02:00
Gerhard e7ce889c9c Use start-stop deamon 2019-08-05 14:52:43 +02:00
Gerhard 862c43c553 xvfb needs to be started in before_script 2019-08-05 14:43:54 +02:00
Gerhard 5a9cb3e862 Include headless browser in services 2019-08-05 14:34:42 +02:00
Gerhard a58cced761 Instruct mysql to start 2019-08-05 14:33:51 +02:00
Gerhard 4b624bc477 Xenial not Bionic 2019-08-05 14:29:09 +02:00
Gerhard c078fdb9e1 Update travis dist to bionic, bionic has support for PHP 5.6 and up. 2019-08-05 14:20:22 +02:00
Claudio Sanches d09009261f Fixed UnitTests in PHP 5.6 2019-07-18 22:46:28 -03:00
Claudio Sanches 838dd31e00 Updated PHPUnit in Travis 2019-07-18 22:09:12 -03:00
Claudio Sanches da99bc8ca0 Merge branch 'master' into feature/feature-plugin-packages 2019-07-08 14:33:21 -03:00
Peter Fabian 8c0bf2795f Install sniffs only when running PHPCS. 2019-07-04 10:17:39 +02:00
Mike Jolley 3b974da08f Update readme and contributing docs 2019-06-26 17:20:47 +01:00
Mike Jolley ddc8ccf104 Fix travis config 2019-06-26 17:02:31 +01:00
Mike Jolley 26391f3fb6 composer install for travis 2019-06-26 16:25:16 +01:00
Peter Fabian c4b48eb64e Fix WP version to 5.1.1, last one that supports PHP < 5.6. 2019-06-13 15:43:59 +02:00
Gerhard a2953da9ad Bump minimum PHP version to 5.6, update travis to remove 5.2 and 5.3 tests. 2019-06-13 11:28:18 +02:00
Mike Jolley aa301bda4c
Merge pull request #23106 from rodrigoprimo/travis-chromedriver
Only install Chrome and Nginx in the build job that uses it
2019-03-27 11:54:59 +00:00
Rodrigo Primo 6001b0177e Only install Chrome and Nginx in the build job that uses it
This commit changes Travis configuration to only install Chrome and Nginx in the e2e tests build job, which is the only one that requires those packages. This change should save a little bit of time in the Travis build as before Travis was installing Chrome and Nginx in all the jobs.
2019-03-21 15:44:02 -03:00
Rodrigo Primo 61a096d871 Fix PHPCS in the Travis builds
PR https://github.com/woocommerce/woocommerce/pull/23082 made some changes to the Travis configuration and one of those changes broke the PHPCS when running inside Travis with the following error:

```
ERROR: Referenced sniff "WooCommerce-Core" does not exist
```

For example: https://travis-ci.org/woocommerce/woocommerce/jobs/509471213#L659

This problem went unnoticed during the PR review as no PHP file was modified in it and thus there was no file for PHPCS to check.

This commit fixes the error above by installing the Composer package `woocommerce/woocommerce-sniffs` which is the package that provides `WooCommerce-Core` sniffs and which installs `wp-coding-standards/wpcs` as one of its requirements. I couldn't find an easy way to make this work installing `woocommerce/woocommerce-sniffs` globally so that is why this commit also removes the `global` parameter when calling composer.
2019-03-21 15:23:42 -03:00
Gerhard 589f561c5e Restore cache 2019-03-19 15:46:24 +02:00
Gerhard 0a1eb076ea Add PHPUnit call fallback for 5.2 specifically 2019-03-19 15:23:36 +02:00
Gerhard 506b1cec55 Restore Codecoverage to PHP 7.1 2019-03-19 15:17:11 +02:00
Gerhard 608579e987 Also update the include matrix with right version info for codecoverage 2019-03-19 15:05:14 +02:00
Gerhard 323935a1e8 Remove cache as it might cause issues with Scrutinizer 2019-03-19 14:57:19 +02:00
Gerhard 0824423752 Run Codecoverage using PHP 7.3 2019-03-19 14:48:45 +02:00
Gerhard a59969ca53 Do not try to run composer on PHP 5.2 and default to phpunit command instead of specifying path, travis will first try and look for in the composer dirs. 2019-03-19 14:30:54 +02:00
Gerhard cb6b43528a Add 5.3 to PHP versions 2019-03-19 14:20:28 +02:00
Gerhard 978b94c44f Move back to precise 2019-03-19 14:09:53 +02:00
Gerhard b06caa4fbf Workaround for PHP5.2 and Composer 2019-03-19 14:01:14 +02:00
Gerhard e2d68820a5 Use xenial instead of precise 2019-03-19 13:53:23 +02:00
Gerhard dc99c30772 Move phpunit call after first params 2019-03-19 13:33:21 +02:00
Gerhard b105550b47 Changes to travis, globally install phpunit and wpcs when required, cache vendor and composer cache directories 2019-03-19 13:14:42 +02:00
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
Ramon van Belzen f97f2c603a travis-ci: test with php 7.1 2016-12-05 08:14:56 +01:00
Claudio Sanches 0d803ef5a1 PHPunit already looks for syntax errors 2016-09-13 17:45:40 -03:00
Aristeides Stathopoulos b70f62bfa9 Add 4th-level-deep tests 2016-09-08 00:34:39 +03:00
Aristeides Stathopoulos f6af54cb72 no need for verbose-mode phpcs tests. 2016-09-08 00:33:34 +03:00
Aristeides Stathopoulos cdf70bb953 don't run phpcs on the vendor folder. 2016-08-27 20:06:32 +03:00
Aristeides Stathopoulos 9bf8eb861c indentation 2016-08-27 19:53:46 +03:00
Aristeides Stathopoulos 7aa3a0fc9e move scripts 2016-08-27 19:52:45 +03:00