-
Notifications
You must be signed in to change notification settings - Fork 114
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
Travis and Unit test updates #136
Conversation
Lots of amazing additions here @JPry! The README on setup/running locally needs work though. Ideally, it should be sufficiently comprehensive that it can get anyone running tests, regardless of their existing development environment. At the moment, it assumes too much of the reader and their local environment. For example, it looks like The composer dependencies also require PHP 7.1: https://cl.ly/1W162Z1O233q Those are requirements/pre-requisites that should be explicitly mentioned, and ideally accounted for with instructions for how to set them up. The README does say:
But that's too brief to help a reader who isn't already familiar with VVV and who isn't familiar enough with the internals of their local setup to find and meet the requirements of the test suite. To overcome the many possible local variants (it's impossible to write a guide to handle them all!), it's OK to be opinionated. Provide clear instructions or complete instructions on how to run the test suite with one tool, like VVV, or Chasis or Valet. That makes it easy for someone with the wrong environment to still run the tests, and those who already know how to configure their environment can ignore those instructions/opinions (but will likely still glean valuable tips from them, like PHP version requirements etc). For an example of the type of detail I think should be included, see the WooCommerce Subscriptions Unit Test README. |
@thenbrent I've added a first round of updates to the Readme file based on your suggestions. I used VVV as the tool of choice since that's what I'm most familiar with. It's not quite as verbose as the readme for subscriptions that you linked to, but I think it's closer to what we're looking for.
This should no longer be the case. Apparently, when Let me know what other changes you think are necessary here, and I'll be glad to make additional updates. |
83b4afe
to
a373c93
Compare
I noticed that this had merge conflicts with |
a373c93
to
c0836b9
Compare
@thenbrent This has been rebased again with the latest |
- Update matrix, and include WP trunk - Test PHP 5.3 on WP 4.9 It seems better to use the native matrix as much as possible with exclusion rather than adding inclusions to the matrix manually
Also: - Use uppercase for variables. This is the normal convention in shell scripts - Use quotes around variables - Ensure we have the WP_VERSION variable available. This is just extra insurance. It probably will never be undefined - Update author info - Only create DB if it doesn't exist
- Ensure composer dependencies are installed - Ignore platform requirements with composer - Define latest version of WP
Also: - Move composer install to travis script - Only run code coverage when needed, and only after a successful run - Cache some composer files - Update script for running tests
c0836b9
to
3223adc
Compare
@thenbrent I'm planning to update with instructions for Valet+, for a couple reasons:
|
@JPry do you still plan to do that? I'd personally vote for that over VVV. 👍 |
@thenbrent Yep, that's still in the plan. I have this one on my list for the week. |
57fdaae
to
2c2e9b9
Compare
@JPry This one is quite stale so I am closing it. |
This update aims to make it easier to run unit tests locally, while also making some updates to Travis. In particular:
clover.xml
file. This prevents needlessly running codecov.io.run_tests.sh
script to run tests, whether locally or on Travis.bootstrap.php
file does a better job of determining where the WordPress tests directory lives.