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

Attempt to handle FY boundaries in utilization tests #1368

Merged
merged 4 commits into from
Oct 7, 2021

Conversation

caleywoods
Copy link

Description

The utilization tests in tock/utilization/tests/test_views.py seem to get tripped up when the fiscal year changes for the first 7 to 10 days of October. The original behavior was to create a ReportingPeriod that had a start date of today minus 7 days. If today's date is in early October and you rewind 7 days back into late September, the resulting reporting period spans two fiscal years.

This attempts to address the issue by checking if "today" is far enough into October that rewinding 7 days would leave the reporting period in the current fiscal year and not cause issues 🤞

@Jkrzy - Thanks for the mountain of help in figuring out the problem and solution.

@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2021

Codecov Report

Merging #1368 (dca278f) into main (d50b616) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1368   +/-   ##
=======================================
  Coverage   89.91%   89.91%           
=======================================
  Files          51       51           
  Lines        2242     2242           
=======================================
  Hits         2016     2016           
  Misses        226      226           
Impacted Files Coverage Δ
hours/models.py 97.73% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d50b616...dca278f. Read the comment docs.

Copy link
Contributor

@neilmb neilmb left a comment

Choose a reason for hiding this comment

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

A few suggestions, but LGTM.

@caleywoods caleywoods merged commit a3cb34d into main Oct 7, 2021
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