-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: copy test_plugins from getsentry
this was not testing anythign in getsentry and makes it difficult to delete a plugin
- Loading branch information
1 parent
1f0d5ad
commit 9659c1f
Showing
3 changed files
with
97 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from django.conf import settings | ||
|
||
from sentry.plugins.base import plugins | ||
from sentry.runner.importer import install_plugin_apps | ||
from sentry.testutils.cases import TestCase | ||
|
||
plugin_slugs = [ | ||
"amazon-sqs", | ||
"asana", | ||
"bitbucket", | ||
"browsers", | ||
"device", | ||
"github", | ||
"gitlab", | ||
"heroku", | ||
"interface_types", | ||
"javaplugin", | ||
"javascriptplugin", | ||
"jira", | ||
"opsgenie", | ||
"os", | ||
"pagerduty", | ||
"phabricator", | ||
"pivotal", | ||
"pushover", | ||
"redmine", | ||
"segment", | ||
"sessionstack", | ||
"slack", | ||
"splunk", | ||
"trello", | ||
"twilio", | ||
"urls", | ||
"victorops", | ||
"webhooks", | ||
] | ||
|
||
|
||
sentry_app_names = [ | ||
"auth_github", | ||
"auth_saml2.onelogin", | ||
"auth_saml2.generic", | ||
"auth_saml2.okta", | ||
"auth_saml2.rippling", | ||
"auth_saml2.auth0", | ||
"jira", | ||
"opsgenie", | ||
"redmine", | ||
"sessionstack", | ||
"trello", | ||
"twilio", | ||
] | ||
|
||
|
||
class TestPluginsInstalled(TestCase): | ||
def test_plugin_slugs(self): | ||
all_plugins = sorted(plugin.slug for plugin in plugins.all(version=None)) | ||
# issuetrackingplugin2 is a test plugin from sentry pytest utils | ||
all_plugins.remove("issuetrackingplugin2") | ||
assert all_plugins == plugin_slugs | ||
|
||
def test_sentry_apps(self): | ||
install_plugin_apps("sentry.apps", settings) | ||
|
||
normalized_apps = set( | ||
map( | ||
lambda x: x.replace("sentry_plugins.", "") | ||
.replace("sentry.auth.providers.", "auth_") | ||
.replace("sentry_", ""), | ||
settings.INSTALLED_APPS, | ||
) | ||
) | ||
|
||
for app in sentry_app_names: | ||
assert app in normalized_apps |