diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed57614..c858141 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,6 +132,8 @@ jobs: --health-interval 5s --health-timeout 30s --health-retries 3 + ports: + - ${{ needs.load-dotenv.outputs.postgres-port }}:5432 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/consumer/tests/test_adapters/test_upsert_iot_records/test_postgres/test_close_conn_failed.py b/consumer/tests/test_adapters/test_upsert_iot_records/test_postgres/test_close_conn_failed.py index b7003b8..b5c503a 100644 --- a/consumer/tests/test_adapters/test_upsert_iot_records/test_postgres/test_close_conn_failed.py +++ b/consumer/tests/test_adapters/test_upsert_iot_records/test_postgres/test_close_conn_failed.py @@ -1,7 +1,6 @@ from pytest import LogCaptureFixture from src.adapters.upsert_iot_records.postgres import PostgresUpsertIOTRecordsClient from .utils import random_iot_records, MockedPostgresConnection -import pytest def test_close_conn_failed( diff --git a/producer/tests/test_adapters/test_publish_filenames/test_rabbitmq/test_publish_non_idempotent.py b/producer/tests/test_adapters/test_publish_filenames/test_rabbitmq/test_publish_non_idempotent.py index 2540f1f..3e1c323 100644 --- a/producer/tests/test_adapters/test_publish_filenames/test_rabbitmq/test_publish_non_idempotent.py +++ b/producer/tests/test_adapters/test_publish_filenames/test_rabbitmq/test_publish_non_idempotent.py @@ -31,8 +31,9 @@ def test_publish_single_non_idempotent( channel.basic_ack(method_frame.delivery_tag) method_frame, _, body = channel.basic_get(queue=queue) - assert method_frame is None - assert body is None + assert method_frame is not None + assert body.decode() == filename + channel.basic_ack(method_frame.delivery_tag) @pytest.mark.smoke diff --git a/producer/tests/test_adapters/test_publish_filenames/test_rabbitmq/test_successful_publish.py b/producer/tests/test_adapters/test_publish_filenames/test_rabbitmq/test_successful_publish.py index a67841b..4dba1f4 100644 --- a/producer/tests/test_adapters/test_publish_filenames/test_rabbitmq/test_successful_publish.py +++ b/producer/tests/test_adapters/test_publish_filenames/test_rabbitmq/test_successful_publish.py @@ -37,9 +37,13 @@ def test_publish_batch_success( pika_conn, queue = raw_rabbitmq_pika_conn_config + all_filenames = [] + channel = pika_conn.channel() - for filename in filenames: + while len(all_filenames) < len(filenames): method_frame, _, body = channel.basic_get(queue=queue) assert method_frame is not None - assert body.decode() == filename + all_filenames.append(body.decode()) channel.basic_ack(method_frame.delivery_tag) + + assert sorted(all_filenames) == sorted(filenames)