Skip to content

Commit

Permalink
chore(group-resolution): Add test to guarantee has_resolution is impl…
Browse files Browse the repository at this point in the history
…emented (#79460)

this pr adds a test to make sure all resolution types have
`has_resolution` implemented. any new resolution type that is added and
does not update `has_resolution` will fail.
  • Loading branch information
roggenkemper authored Oct 21, 2024
1 parent dea9941 commit f1f9d09
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/sentry/models/test_groupresolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,19 @@ def test_no_release_with_resolution(self):

def test_no_release_with_no_resolution(self):
assert not GroupResolution.has_resolution(self.group, None)

def test_all_resolutions_are_implemented(self):
resolution_types = [
attr for attr in vars(GroupResolution.Type) if not attr.startswith("__")
]
for resolution_type in resolution_types:
resolution = GroupResolution.objects.create(
release=self.new_release,
group=self.group,
type=getattr(GroupResolution.Type, resolution_type),
)
assert (
GroupResolution.has_resolution(self.group, self.old_release) is not NotImplemented
)

resolution.delete()

0 comments on commit f1f9d09

Please sign in to comment.