-
Notifications
You must be signed in to change notification settings - Fork 40
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
DateThemeTestCase randomly(?) fails on testDateDisplayCombination #3794
Comments
Well, now I'm not seeing the same failure. I saw it both on Zen.CI and on my local, but rerunning the tests everything is working fine now. This may be a race condition or time-specific |
On my local, here are the expected and actual results: Expected
Actual
|
Trying to reproduce here, but wasn't able to. Tests are passing on both, php7.2 and php5.6. But obviously there's something wrong with "testDateDisplayCombination". I'll have a look. |
Got it. It was a bad assumption to think, "+1 week" would be on the same day automatically. The test must fail depending on current time. |
I've just created a pull request, which fixes the problem with failing tests depending on testing time. Sorry for the mess. |
I've reviewed the code. I'm not sure at what time to check if test will fail, when did it fail before. |
Yes, that's tricky. The check for "remaining days" requires dynamic dates and makes this test complex - maybe too complex. But how to simplify it, but still keep it meaningful? |
I updated the test. When should the previous test version fail: The problem with my test was that if local time in the timezone (Europe/Moscow) I chose for testing was between 23:01 and 23:59, the test failed because the second time (+ one hour) slipped over to the next day. Europe/Moscow is UTC + 3 hours, hence the test failed between 20:01 and 20:59 UTC. |
I don't think we need to test dynamic dates. We should pick a set of expected edge-cases, like the end of the day/month/year and then test those. If we find a bug later, we should add the case that causes it, that way the tests will always pass (or fail) every time. |
There already was a bug in handling remaining days in date theme. That's why I decided to test it. Up to and including release 1.12.6 a date format like
Remaining days somewhere in the middle. Since this is fixed, it correctly shows as:
Remaining days only show up if the date is in future, hence this testing date needs to be dynamic. |
Ah I see! Sorry I did not think that through. Makes sense. 👍 |
Merged backdrop/backdrop#2689 into 1.x and 1.13.x. Thanks @indigoxela for the initial fix and then for being so responsible as to clean up these tests! |
This might have not fixed things completely: backdrop/backdrop#2729 |
Description of the bug
All PRs are currently failing on DateThemeTestCase test. Looks like the expected output isn't matching in the test.
Steps To Reproduce
Run the test suite, in particular DateThemeTestCase:
Actual behavior
Expected behavior
All tests should be passing.
Additional information
Add any other information that could help, such as:
PR by @indigoxela: backdrop/backdrop#2689
The text was updated successfully, but these errors were encountered: