Skip to content

Commit

Permalink
Merge pull request #599 from GoogleChromeLabs/update/phpunit-testing
Browse files Browse the repository at this point in the history
Fix PHP 8 unit testing
  • Loading branch information
westonruter authored Aug 23, 2021
2 parents 69dc3c2 + 01d91e8 commit c746f6a
Show file tree
Hide file tree
Showing 17 changed files with 438 additions and 121 deletions.
31 changes: 3 additions & 28 deletions .github/workflows/build-test-measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
cache: npm

- name: Install Node dependencies
run: npm ci
Expand Down Expand Up @@ -295,6 +284,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -311,18 +301,6 @@ jobs:
- name: Install Composer dependencies
run: composer install --prefer-dist --ignore-platform-reqs --no-progress --no-interaction

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install Node dependencies
run: npm ci
env:
Expand All @@ -339,9 +317,6 @@ jobs:
- name: Install WP tests
run: bash bin/ci/install-wp-tests.sh wordpress_test root '' 127.0.0.1:${{ job.services.mysql.ports['3306'] }} ${{ matrix.wp }} true

- name: Post install of WP tests
run: bash bin/ci/after-wp-install.sh ${{ matrix.wp }} /tmp/wordpress-tests

- name: Setup PCOV
if: ${{ matrix.coverage == true }}
# phpdocumentor/reflection has to be removed as it makes use of an outdated dependency, making pcov/clobber
Expand All @@ -366,7 +341,7 @@ jobs:

- name: Upload code coverage report
if: ${{ matrix.coverage == true }}
uses: codecov/codecov-action@v1.5.2
uses: codecov/codecov-action@v2.0.2
with:
file: ${{ env.WP_CORE_DIR }}/src/wp-content/plugins/pwa/build/logs/clover.xml
flags: php,unit
Expand Down
51 changes: 0 additions & 51 deletions bin/ci/after-wp-install.sh

This file was deleted.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"automattic/vipwpcs": "^2.2",
"civicrm/composer-downloads-plugin": "^3.0",
"dealerdirect/phpcodesniffer-composer-installer": "0.7.1",
"phpcompatibility/phpcompatibility-wp": "2.1.1",
"php-stubs/wordpress-stubs": "^5.3.2",
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5",
"wp-coding-standards/wpcs": "2.3.0"
"phpcompatibility/phpcompatibility-wp": "2.1.1",
"wp-coding-standards/wpcs": "2.3.0",
"yoast/wp-test-utils": "^0.2.2"
},
"config": {
"platform": {
Expand Down
Loading

0 comments on commit c746f6a

Please # to comment.