From f1f9d09a21365d1680be5e73f561b0576de56965 Mon Sep 17 00:00:00 2001 From: Richard Roggenkemper <46740234+roggenkemper@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:18:20 -0700 Subject: [PATCH] chore(group-resolution): Add test to guarantee has_resolution is implemented (#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. --- tests/sentry/models/test_groupresolution.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/sentry/models/test_groupresolution.py b/tests/sentry/models/test_groupresolution.py index 0da1ed8620d996..01c0fdc402a0fd 100644 --- a/tests/sentry/models/test_groupresolution.py +++ b/tests/sentry/models/test_groupresolution.py @@ -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()