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

Allow a time delta in the time test #37

Merged
merged 2 commits into from
Oct 11, 2023
Merged

Allow a time delta in the time test #37

merged 2 commits into from
Oct 11, 2023

Conversation

q-nk
Copy link
Contributor

@q-nk q-nk commented Oct 6, 2023

Fixes issue #36 by checking against a time delta of up to two seconds.

Please mention, if could think of a more comprehensive solution.

@jans23 jans23 requested a review from robin-nitrokey October 6, 2023 14:47
@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (9296881) 0.00% compared to head (f3a386a) 79.89%.

Additional details and impacted files
@@            Coverage Diff            @@
##           main      #37       +/-   ##
=========================================
+ Coverage      0   79.89%   +79.89%     
=========================================
  Files         0      782      +782     
  Lines         0    13690    +13690     
=========================================
+ Hits          0    10937    +10937     
- Misses        0     2753     +2753     

see 782 files with indirect coverage changes

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

@ansiwen
Copy link
Collaborator

ansiwen commented Oct 6, 2023

I would even have gone with 1 second. But 2 is also perfectly fine.

Copy link
Member

@robin-nitrokey robin-nitrokey left a comment

Choose a reason for hiding this comment

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

nit: Instead of the timetuple/mktime roundtrip, you can just compare the datetime instances, get a timedelta and check total_seconds().

Otherwise looks good to me. CI should be fixed by a rebase on main.

@q-nk q-nk marked this pull request as draft October 9, 2023 09:48
@q-nk q-nk force-pushed the test_get_config_time_fix branch 2 times, most recently from b2bba82 to b2beb1d Compare October 10, 2023 14:58
@q-nk q-nk marked this pull request as ready for review October 10, 2023 15:09
@q-nk q-nk force-pushed the test_get_config_time_fix branch 2 times, most recently from 4c18b99 to 0b71a54 Compare October 11, 2023 06:47
q-nk added 2 commits October 11, 2023 08:49
Signed-off-by: quirin <quirin@nitrokey.com>
Signed-off-by: quirin <quirin@nitrokey.com>
@q-nk q-nk force-pushed the test_get_config_time_fix branch from 0b71a54 to f3a386a Compare October 11, 2023 06:49
@q-nk q-nk merged commit 4e4bdfe into main Oct 11, 2023
@robin-nitrokey robin-nitrokey deleted the test_get_config_time_fix branch July 16, 2024 10:12
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