Commit d6bd82865c removed apigen from
WooCommerce core repository as we are moving it to its own repository (https://github.com/woocommerce/woocommerce-api-docs). This
commit removes the apigen from configuration files. In most cases, it is
just removing the apigen directory from the exclude list of things like
PHPCS and Code Climate.
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.
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.
This commit changes the regular expression used to determine the WP_TESTS_TAG variable to ignore WP beta releases otherwise install_test_suite() will fail to download the test suite. This is part of workaround to run WooCommerce unit tests using PHP 7.3 and WP 5.0 beta-5.
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 ::
This will skip the uploading of screenshots if the S3 key is not present. This will happen when there is a PR for a fork submitted.
* Skip upload from forks
* trying with failing test
* Fixing tests
* need a rebuild
This commit adds a check before the code that uploads screenshots of failed e2e tests to make it run only if running the Travis build job that executed the tests and if the screenshots/ directory is not empty. There is no need to always download Travis artifacts and try to upload to S3 if there is nothing to upload.
This adds screenshots for broken e2e tests. The screenshots will also be uploaded to an Amazon S3 instance from Travis CI so they can be viewed. If run locally, there will be a screenshots directory created where they can be viewed
If there is a failed e2e test you'll see a block under `travis.sh after` in the build log in Travis CI that will give the URLs for the images.
* Adding screenshot capabilities to all tests
* trying screenshots on S3
* try to get a failed test
* finding the right path
* fixing yml
* only taking failed screenshots
* fixing yml
* moving paths to env
* fixing target
* try without artifact target
* fixing test
* setting back temporary changes
* fixing spacing
* unneeded change
* trying different uploader
* Force a failed test
* fixing test again
* fixing unneeded change
* updating git ignore
This commit renames PHPCS configutarion file to `phpcs.xml`. With the default name, it is not necessary to use the argument `--standard=phpcs.ruleset.xml` anymore when calling `phpcs`.
This commit removes the command to install PHPUnit on every Travis build job. I'm doing this because I don't see a reason for WooCommerce to re-install PHPUnit since it is already installed by default on every build job. Travis automatically handles installing the right PHPUnit version for each PHP version that we use.
This change should save around 10 seconds from each build job (https://travis-ci.org/woocommerce/woocommerce/jobs/306623161#L515).
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.
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.
This commit removes Xdebug from PHP runtime on all build jobs except PHP 7.1 to speed up Travis builds. Xdebug is needed in the PHP 7.1 build job because this job is used to generate code coverage.