-
Notifications
You must be signed in to change notification settings - Fork 12
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
Functional tests for WP-CLI commands #124
Conversation
Needed as long as the command isn't available on Packagist
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
With all the Behat stuff being in a separate package it's not that straightforward to do so. Plus you'd want to test things like Also it would benefit everyone else using GlotPress and WP-CLI 🙂 |
This comment has been minimized.
This comment has been minimized.
Is the code coverage working? Wondering since there's no change on https://app.codecov.io/gh/wearerequired/traduttore/compare/124. |
The upload step in CI says
And Codecov knows about our latest commit |
Plus, locally the clover files are generated just fine and I can see the code coverage for There must be something wrong with the paths in there or something. I'll try to compare the output with the one from PHPUnit. |
So strange 😕 Setting The only big difference I found between the coverage file from PHPUnit and the one from Behat is the namespace. The former has |
fwiw: @schlessera did disable the codecov upload in ampproject/amp-wp@07a844f. The comment for the reason isn't clear to me though. |
Interesting! I don't see why merging wouldn't work though, as we usually merge multiple reports in the web-stories-wp repo and it works just fine there. |
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.
Let's merge this and see if we can fix the coverage upload in a follow-up PR.
Description
This PR sets up the necessary infrastructure for running Behat tests for the built-in WP-CLI commands.
So far this includes only a test for
wp traduttore info
, but not yet tests for the other commands.For these, I think we need to figure out how to create a bunch of GlotPress projects with meta data etc. when running the tests. Ideally there would be some proper WP-CLI commands for that, but GlotPress doesn't currently provide any to do such CRUD operations. Perhaps we have to contribute these upstream...
That would make writing these tests way easier. An alternative was mentioned below:
Fixes #21.
How has this been tested?
By writing tests :-)
Types of changes
New functional tests for WP-CLI commands.
Checklist: