Skip to content

Commit

Permalink
revert-me: Skip all postgres tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias committed Nov 8, 2023
1 parent 2ed879c commit 3f2401a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion posthog/temporal/tests/batch_exports/test_batch_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
json_dumps_bytes,
)

pytestmark = [pytest.mark.django_db, pytest.mark.asyncio]
pytestmark = [pytest.mark.asyncio, pytest.mark.django_db]


async def test_get_rows_count(clickhouse_client):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
insert_into_bigquery_activity,
)

pytestmark = [pytest.mark.asyncio, pytest.mark.asyncio_event_loop, pytest.mark.django_db]
pytestmark = [pytest.mark.asyncio, pytest.mark.django_db]

TEST_TIME = dt.datetime.utcnow()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
insert_into_postgres_activity,
)

pytestmark = [pytest.mark.asyncio, pytest.mark.asyncio_event_loop, pytest.mark.django_db]
pytestmark = [
pytest.mark.asyncio,
pytest.mark.django_db,
]


def assert_events_in_postgres(connection, schema, table_name, events, exclude_events: list[str] | None = None):
Expand Down
11 changes: 2 additions & 9 deletions posthog/temporal/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def activity_environment():
return ActivityEnvironment()


@pytest.fixture(scope="module")
@pytest.fixture
def clickhouse_client():
"""Provide a ClickHouseClient to use in tests."""
client = ClickHouseClient(
Expand All @@ -76,14 +76,7 @@ def clickhouse_client():
yield client


@pytest.fixture(scope="module")
def event_loop():
loop = asyncio.get_event_loop()
yield loop
loop.close()


@pytest_asyncio.fixture(scope="module")
@pytest_asyncio.fixture
async def temporal_client():
"""Provide a temporalio.client.Client to use in tests."""
client = await connect(
Expand Down
3 changes: 3 additions & 0 deletions posthog/temporal/workflows/postgres_batch_export.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import collections.abc
import asyncio
import contextlib
import datetime as dt
import json
Expand Down Expand Up @@ -254,6 +255,8 @@ async def insert_into_postgres_activity(inputs: PostgresInsertInputs):
schema_columns,
)

await asyncio.sleep(10)


@workflow.defn(name="postgres-export")
class PostgresBatchExportWorkflow(PostHogWorkflow):
Expand Down

0 comments on commit 3f2401a

Please sign in to comment.