-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
tests(similarity): Simplify tests #82031
Conversation
This reverts commit 31f71d4.
@@ -682,16 +681,6 @@ def _retry_operation(operation, *args, retries, delay, exceptions, **kwargs): | |||
raise | |||
|
|||
|
|||
# TODO: delete this and its tests | |||
def lookup_event(project_id: int, event_id: str, group_id: int) -> Event: |
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.
Not in use.
bulk_data["rows"], | ||
bulk_data["events"], | ||
) | ||
self.event = self.store_event( |
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 gets replaced by self.event = bulk_data["events"][0]
.
self.event.group.times_seen = 5 | ||
self.event.group.save() | ||
|
||
self.wait_for_event_count(self.project.id, 6) |
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 not necessary and it speeds up a tiny bit the execution of the tests.
"similarity_model_version": SEER_SIMILARITY_MODEL_VERSION, | ||
"request_hash": self.group_hashes[group.id], | ||
} | ||
self.assert_groups_metadata_updated(groups) |
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.
Testing the final state rather than the output of the logger.
@@ -1199,13 +882,13 @@ def test_backfill_seer_grouping_records_multiple_batches( | |||
"backfill_seer_grouping_records.batch", | |||
extra={ | |||
"project_id": self.project.id, | |||
"batch_len": 6, | |||
"batch_len": 5, |
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 changes because in the set up we don't create an extra event.
@@ -1268,15 +951,14 @@ def test_backfill_seer_grouping_records_only_delete(self, mock_project_delete_gr | |||
assert group.data["metadata"] == default_metadata | |||
|
|||
@patch("sentry.tasks.embeddings_grouping.utils.delete_project_grouping_records") | |||
@patch("sentry.tasks.embeddings_grouping.backfill_seer_grouping_records_for_project.logger") | |||
@patch("sentry.tasks.embeddings_grouping.utils.post_bulk_grouping_records") |
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.
We're going to call the task first to populate the metadata.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
This removes a lot of the assertion for mocked logs.