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

test: Use timezone aware datetime #7918

Merged
merged 2 commits into from
Sep 12, 2024
Merged

Conversation

kesara
Copy link
Member

@kesara kesara commented Sep 10, 2024

Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.82%. Comparing base (c7f6bde) to head (7098833).
Report is 64 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7918      +/-   ##
==========================================
+ Coverage   88.78%   88.82%   +0.04%     
==========================================
  Files         296      304       +8     
  Lines       41320    41495     +175     
==========================================
+ Hits        36687    36860     +173     
- Misses       4633     4635       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

Modulo date vs datetime, this should help.

There'll still be a very brief window around midnight UTC when this could fail. I wonder if we should write a test helper named something like date_or_wait(dt: TimeDelta) that will sleep if it's called within dt of a date change, then return the next day. I think this could protect us from random failures.

ietf/meeting/tests_models.py Outdated Show resolved Hide resolved
@kesara
Copy link
Member Author

kesara commented Sep 11, 2024

Modulo date vs datetime, this should help.

There'll still be a very brief window around midnight UTC when this could fail. I wonder if we should write a test helper named something like date_or_wait(dt: TimeDelta) that will sleep if it's called within dt of a date change, then return the next day. I think this could protect us from random failures.

We can use something like Freezgun to set a specific date too. The test I introduce follows the patterns of the existing test suite. The test for date is trivial & and go without it?

@jennifer-richards
Copy link
Member

We can use something like Freezgun to set a specific date too. The test I introduce follows the patterns of the existing test suite. The test for date is trivial & and go without it?

Seems worth investigating, but what you've got here is fine.

@rjsparks rjsparks merged commit f0f2b6d into ietf-tools:main Sep 12, 2024
9 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants