-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
ref(escalating_issues): Easier to write and read tests #48102
Conversation
Some of the tests were time sensitive and the results would change depending on how close it would execute to midnight. This uses freeze gun in order to have a tight control on the time for the tests. This also includes some refactoring.
Before the tests would intermittently fail depending on the time of execution. Freeze gun helps making the tests resilient.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #48102 +/- ##
==========================================
+ Coverage 77.73% 80.88% +3.15%
==========================================
Files 4745 4769 +24
Lines 201433 201640 +207
Branches 11542 11548 +6
==========================================
+ Hits 156577 163095 +6518
+ Misses 44601 38290 -6311
Partials 255 255 |
…armenzg/escalating/test-refactor
…armenzg/escalating/test-refactor
@@ -33,27 +33,28 @@ def setUp(self) -> None: | |||
def _load_event_for_group( | |||
self, | |||
project_id: Optional[int] = None, | |||
minutes_ago: int = 1, | |||
count: int = 1, | |||
hours_ago: int = 0, |
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.
Using hours_ago lines up more closely with the hourly bucket we use in my Snuba query.
group.substatus = GroupSubStatus.UNTIL_ESCALATING | ||
group.save() | ||
|
||
def assert_is_escalating(self, group: Group) -> None: |
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.
this is great addition!
This improves the readability of the tests.