wp-cli / wp-cli-tests

WP-CLI testing framework
MIT License
36 stars 22 forks source link

Properly support `@require-wp-latest` #190

Closed swissspidy closed 7 months ago

swissspidy commented 7 months ago

Bug Report

Describe the current, buggy behavior

I spotted a few instances of @require-wp-latest in our code base, but I don't think it actually works. At least that wasn't the case when I tried it at https://github.com/wp-cli/doctor-command/pull/165

run-behat-tests already grabs the latest version of WordPress, so when we do things like WP_VERSION=6.2 composer behat, it could pass this info on to behat-tags.php so that the script knows that 6.2 is lower than the current latest.

Describe what you would expect as the correct outcome

@require-wp-latest works as expected

Provide a possible solution

Provide additional context/Screenshots

wojsmol commented 7 months ago

@swissspidy This is perpetually skipped - see https://github.com/wp-cli/wp-cli-tests/blob/560ed5ca2776b6b3b66c79a6e6dc62904ae20b3b/utils/behat-tags.php#L46-L60

swissspidy commented 7 months ago

Yeah I saw that code too. The thing is:

  1. We still use @require-wp-latest in many tests, despite it not working
  2. We can actually make it work
danielbachhuber commented 7 months ago

I'd suggest we actually remove @require-wp-latest. It's ambiguous, and I don't think it's entirely necessary.

We still use @require-wp-latest in many tests, despite it not working

I only see one use: https://github.com/search?q=org%3Awp-cli%20require-wp-latest&type=code

Are there others?

swissspidy commented 7 months ago

I only see one use: github.com/search?q=org%3Awp-cli%20require-wp-latest&type=code

Are there others?

I think you're right! I just double checked and I just saw tons of duplicates in all the different vendor folders, so yeah just that one.

I suppose it not even working shows how unnecessary it can be in that test there.