Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHPUnit test workflow for multisite #5701

Closed
johnwatkins0 opened this issue Dec 16, 2020 · 5 comments · Fixed by #7321
Closed

Add PHPUnit test workflow for multisite #5701

johnwatkins0 opened this issue Dec 16, 2020 · 5 comments · Fixed by #7321
Labels
Changelogged Whether the issue/PR has been added to release notes. Groomed P2 Low priority Testing Issues related with Unit, E2E, Smoke, and other testing requirements/needs WS:Core Work stream for Plugin core
Milestone

Comments

@johnwatkins0
Copy link
Contributor

Feature description

Some relatively recent additions to the plugin have involved small customizations related to multisite environments (example). Currently we only run PHPUnit tests in single-site environments, so there's no easy way to write tests for these features.

Potentially useful for reference:

https://github.com/WordPress/wordpress-develop/blob/master/tests/phpunit/multisite.xml
https://github.com/WordPress/wordpress-develop/blob/master/.github/workflows/phpunit-tests.yml#L257


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@johnwatkins0 johnwatkins0 added the WS:Core Work stream for Plugin core label Dec 16, 2020
@westonruter westonruter added the Testing Issues related with Unit, E2E, Smoke, and other testing requirements/needs label Dec 16, 2020
@kmyram kmyram added Groomed P2 Low priority labels Jan 19, 2021
@thelovekesh thelovekesh self-assigned this Oct 31, 2022
@thelovekesh
Copy link
Collaborator

@westonruter I am planning to add multisite tests workflow using wp-env. Which WP and PHP versions it should cover? or it should be the same as current test workflows. In this case, we will be having 2x test workflows.

@westonruter
Copy link
Member

Just adding one additional test with the latest WP version and PHP 7.4 should be good, as that corresponds to the majority of installs.

@westonruter
Copy link
Member

As part of this, could you also add a local development command using the Docker environment to test multisite? Maybe you're planning to do that anyway for debugging the current failures anyway.

@thelovekesh
Copy link
Collaborator

I have added it as a command and it uses the wp-env.

"test:php:multisite": "wp-env run phpunit 'env WP_MULTISITE=1 WP_PHPUNIT__TESTS_CONFIG=/wordpress-phpunit/wp-tests-config.php WORDPRESS_TABLE_PREFIX=wptests_ WP_TESTS_DIR=/var/www/wordpress-develop/tests/phpunit /var/www/html/wp-content/plugins/amp/vendor/bin/phpunit -c /var/www/html/wp-content/plugins/amp/phpunit.xml.dist $npm_config_args'",

@westonruter westonruter added this to the v2.3.1 milestone Nov 24, 2022
@westonruter westonruter modified the milestones: v2.3.1, v2.4 Jan 26, 2023
@thelovekesh
Copy link
Collaborator

thelovekesh commented Feb 3, 2023

QA Passed ✅

PHPUnit tests workflow for multisite is up and running with PHP 7.4 and WP latest.

See job or explore the action runs for the Build Test & Measure workflow in the Actions tab.

image

@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelogged Whether the issue/PR has been added to release notes. Groomed P2 Low priority Testing Issues related with Unit, E2E, Smoke, and other testing requirements/needs WS:Core Work stream for Plugin core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants