-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
ref(grouping): Rewrite hierarchical grouping tests #74144
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
Conversation
cd36ba6
to
59a104d
Compare
@@ -202,54 +202,18 @@ def test_partial_move(default_project, fast_save): | |||
|
|||
|
|||
class EventManagerGroupingTest(TestCase): | |||
def test_applies_secondary_grouping_hierarchical(self): |
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.
def test_applies_secondary_grouping_hierarchical(self): | ||
project = self.project | ||
project.update_option("sentry:grouping_config", "legacy:2019-03-12") | ||
project.update_option("sentry:secondary_grouping_expiry", 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.
project.update_option("sentry:grouping_config", "legacy:2019-03-12") | ||
project.update_option("sentry:secondary_grouping_expiry", 0) | ||
|
||
timestamp = time.time() - 300 |
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.
save_event
will not use timestamp anymore.
|
||
timestamp = time.time() - 300 | ||
|
||
def save_event(ts_offset): |
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 function has been converted into a helper function. See down below.
return manager.save(project.id) | ||
|
||
event = save_event(0) | ||
def test_can_upgrade_to_hierarchical_config(self): |
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.
More meaningful naming.
|
||
project.update_option("sentry:grouping_config", "mobile:2021-02-12") | ||
project.update_option("sentry:secondary_grouping_config", "legacy:2019-03-12") | ||
project.update_option("sentry:secondary_grouping_expiry", time.time() + (24 * 90 * 3600)) |
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.
manager = EventManager( | ||
make_event( | ||
message="foo 123", | ||
event_id=hex(2**127)[-32:], |
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.
782bcf3
to
91c244c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #74144 +/- ##
===========================================
+ Coverage 54.35% 78.20% +23.84%
===========================================
Files 5605 6660 +1055
Lines 236523 297354 +60831
Branches 40529 51176 +10647
===========================================
+ Hits 128566 232548 +103982
+ Misses 106482 58492 -47990
- Partials 1475 6314 +4839 |
This makes the tests a little easier to understand and prepares for my next set of changes.
This makes the tests a little easier to understand and prepares for my next set of changes.