Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
integrations: Fix broken screenshots configuration.
Zixuan James Lie8a6f6a313e3
diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.pyindex ded7f3749de..14c9c304ca6 100644--- a/zerver/lib/integrations.py+++ b/zerver/lib/integrations.py@@ -716,10 +716,8 @@ DOC_SCREENSHOT_CONFIG: Dict[str, List[BaseScreenshotConfig]] = {"buildbot": [ScreenshotConfig("started.json")],"canarytoken": [ScreenshotConfig("canarytoken_real.json")],"circleci": [- ScreenshotConfig(- "github_bionic_production_build_success_multiple_parties.json", image_name="001.png"- ),- ScreenshotConfig("bitbucket_private_repo_pull_request_failure.json", image_name="002.png"),+ ScreenshotConfig("bitbucket_job_completed.json", image_name="001.png"),+ ScreenshotConfig("github_job_completed.json", image_name="002.png"),],"clubhouse": [ScreenshotConfig("story_create.json")],"codeship": [ScreenshotConfig("error_build.json")],@@ -763,15 +761,15 @@ DOC_SCREENSHOT_CONFIG: Dict[str, List[BaseScreenshotConfig]] = {"jotform": [ScreenshotConfig("response.json")],"json": [ScreenshotConfig("json_github_push__1_commit.json")],"librato": [ScreenshotConfig("three_conditions_alert.json", payload_as_query_param=True)],- "lidarr": [ScreenshotConfig("lidarr_tracks_grabbed.json")],+ "lidarr": [ScreenshotConfig("lidarr_album_grabbed.json")],"linear": [ScreenshotConfig("issue_create_complex.json")],"mention": [ScreenshotConfig("webfeeds.json")],"nagios": [BaseScreenshotConfig("service_notify.json")],"netlify": [ScreenshotConfig("deploy_building.json")],"newrelic": [- ScreenshotConfig("incident_opened.json", "001.png"),- ScreenshotConfig("incident_acknowledged.json", "002.png"),- ScreenshotConfig("incident_closed.json", "003.png"),+ ScreenshotConfig("incident_active_new.json", "001.png"),+ ScreenshotConfig("incident_acknowledged_new.json", "002.png"),+ ScreenshotConfig("incident_closed_new.json", "003.png"),],"opbeat": [ScreenshotConfig("error_reopen.json")],"opencollective": [ScreenshotConfig("one_time_donation.json")],diff --git a/zerver/tests/test_integrations.py b/zerver/tests/test_integrations.pyindex f2ae81fb5f3..8ececba3492 100644--- a/zerver/tests/test_integrations.py+++ b/zerver/tests/test_integrations.py@@ -1,3 +1,5 @@+import os+from zerver.lib.integrations import (DOC_SCREENSHOT_CONFIG,INTEGRATIONS,@@ -55,3 +57,29 @@ class IntegrationsTestCase(ZulipTestCase):"Add them to zerver.lib.integrations.DOC_SCREENSHOT_CONFIG")self.assertFalse(missing_webhooks, message)++ def test_no_missing_screenshot_path(self) -> None:+ message = (+ '"{path}" does not exist for webhook {webhook_name}.\n'+ "Consider updating zerver.lib.integrations.DOC_SCREENSHOT_CONFIG\n"+ 'and running "tools/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 screenshot_config in configs:+ integration = INTEGRATIONS[integration_name]+ if screenshot_config.fixture_name == "":+ # Such screenshot configs only use a placeholder+ # fixture_name.+ continue+ fixture_path, image_path = get_fixture_and_image_paths(+ integration, screenshot_config+ )+ self.assertTrue(+ os.path.isfile(fixture_path),+ message.format(path=fixture_path, webhook_name=integration_name),+ )+ self.assertTrue(+ os.path.isfile(image_path),+ message.format(path=image_path, webhook_name=integration_name),+ )