Skip to content
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

Merged

Conversation

terjekv
Copy link
Collaborator

@terjekv terjekv commented Dec 8, 2023

  • Info for policy and roles returns created date.
  • The simple solution is to filter those results out of the suite.

This will again break the current tests...

  - Info for policy and roles returns created date.
  - The simple solution is to filter those results out of the suite.
@terjekv terjekv self-assigned this Dec 8, 2023
@terjekv terjekv mentioned this pull request Dec 8, 2023
@terjekv terjekv requested a review from pederhan December 8, 2023 07:40
@@ -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"
Copy link
Collaborator Author

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. :(

Copy link
Member

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...

Copy link
Member

@pederhan pederhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ponas
Copy link
Collaborator

ponas commented Dec 11, 2023

https://github.com/spulec/freezegun could help here

@terjekv
Copy link
Collaborator Author

terjekv commented Dec 11, 2023

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. :)

@pederhan pederhan merged commit ab9d3b5 into unioslo:master Dec 11, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants