-
Notifications
You must be signed in to change notification settings - Fork 7
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
Prevent dynamic dates from being included in test suite. #188
Prevent dynamic dates from being included in test suite. #188
Conversation
- Info for policy and roles returns created date. - The simple solution is to filter those results out of the suite.
- This is the date, and will differ in tests.
@@ -98,7 +98,7 @@ | |||
} | |||
}, | |||
{ | |||
"output": "Zone: example.org\n Nameservers: hostname TTL\n ns1.example.org <not set>\nPrimary ns: ns1.example.org\nEmail: [email protected]\nSerialnumber: 3231206000\nRefresh: 10800\nRetry: 3600\nExpire: 1814400\nSOA TTL: 43200\nDefault TTL: 43200" | |||
"output": "Zone: example.org\n Nameservers: hostname TTL\n ns1.example.org <not set>\nPrimary ns: ns1.example.org\nEmail: [email protected]\nSerialnumber: 3231208000\nRefresh: 10800\nRetry: 3600\nExpire: 1814400\nSOA TTL: 43200\nDefault TTL: 43200" |
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.
What I don't understand is why the Serialnumber for the Zone changed. :(
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.
Weird, but nothing in this PR should have changed that, and the tests pass in CI...
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.
LGTM
https://github.com/spulec/freezegun could help here |
Looking at something like freezegun in the longer term is probably not a bad idea. We're not doing any comparisons between times and dates on the client and server anyway, so it should be safe. Yes, I have had the misfortune of debugging why mocking dates didn't work, only to realise I was checking against a timestamp generated by the server, who had zero understanding of my desire to mock dates. :) |
This will again break the current tests...