Commit Graph

71 Commits

Author SHA1 Message Date
Gerhard cadcad2c6a Add the -s param to the PHPCS command to see the rules it is failing again when running the precommit hook. 2019-01-17 13:23:14 +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 8b85eee2d0 Ignore WP beta releases when setting WP_TESTS_TAG
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.
2018-11-20 14:43:38 -02: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
Gerhard Potgieter c3993accd4 Set SCRIPT_DEBUG to true for e2e tests since we never commit minified js during dev, only once we do a release do we minify scripts. 2018-07-19 09:06:11 +02:00
Brent Sessions 8fc43f0cad Skip upload from forks (#20462)
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
2018-06-11 13:59:59 -03:00
Rodrigo Primo cc4871e5ca Only try to upload screenshots if directory is not empty
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.
2018-06-07 11:50:36 -03:00
Brent Sessions c64a35300a Take screenshots of failed e2e tests (#20313)
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
2018-06-07 11:31:37 -03:00
Claudio Sanches e2e8a7bfd1 Fixed PHPUnit path 2018-02-27 14:24:40 -03:00
Claudio Sanches 1fcb5e8be3 Force PHPUnit 6 in Travis 2018-02-27 14:20:13 -03:00
Claudio Sanches 5a19861544 Run composer in all tests 2018-02-27 14:11:17 -03:00
Claudio Sanches 1239ab033f Use phpunit installed by composer while running tests on travis 2018-02-27 14:06:06 -03:00
Brent Sessions a01270f392 Rearranging some variables 2018-01-18 12:36:22 -08:00
Brent Sessions 45bf9d6805 Update install script to account for forked branch 2018-01-18 12:26:46 -08:00
Brent Sessions e372d55a3c Run e2e tests on Travis builds (#18374) 2018-01-18 16:42:19 -02:00
Rodrigo Primo bf052c14c7 Use default name for PHPCS configuration file
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`.
2017-12-18 11:49:44 -02:00
Rodrigo Primo 6f207d39f3 travis.sh cleanup
We don't call `composer install` for all PHP version anymore in this script, so it is not necessary to exit early if running PHP 5.2.
2017-11-24 10:36:42 -02:00
Rodrigo Primo 183078914b Travis: don't reinstall PHPUnit
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).
2017-11-24 10:23:30 -02:00
Rodrigo Primo 4fea2eb211 Disable Xdebug before calling composer 2017-11-23 09:13:09 -02:00
Rodrigo Primo 51867ac7c3 Remove Xdebug from PHP 5.3 Travis build job as well 2017-11-23 09:06:08 -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 d26310f9c8 Forgot to change the logic to update codecov to run on the non-blocking Travis job 2017-11-13 16:19:36 -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
Rodrigo Primo 89542a9fb8 Disable XDebug to speed up Travis builds
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.
2017-11-10 20:05:23 -02:00
Claudio Sanches b775074900 Fixed includes/wc-webhook-functions.php and removed debug 2017-10-10 12:59:04 -03:00
Claudio Sanches 2bd240ab15 Debug 2017-10-10 11:27:52 -03:00
Claudio Sanches f479d916e5 Fixed syntax error on phpcs.sh 2017-10-10 09:34:47 -03:00
Claudio Sanches 01cafe62d8 Updated phpcs.sh 2017-10-09 22:16:25 -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 1b8a955353 tweak travis script 2017-09-26 16:27:27 +01:00
Mike Jolley bf82c769e7 scrutinizer 2017-09-26 15:21:05 +01:00
Mike Jolley 49b3e7da78 Gen coverage only on latest stable 2017-09-26 14:38:50 +01:00
Mike Jolley 212449f391 Only generate coverage on 7.x 2017-09-26 14:09:27 +01:00
Mike Jolley be014346f1 Travis 2017-09-26 13:24:11 +01:00
Claudio Sanches 4251bd5614 Move code coverage to Scrutinizer 2017-07-20 16:50:12 -03:00
Claudio Sanches 5a918b8f93 Not install project composer file on Travis 2017-07-20 13:47:02 -03:00
Claudio Sanches 498a5daa53 Removed PHPCS from Travis in favor of pre-commit hook 2017-07-20 13:34:34 -03:00
Claudio Sanches c7ee52602a Updated PHPUnit version 2017-07-20 13:32:21 -03:00
Mike Jolley a7fec4475f 5.3 does not like dist 2017-07-20 15:55:45 +01:00
Mike Jolley 20f2c60f2d remove during 2017-07-20 15:43:40 +01:00
Mike Jolley 80cbba49d6 More test tweaks 2017-07-20 15:41:28 +01:00
Mike Jolley 1f1219599e remove quiet 2017-07-20 15:00:54 +01:00
Mike Jolley c72e2d6aab test 2017-07-20 14:34:16 +01:00
Mike Jolley 8654a94af2 update installer 2017-07-20 13:57:10 +01:00
Claudio Sanches fa472689d6 Stop download phpcs from GitHub and use the composer copy 2017-03-21 12:02:53 -03: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
Mike Jolley 178888fbdb Travis script 2017-03-14 16:59:40 +00:00
Mike Jolley ed09c20715 Trying to fix travis tests 2017-03-14 12:50:54 +00:00