Skip to content

Commit

Permalink
Workflows: Prime a WP install and skip install for the actual test ru…
Browse files Browse the repository at this point in the history
…n. (#256)

The PHPUnit test workflow now performs a dummy run to prime the WordPress install for tests.

When this completes, the actual test run is performed, with the `WP_TESTS_SKIP_INSTALL` environment variable set to `1`.

Since many of the tests must run in separate processes, this change means that installation occurs only once, instead of once per process.
  • Loading branch information
costdev authored Jan 9, 2025
1 parent 3206ff0 commit e91ebec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,10 @@ jobs:
- name: Setup tests
run: bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true

- name: Prime the WordPress install for tests
id: prime-tests
run: XDEBUG_MODE=off phpunit${{ matrix.multisite && ' -c tests/phpunit/multisite.xml' || '' }} --filter gha_install_wp > /dev/null 2>&1

- name: Run tests
run: XDEBUG_MODE=off phpunit${{ matrix.multisite && ' -c tests/phpunit/multisite.xml' || '' }}
if: steps.prime-tests.outcome == 'success'
run: XDEBUG_MODE=off WP_TESTS_SKIP_INSTALL=1 phpunit${{ matrix.multisite && ' -c tests/phpunit/multisite.xml' || '' }}

0 comments on commit e91ebec

Please sign in to comment.