Skip to content

ref(ACI): Refactor subscription processor tests #94675

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ceorourke
Copy link
Member

Make some reusable methods to clean up the workflow engine tests, move cached properties to the subclasses that use them, and standardize the way we write docstrings.

@ceorourke ceorourke requested a review from a team as a code owner June 30, 2025 23:35
@ceorourke ceorourke requested a review from a team June 30, 2025 23:35
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Enum Comparison Bug in `assert_seer_results`

The assert_seer_results helper method incorrectly compares rule.sensitivity and rule.seasonality (enum objects) directly against their deserialized JSON string values. This omission of the .value attribute, which was present in the original code, causes assertion failures.

tests/sentry/incidents/subscription_processor/test_subscription_processor_workflow_engine.py#L392-L396

assert rule.sensitivity is not None
assert deserialized_body["config"]["sensitivity"] == rule.sensitivity
assert rule.seasonality is not None
assert deserialized_body["config"]["expected_seasonality"] == rule.seasonality
assert rule.threshold_type is not None

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

Copy link

codecov bot commented Jul 1, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
25900 1 25899 235
View the top 1 failed test(s) by shortest run time
tests.snuba.tagstore.test_tagstore_backend.TagStorageTest::test_get_group_tag_value_count_generic
Stack Traces | 7.86s run time
#x1B[1m#x1B[.../snuba/tagstore/test_tagstore_backend.py#x1B[0m:400: in test_get_group_tag_value_count_generic
    assert (
#x1B[1m#x1B[31mE   AssertionError: assert 0 == 1#x1B[0m
#x1B[1m#x1B[31mE    +  where 0 = <bound method SnubaTagStorage.get_group_tag_value_count of <sentry.tagstore.snuba.backend.SnubaTagStorage object at 0x7f1f5d701bd0>>(<Group at 0x7f1f906fa990: id=394, project_id=4556338387812352>, 292, 'foo', {'organization_id': 1234, 'referrer': 'tagstore.get_group_tag_value_count'})#x1B[0m
#x1B[1m#x1B[31mE    +    where <bound method SnubaTagStorage.get_group_tag_value_count of <sentry.tagstore.snuba.backend.SnubaTagStorage object at 0x7f1f5d701bd0>> = <sentry.tagstore.snuba.backend.SnubaTagStorage object at 0x7f1f5d701bd0>.get_group_tag_value_count#x1B[0m
#x1B[1m#x1B[31mE    +      where <sentry.tagstore.snuba.backend.SnubaTagStorage object at 0x7f1f5d701bd0> = <tests.snuba.tagstore.test_tagstore_backend.TagStorageTest testMethod=test_get_group_tag_value_count_generic>.ts#x1B[0m
#x1B[1m#x1B[31mE    +    and   292 = <Environment at 0x7f1f5dc57cd0: id=292, organization_id=4556338387746816, name='test'>.id#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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.

2 participants