Skip to content

ENG-2639 Postgres Periodic Integration Tests #1135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 6, 2023
33 changes: 24 additions & 9 deletions .github/workflows/periodic-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Periodic Integration Tests

on:
schedule:
- cron: '0 12 * * 1-5' # Run at 4AM PST on every weekday
- cron: "0 12 * * 1-5" # Run at 4AM PST on every weekday
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -90,10 +90,10 @@ jobs:
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notification_title: ''
message_format: '{emoji} *{workflow}* has {status_message}'
footer: '{run_url}'
notify_when: 'failure,warnings'
notification_title: ""
message_format: "{emoji} *{workflow}* has {status_message}"
footer: "{run_url}"
notify_when: "failure,warnings"
mention_users: ${{ env.ONCALL_SLACK_MEMBER_ID }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
Expand All @@ -102,6 +102,21 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
name: SDK Integration Tests against Data Connectors
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: aqueduct
POSTGRES_DB: aqueducttest
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -148,10 +163,10 @@ jobs:
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notification_title: ''
message_format: '{emoji} *{workflow}* has {status_message}'
footer: '{run_url}'
notify_when: 'failure,warnings'
notification_title: ""
message_format: "{emoji} *{workflow}* has {status_message}"
footer: "{run_url}"
notify_when: "failure,warnings"
mention_users: ${{ env.ONCALL_SLACK_MEMBER_ID }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
7 changes: 7 additions & 0 deletions integration_tests/sdk/setup_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ def _setup_external_sqlite_db(path: str):
_execute_command(["sqlite3", db_abspath, "VACUUM;"])


def _setup_postgres_db():
_execute_command(["aqueduct", "install", "postgres"])


def _setup_relational_data(client: Client, db: RelationalDBIntegration) -> None:
# Find all the tables that already exist.
existing_table_names = set(db.list_tables()["tablename"])
Expand Down Expand Up @@ -212,6 +216,9 @@ def setup_data_integrations(client: Client, filter_to: Optional[str] = None) ->
if integration_config["type"] == ServiceType.SQLITE:
_setup_external_sqlite_db(integration_config["database"])

if integration_config["type"] == ServiceType.POSTGRES:
_setup_postgres_db()

client.connect_integration(
integration_name,
integration_config["type"],
Expand Down