Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

integrations: Add `FIXTURELESS_SCREENSHOT_CONFIG`.

Niloth P2a2ca01cadb2
diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.py
index 2362d4d22f9..92a400c7458 100644
--- a/zerver/lib/integrations.py
+++ b/zerver/lib/integrations.py
@@ -705,7 +705,7 @@ NO_SCREENSHOT_WEBHOOKS = {
}
-DOC_SCREENSHOT_CONFIG: dict[str, list[WebhookScreenshotConfig]] = {
+WEBHOOK_SCREENSHOT_CONFIG: dict[str, list[WebhookScreenshotConfig]] = {
"airbrake": [WebhookScreenshotConfig("error_message.json")],
"airbyte": [WebhookScreenshotConfig("airbyte_job_payload_success.json")],
"alertmanager": [
@@ -849,6 +849,15 @@ DOC_SCREENSHOT_CONFIG: dict[str, list[WebhookScreenshotConfig]] = {
],
}
+FIXTURELESS_SCREENSHOT_CONFIG: dict[str, list[FixturelessScreenshotConfig]] = {}
+
+DOC_SCREENSHOT_CONFIG: dict[
+ str, list[WebhookScreenshotConfig] | list[FixturelessScreenshotConfig]
+] = {
+ **WEBHOOK_SCREENSHOT_CONFIG,
+ **FIXTURELESS_SCREENSHOT_CONFIG,
+}
+
def get_all_event_types_for_integration(integration: Integration) -> list[str] | None:
integration = INTEGRATIONS[integration.name]
diff --git a/zerver/tests/test_integrations.py b/zerver/tests/test_integrations.py
index b77508901d6..9deb5ccd869 100644
--- a/zerver/tests/test_integrations.py
+++ b/zerver/tests/test_integrations.py
@@ -1,10 +1,10 @@
import os
from zerver.lib.integrations import (
- DOC_SCREENSHOT_CONFIG,
INTEGRATIONS,
NO_SCREENSHOT_WEBHOOKS,
WEBHOOK_INTEGRATIONS,
+ WEBHOOK_SCREENSHOT_CONFIG,
WebhookIntegration,
WebhookScreenshotConfig,
get_fixture_path,
@@ -42,7 +42,7 @@ class IntegrationsTestCase(ZulipTestCase):
def test_no_missing_doc_screenshot_config(self) -> None:
webhook_names = {webhook.name for webhook in WEBHOOK_INTEGRATIONS}
- webhooks_with_screenshot_config = set(DOC_SCREENSHOT_CONFIG.keys())
+ webhooks_with_screenshot_config = set(WEBHOOK_SCREENSHOT_CONFIG.keys())
missing_webhooks = webhook_names - webhooks_with_screenshot_config - NO_SCREENSHOT_WEBHOOKS
message = (
f"These webhooks are missing screenshot config: {missing_webhooks}.\n"
@@ -56,8 +56,8 @@ class IntegrationsTestCase(ZulipTestCase):
"Consider updating zerver.lib.integrations.DOC_SCREENSHOT_CONFIG\n"
'and running "tools/screenshots/generate-integration-docs-screenshot" to keep the screenshots up-to-date.'
)
- for integration_name in DOC_SCREENSHOT_CONFIG:
- configs = DOC_SCREENSHOT_CONFIG[integration_name]
+ for integration_name in WEBHOOK_SCREENSHOT_CONFIG:
+ configs = WEBHOOK_SCREENSHOT_CONFIG[integration_name]
for screenshot_config in configs:
integration = INTEGRATIONS[integration_name]
assert isinstance(integration, WebhookIntegration)