Skip to content

Commit

Permalink
Tests: consistency in terminology
Browse files Browse the repository at this point in the history
The "integration" tests are being renamed to "WP (unit) tests".

This commit updates the references to these tests in the Composer scripts and the GH Actions workflows to follow the new terminology.

Note: the "old" `integration-test` and `integration-coverage` Composer scripts will still be available for the time being to facilitate the switch over and give the teams a little time to get used to the new script names.
  • Loading branch information
jrfnl committed Oct 4, 2023
1 parent 1d842f2 commit 03edba0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
COVERALLS_FLAG_NAME: php-${{ matrix.php_version }}
run: php-coveralls -v -x build/logs/clover.xml

integration-test:
wp-test:
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
multisite: true
coverage: true

name: "Integration Test: PHP ${{ matrix.php_version }} | WP ${{ matrix.wp_version }}${{ matrix.multisite == true && ' (+ ms)' || '' }}"
name: "WP Test: PHP ${{ matrix.php_version }} | WP ${{ matrix.wp_version }}${{ matrix.multisite == true && ' (+ ms)' || '' }}"

# Allow builds to fail on as-of-yet unreleased WordPress versions.
continue-on-error: ${{ matrix.wp_version == 'trunk' }}
Expand Down Expand Up @@ -208,23 +208,23 @@ jobs:
shell: bash
run: config/scripts/install-wp-tests.sh wordpress_test root '' 127.0.0.1:3306 ${{ matrix.wp_version }}

- name: Run integration tests - single site
- name: Run WP tests - single site
if: ${{ matrix.coverage == false }}
run: composer integration-test
run: composer test-wp

- name: Run integration tests - multisite
- name: Run WP tests - multisite
if: ${{ matrix.multisite == true && matrix.coverage == false }}
run: composer integration-test
run: composer test-wp
env:
WP_MULTISITE: 1

- name: Run integration tests with code coverage - single site
- name: Run WP tests with code coverage - single site
if: ${{ matrix.coverage == true }}
run: composer integration-coverage
run: composer coverage-wp

- name: Run integration tests with code coverage - multisite
- name: Run WP tests with code coverage - multisite
if: ${{ matrix.multisite == true && matrix.coverage == true }}
run: composer integration-coverage -- --coverage-clover build/logs/clover-integration-ms.xml
run: composer coverage-wp -- --coverage-clover build/logs/clover-wp-ms.xml
env:
WP_MULTISITE: 1

Expand All @@ -246,16 +246,16 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: intgr-php-${{ matrix.php_version }}-wp-${{ matrix.wp_version }}
run: php-coveralls -v -x build/logs/clover-integration.xml
COVERALLS_FLAG_NAME: php-${{ matrix.php_version }}-wp-${{ matrix.wp_version }}
run: php-coveralls -v -x build/logs/clover-wp.xml

- name: Upload coverage results to Coveralls - multisite
if: ${{ success() && matrix.multisite == true && matrix.coverage == true }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: intgr-php-${{ matrix.php_version }}-wp-${{ matrix.wp_version }}-ms
run: php-coveralls -v -x build/logs/clover-integration-ms.xml
COVERALLS_FLAG_NAME: php-${{ matrix.php_version }}-wp-${{ matrix.wp_version }}-ms
run: php-coveralls -v -x build/logs/clover-wp-ms.xml

coveralls-finish:
needs: [unit-test, integration-test]
Expand Down
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@
"coverage": [
"@php ./vendor/phpunit/phpunit/phpunit"
],
"integration-test": [
"test-wp": [
"@php ./vendor/phpunit/phpunit/phpunit -c phpunit-wp.xml.dist --no-coverage"
],
"integration-coverage": [
"coverage-wp": [
"@php ./vendor/phpunit/phpunit/phpunit -c phpunit-wp.xml.dist"
],
"integration-test": [
"@test-wp"
],
"integration-coverage": [
"@coverage-wp"
]
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit-wp.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<logging>
<log type="coverage-text" target="php://stdout" showOnlySummary="true"/>
<log type="coverage-clover" target="build/logs/clover-integration.xml"/>
<log type="coverage-clover" target="build/logs/clover-wp.xml"/>
</logging>

</phpunit>

0 comments on commit 03edba0

Please sign in to comment.