-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Introduce automated tests #161
Conversation
ecdd5d3
to
345b44d
Compare
a1d9c2f
to
00d8797
Compare
bf6c7fb
to
ff84a99
Compare
I tested the commands from |
All initializations with custom options are now triggered through the same trait method to ensure complete options in every test case.
Two targets apparently got the same number of hits in the 2 day test.
Well, the tests themselves should do something relevant of course. I'd say my test cases are somewhat reasonable, hopefully documented well enough to get an idea of what is tested and the code-style can be verified with PHPCS (some rule adaptions, as WPCS is not perfectly applicable for test cases). If you agree, we're set here. If not, feel free to suggest changes. |
Ah, sorry, I thought the PR was about that the tests run as part of the CI now. Will take a look at the tests, I try to do that later today. |
Great 👍 Up to the current version we follow a "manual testing approach", i.e. there are no programmatic tests at all. Tried to put my typical manual tests into an automated integration test suite. |
I looked at the tests and think I got a good idea of what they are doing. I have no suggestion for changes/additional tests. Two tests are failing, should that be fixed in the PR or in separate issues?
The files in the |
The tests assumed that the cron task is only scheduled during cron calls, but that recently changed in #187. I adjusted the corresponding test case.
Thought code style checks on test code might be little pedantic... Can be verified with |
Okay, cool. The second test continues to fail for me:
Okay :) Just wanted to make sure it was not unintentionally. |
Interesting, runs fine on my local (Linux) machine and Travis CI 🤔 Guess it might be a different execution order. I'll try to figure it out and probably add some additional DB cleanups. |
@stklcode after running the test again I got the same error, but now in line 239. So I added your modifications there, too, and now all tests pass. |
This PR introduces unit and integration tests for Statify.
Tests run against test setups for PHP 5.6 / WP 4.7 and PHP 7.4 / WP 5.5, all other builds only lint the code.