Skip to content

Commit 2736102

Browse files
committed
fix tests
1 parent 4f29506 commit 2736102

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

tests/sentry/integrations/github/tasks/test_sync_repos_on_install_change.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from sentry.testutils.silo import assume_test_silo_mode, assume_test_silo_mode_of, control_silo_test
1414

1515
FEATURE_FLAG = "organizations:github-repo-auto-sync-webhook"
16+
REMOVAL_FLAG = "organizations:scm-repo-auto-sync-removal"
1617

1718

1819
@control_silo_test
@@ -70,7 +71,7 @@ def test_repos_removed(self, _: MagicMock) -> None:
7071
status=ObjectStatus.ACTIVE,
7172
)
7273

73-
with self.feature(FEATURE_FLAG):
74+
with self.feature([FEATURE_FLAG, REMOVAL_FLAG]):
7475
sync_repos_on_install_change(
7576
integration_id=self.integration.id,
7677
action="removed",
@@ -100,7 +101,7 @@ def test_mixed_add_and_remove(self, _: MagicMock) -> None:
100101
status=ObjectStatus.ACTIVE,
101102
)
102103

103-
with self.feature(FEATURE_FLAG):
104+
with self.feature([FEATURE_FLAG, REMOVAL_FLAG]):
104105
sync_repos_on_install_change(
105106
integration_id=self.integration.id,
106107
action="added",

tests/sentry/integrations/github/test_webhook.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,15 @@ def test_end_to_end_repos_added(self) -> None:
435435
)
436436
sha1, sha256 = self._compute_signatures(body)
437437

438-
with self.feature("organizations:github-repo-auto-sync-webhook"), self.tasks():
438+
with (
439+
self.feature(
440+
[
441+
"organizations:github-repo-auto-sync-webhook",
442+
"organizations:scm-repo-auto-sync-removal",
443+
]
444+
),
445+
self.tasks(),
446+
):
439447
response = self.client.post(
440448
path=self.url,
441449
data=body,
@@ -483,7 +491,15 @@ def test_end_to_end_repos_removed(self, mock_seer_cleanup: MagicMock) -> None:
483491
)
484492
sha1, sha256 = self._compute_signatures(body)
485493

486-
with self.feature("organizations:github-repo-auto-sync-webhook"), self.tasks():
494+
with (
495+
self.feature(
496+
[
497+
"organizations:github-repo-auto-sync-webhook",
498+
"organizations:scm-repo-auto-sync-removal",
499+
]
500+
),
501+
self.tasks(),
502+
):
487503
response = self.client.post(
488504
path=self.url,
489505
data=body,

tests/sentry/integrations/source_code_management/test_sync_repos.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ def test_disables_removed_repos(self, _: MagicMock) -> None:
8585
self._add_repos_response([{"id": 1, "full_name": "getsentry/sentry", "name": "sentry"}])
8686

8787
with self.feature(
88-
["organizations:github-repo-auto-sync", "organizations:github-repo-auto-sync-apply"]
88+
[
89+
"organizations:github-repo-auto-sync",
90+
"organizations:github-repo-auto-sync-apply",
91+
"organizations:scm-repo-auto-sync-removal",
92+
]
8993
):
9094
sync_repos_for_org(self.oi.id)
9195

0 commit comments

Comments
 (0)