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 shortcuts to simplify running PHPUnit tests for standalone plugins #1017

Merged

Conversation

felixarntz
Copy link
Member

Summary

See #946 (comment): This PR adds shortcuts to simplify running PHPUnit tests for the new standalone plugins in a way that the new plugins only have to be added to composer.json and are then easy to test.

The way the shortcuts are defined is heavily inspired by #1002.

Usage

  • composer test:auto-sizes: Tests the Auto Sizes plugin on single site.
  • composer test-multisite:auto-sizes: Tests the Auto Sizes plugin on multisite.
  • composer test:plugins: Tests all standalone plugins on single site.
  • composer test-multisite:plugins: Tests all standalone plugins on multisite.
  • composer test:all: Tests all standalone plugins plus Performance Lab on single site.
  • composer test-multisite:all: Tests all standalone plugins plus Performance Lab on multisite.

There's also an NPM shortcut specifically for the GitHub workflow to test all standalone plugins:

  • npm run test-php-plugins: Wraps composer test:plugins.
  • npm run test-php-multisite-plugins: Wraps composer test-multisite:plugins.

Checklist

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

@felixarntz felixarntz added [Type] Enhancement A suggestion for improvement of an existing feature Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release Creating standalone plugins labels Feb 27, 2024
Copy link

github-actions bot commented Feb 27, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: felixarntz <flixos90@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but long term we should find something more scalable for this kind of scripts when we have more plugins.

@felixarntz felixarntz merged commit eb67d38 into feature/modules-to-plugins Feb 27, 2024
51 checks passed
@felixarntz felixarntz deleted the enhance/phpunit-plugin-tests-shortcuts branch February 27, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants