-
Notifications
You must be signed in to change notification settings - Fork 85
Fix failing tests #443
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
Fix failing tests #443
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
Note sure if the remaining 4.9 failures are related to #440. Don't have PHP 7.2 locally right now to test. cc @mrsdizzie |
|
I was able to set up php 7.2 locally and I can't reproduce any errors when running a copy of WordPress 4.9.26 but when trying to run some of the tests I am seeing these failures: It works when running the command against a local WordPress install outside of the testing environment so it isn't a general problem... |
|
Related, I wonder if it is worth (or possible) to run behat tests in the ci with more detailed output, so when a test fails you get a better idea of why. I always run my local tests like: I know there are other -vvvv type options. Maybe we don't want to fill logs with all of that, but when there is an error it would be helpful to have more than |
|
Sure yeah that's possible. We could add a change to https://github.com/wp-cli/.github that runs test with the
Related, there's also this long-standing bug to have better output when comparing actual output vs expected output, see wp-cli/wp-cli-tests#17 |
|
oo neat! -- better output would indeed be nice but at least showing the specific error/stack trace is helpful for seeing why something failed. |
|
I think my issue is local to my php 7.2 setup somehow, so maybe a red herring. Looking at failures this is probably similarly related to plugins that have since added higher WordPress requirements than 4.9 and generate different output on 4.9 now. I'll try and get php 7.2 working right so I can run the tests locally see https://wordpress.org/plugins/wordpress-importer/ for example |
|
I thought so too but e.g. this result is confusing. And here's that line in the test: extension-command/features/plugin.feature Lines 64 to 67 in 33afe4f
It only tests the line for a plugin that's not in the repo. But if it's really just about incompatible version we can bump the minimum requirement of those affected tests. In the meantime, running the tests here with debug logging enabled: https://github.com/wp-cli/extension-command/actions/runs/13764647737/job/38509224929?pr=443 The extra output isn't really helpful though 🤔 (Note to self: this apparently combines |
|
Maybe since the test is missing the new columns it is failing? Since the test does plugins list and doesn't specify just this one then other plugins trigger the new columns to appear |
|
Then it should fail on other versions too, no? Feels like I really need to try to install 7.2 again 🙃 Edit: got 7.2 installed but having troubles downgrading MySQL because of the changed authentication. Ugh. |
Not necessarily. The way it works is that if wp cli detects an update is unavailable because of wp or PHP requirements, it then automatically displays the So that is an issue, but the real issue is that this test really only wants to check details for a single plugin, but is running something more general like So for this particular test, if the goal is to really only check the status of one plugin it should maybe be using All that being said I'm not sure if that is why the test is failing because I still can't easily get older versions of WP running in tests locally due to wp-cli/wp-cli-tests#243) |
Makes sense to me 👍 |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Almost all of these have the same cause -- WordPress ships with Akismet but the recent versions do not work on WordPress 4.9 so commands like wp plugin list now show the updates as unavailable and with two additional table headers for requires and requires_php that explain why. So just be intentional about the fields we care about testing.
mrsdizzie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swissspidy all better ✅
|
@mrsdizzie oh neat, thanks a lot! |

Fixes some tests on WordPress 4.9.
There's also one failing test against WordPress trunk, but not sure why.
Started on the 5th but was fine on the 4th. See https://github.com/wp-cli/extension-command/actions/runs/13644528411
and https://github.com/wp-cli/extension-command/actions/runs/13666785798.
Thought maybe https://core.trac.wordpress.org/changeset/59926 is related. Otherwise couldn't find a suspicious commit.
https://github.com/wp-cli/extension-command/actions/runs/13755011683/job/38461015602#step:11:127