Files
upstream-zulip/zerver/webhooks/airbyte/tests.py
upstream-mirror 64898b2c79
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
snapshot of https://github.com/zulip/zulip.git @ 48c69911c7dd4e03b20552eb3bd77ad8151c1357 (2026-09-15)
2026-09-15 15:05:30 +05:00

65 lines
2.9 KiB
Python

from zerver.lib.test_classes import WebhookTestCase
class AirbyteHookTests(WebhookTestCase):
def test_airbyte_job_success(self) -> None:
expected_topic = "Zulip Airbyte Integration - Google Sheets → Postgres"
expected_message = """:green_circle: Airbyte sync **succeeded** for [Google Sheets → Postgres](https://cloud.airbyte.com/workspaces/84d2dd6e-82aa-406e-91f3-bf8dbf176e69/connections/aa941643-07ea-48a2-9035-024575491720).
* **Source:** [Google Sheets](https://cloud.airbyte.com/workspaces/84d2dd6e-82aa-406e-91f3-bf8dbf176e69/source/363c0ea3-e989-4051-9f54-d41b794d6621)
* **Destination:** [Postgres](https://cloud.airbyte.com/workspaces/84d2dd6e-82aa-406e-91f3-bf8dbf176e69/destination/b3a05072-e3c8-435a-8e6e-4a5c601039c6)
* **Records:** 1400 emitted, 1400 committed
* **Bytes:** 281 kB emitted, 281 kB committed
* **Duration:** 1 min 23 sec"""
self.check_webhook(
"airbyte_job_payload_success",
expected_topic,
expected_message,
content_type="application/json",
)
def test_airbyte_job_failure(self) -> None:
expected_topic = "Zulip Airbyte Integration - Google Sheets → Postgres"
expected_message = """:red_circle: Airbyte sync **failed** for [Google Sheets → Postgres](https://cloud.airbyte.com/workspaces/84d2dd6e-82aa-406e-91f3-bf8dbf176e69/connections/aa941643-07ea-48a2-9035-024575491720).
* **Source:** [Google Sheets](https://cloud.airbyte.com/workspaces/84d2dd6e-82aa-406e-91f3-bf8dbf176e69/source/363c0ea3-e989-4051-9f54-d41b794d6621)
* **Destination:** [Postgres](https://cloud.airbyte.com/workspaces/84d2dd6e-82aa-406e-91f3-bf8dbf176e69/destination/b3a05072-e3c8-435a-8e6e-4a5c601039c6)
* **Records:** 0 emitted, 0 committed
* **Bytes:** 0 B emitted, 0 B committed
* **Duration:** 28 sec
**Error message:** Checking source connection failed - please review this connection's configuration to prevent future syncs from failing"""
self.check_webhook(
"airbyte_job_payload_failure",
expected_topic,
expected_message,
content_type="application/json",
)
def test_airbyte_job_hello_world_success(self) -> None:
expected_topic = "Airbyte notification"
expected_message = """Hello World! This is a test from Airbyte to try slack notification settings for sync successes."""
self.check_webhook(
"test_airbyte_job_hello_world_success",
expected_topic,
expected_message,
content_type="application/json",
)
def test_airbyte_job_hello_world_failure(self) -> None:
expected_topic = "Airbyte notification"
expected_message = """Hello World! This is a test from Airbyte to try slack notification settings for sync failures."""
self.check_webhook(
"test_airbyte_job_hello_world_failure",
expected_topic,
expected_message,
content_type="application/json",
)