doctor-command icon indicating copy to clipboard operation
doctor-command copied to clipboard

Adapt package structure

Open schlessera opened this issue 3 years ago • 10 comments

This PR makes changes to the package structure to fit the one from the bundled plugins:

  • Use WP_CLI\Doctor as the namespace root
  • Use PSR-4 autoloader
  • Use latest wp-cli-tests framework with Behat v3

schlessera avatar Jan 13 '22 03:01 schlessera

@schlessera What do you think about punting on the namespace change, and simply applying the safe bits?

danielbachhuber avatar Jan 24 '23 23:01 danielbachhuber

@schlessera @danielbachhuber Apologies for the noise here, but I thought I'd pick this up and help fix all the failing tests. This is now ready for review!

I don't mind the namespace change, I think it should be fine. Just noting that this handbook page needs updating after merge: https://github.com/wp-cli/handbook/blob/7c792d2a11448dab77f23d8055f82553e6dff2a6/doctor-customize-config.md

swissspidy avatar Nov 03 '23 13:11 swissspidy

Makes sense.

Btw, any idea why this one test is failing on 6.2? The 3.7 one I haven‘t looked into yet

swissspidy avatar Nov 04 '23 11:11 swissspidy

Btw, any idea why this one test is failing on 6.2?

$ wp core version
6.2
$ wp core check-update
+---------+-------------+-----------------------------------------------------------------------+
| version | update_type | package_url                                                           |
+---------+-------------+-----------------------------------------------------------------------+
| 6.2.3   | minor       | https://downloads.wordpress.org/release/wordpress-6.2.3-partial-0.zip |
| 6.3.2   | major       | https://downloads.wordpress.org/release/wordpress-6.3.2.zip           |
+---------+-------------+-----------------------------------------------------------------------+
$ wp doctor check core-update
+-------------+--------+----------------------------------------------------------------------+
| name        | status | message                                                              |
+-------------+--------+----------------------------------------------------------------------+
| core-update | error  | Updating to WordPress' newest minor version is strongly recommended. |
+-------------+--------+----------------------------------------------------------------------+
Error: 1 check reports 'error'.

It looks like main is passing because behat.yml isn't detected and no tests are being run.

danielbachhuber avatar Nov 04 '23 12:11 danielbachhuber

Yes, that I realized. That‘s why I did all these commits to fix tests. Just thought it was weird that it failed for that particular job. But I can adapt the test 👍

swissspidy avatar Nov 04 '23 12:11 swissspidy

OK looks like @require-wp-latest doesn't seem to actually work 🤔

swissspidy avatar Nov 06 '23 12:11 swissspidy

OK looks like @require-wp-latest doesn't seem to actually work 🤔

@swissspidy Lovely. Maybe it's not actually a thing!

For Scenario: WordPress is up to date, you could run wp core update prior to wp doctor check core-update. I'd probably do the same for Scenario: Use --spotlight to focus on warnings and errors.

danielbachhuber avatar Nov 06 '23 22:11 danielbachhuber

Thanks, yeah I‘ll try that again.

Amd then I guess I‘ll review all existing usage of @require-wp-latest in the code base 🤔

Any idea on the WP 3.7 test? Can‘t run them locally as I don‘t have old PHP installed.

swissspidy avatar Nov 06 '23 23:11 swissspidy

Any idea on the WP 3.7 test? Can‘t run them locally as I don‘t have old PHP installed.

Nothing immediately obvious, no.

danielbachhuber avatar Nov 06 '23 23:11 danielbachhuber

Now there are some random errors from extension command as well, like Warning: twentyeleven: version higher than expected.. Core bumped their versions yesterday but they haven't been released yet in the theme directory. So probably should go away after the 6.4 release tomorrow 🤷

I'll leave this PR be for now, maybe someone else wants to pick it up.

swissspidy avatar Nov 07 '23 15:11 swissspidy