Skip to content

Commit b497b17

Browse files
committed
fix(fdc): Skip integration tests when DATA_CONNECT_EMULATOR_HOST is not set
Added a check_emulator autouse module fixture in integration/test_data_connect.py. Unlike services with dynamic resource creation (e.g., Realtime Database), Data Connect requires a pre-deployed Cloud SQL Postgres schema and connector. Since live integration projects do not host these resources, Data Connect integration tests are strictly emulator-only and are safely skipped when DATA_CONNECT_EMULATOR_HOST is absent.
1 parent 83d62be commit b497b17

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

integration/test_data_connect.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@ def default_app():
4141
# This test suite should not use the default app. Use the app fixture instead.
4242
pass
4343

44+
@pytest.fixture(scope='module', autouse=True)
45+
def check_emulator():
46+
"""Skips Data Connect integration tests if emulator host is not set."""
47+
if not os.environ.get('DATA_CONNECT_EMULATOR_HOST'):
48+
pytest.skip('Data Connect integration tests require DATA_CONNECT_EMULATOR_HOST.')
49+
4450
@pytest.fixture
4551
def dc_client(app):
4652
return dataconnect.client(CONNECTOR_CONFIG, app=app)
4753

48-
4954
CONNECTOR_CONFIG = dataconnect.ConnectorConfig(
5055
location='us-west2',
5156
service_id='my-service',

0 commit comments

Comments
 (0)