Skip to content

Commit

Permalink
Merge pull request liquidweb#41 from liquidweb/feature/code-coverage
Browse files Browse the repository at this point in the history
Code coverage reporting
  • Loading branch information
stevegrunwell authored Jan 24, 2018
2 parents 1c79a68 + 9463cd2 commit e2fe4bd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ matrix:
env: WP_VERSION=trunk WP_MULTISITE=1 WC_VERSION=latest
- php: 7.1
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest
- php: 7.1
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest RUN_CODE_COVERAGE=1
- php: 7.1
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=3.2.6
- php: 7.0
Expand All @@ -34,11 +36,19 @@ matrix:
allow_failures:
- php: 7.2
env: WP_VERSION=trunk WP_MULTISITE=1 WC_VERSION=latest

- php: 7.1
env: WP_VERSION=latest WP_MULTISITE=0 WC_VERSION=latest RUN_CODE_COVERAGE=1

before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- phpenv config-rm xdebug.ini
- |
if [[ ${RUN_CODE_COVERAGE} ]]; then
wget https://github.com/php-coveralls/php-coveralls/releases/download/v1.0.0/coveralls.phar
chmod +x coveralls.phar
mkdir -p build/logs
else
phpenv config-rm xdebug.ini
fi
- |
if [[ ${GITHUB_AUTH_TOKEN} != '' ]]; then
composer config -g github-oauth.github.com $GITHUB_AUTH_TOKEN
Expand All @@ -48,8 +58,19 @@ before_script:
- composer install --prefer-source

script:
- phpunit
- |
if [[ ${RUN_CODE_COVERAGE} ]]; then
phpunit --coverage-clover build/logs/clover.xml
else
phpunit
fi
- |
if [[ ${RUN_PHPCS} == 1 ]]; then
./vendor/bin/phpcs
fi
after_success:
- |
if [[ ${RUN_CODE_COVERAGE} ]]; then
travis_retry php coveralls.phar
fi
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ When submitting pull requests, please include relevant tests for your new featur

#### Test coverage

[![Coverage Status](https://coveralls.io/repos/github/liquidweb/woocommerce-custom-orders-table/badge.svg?branch=feature%2Fcode-coverage)](https://coveralls.io/github/liquidweb/woocommerce-custom-orders-table?branch=feature%2Fcode-coverage)

To generate a code coverage report (test coverage percentage as well as areas of untested or under-tested code that could pose risk), you run the following:

```sh
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# WooCommerce Custom Orders Table

[![Build Status](https://travis-ci.org/liquidweb/woocommerce-custom-orders-table.svg?branch=develop)](https://travis-ci.org/liquidweb/woocommerce-custom-orders-table)
[![Coverage Status](https://coveralls.io/repos/github/liquidweb/woocommerce-custom-orders-table/badge.svg?branch=feature%2Fcode-coverage)](https://coveralls.io/github/liquidweb/woocommerce-custom-orders-table?branch=feature%2Fcode-coverage)

This plugin improves WooCommerce performance by introducing a custom table to hold all of the most common order information in a single, properly-indexed location.

Expand Down

0 comments on commit e2fe4bd

Please sign in to comment.