Skip to content

Commit 98c592e

Browse files
committed
test: re-enable efm2 integration test cases
1 parent 3b4d524 commit 98c592e

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

.github/workflows/integration_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- main
8+
- test/efm2-tests
89

910
permissions:
1011
id-token: write # This is required for requesting the JWT

tests/integration/container/test_aurora_failover.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def test_fail_from_writer_to_new_writer_fail_on_connection_bound_object_invocati
132132
assert aurora_utility.is_db_instance_writer(current_connection_id) is True
133133
assert current_connection_id != initial_writer_id
134134

135+
@pytest.mark.parametrize("plugins", ["failover,host_monitoring", "failover,host_monitoring_v2"])
135136
@enable_on_features([TestEnvironmentFeatures.NETWORK_OUTAGES_ENABLED,
136137
TestEnvironmentFeatures.ABORT_CONNECTION_SUPPORTED])
137138
def test_fail_from_reader_to_writer(
@@ -140,12 +141,13 @@ def test_fail_from_reader_to_writer(
140141
test_driver: TestDriver,
141142
conn_utils,
142143
proxied_props,
143-
aurora_utility):
144+
aurora_utility,
145+
plugins):
144146
target_driver_connect = DriverHelper.get_connect_func(test_driver)
145147
reader: TestInstanceInfo = test_environment.get_proxy_instances()[1]
146148
writer_id: str = test_environment.get_proxy_writer().get_instance_id()
147149

148-
proxied_props["plugins"] = "failover,host_monitoring"
150+
proxied_props["plugins"] = plugins
149151
with AwsWrapperConnection.connect(
150152
target_driver_connect,
151153
**conn_utils.get_proxy_connect_params(reader.get_host()),

tests/integration/container/test_basic_connectivity.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,19 @@ def test_proxied_wrapper_connection_failed(
126126
# That is expected exception. Test pass.
127127
assert True
128128

129+
@pytest.mark.parametrize("plugins", ["failover,host_monitoring", "failover,host_monitoring_v2"])
129130
@enable_on_num_instances(min_instances=2)
130131
@enable_on_deployments([DatabaseEngineDeployment.AURORA, DatabaseEngineDeployment.RDS_MULTI_AZ_CLUSTER])
131132
@enable_on_features([TestEnvironmentFeatures.ABORT_CONNECTION_SUPPORTED])
132133
def test_wrapper_connection_reader_cluster_with_efm_enabled(self, test_driver: TestDriver, conn_utils, plugins):
133134
props: Properties = Properties({
134-
WrapperProperties.PLUGINS.name: "host_monitoring",
135+
WrapperProperties.PLUGINS.name: plugins,
135136
"socket_timeout": 5,
136137
"connect_timeout": 5,
137138
"monitoring-connect_timeout": 3,
138139
"monitoring-socket_timeout": 3,
139-
"autocommit": True})
140+
"autocommit": True,
141+
"plugins": plugins})
140142
target_driver_connect = DriverHelper.get_connect_func(test_driver)
141143
conn = AwsWrapperConnection.connect(target_driver_connect, **conn_utils.get_connect_params(conn_utils.reader_cluster_host), **props)
142144
cursor = conn.cursor()

tests/integration/container/test_read_write_splitting.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,18 @@ def test_failover_to_new_writer__switch_read_only(
357357
current_id = rds_utils.query_instance_id(conn)
358358
assert new_writer_id == current_id
359359

360+
@pytest.mark.parametrize("plugins", ["read_write_splitting,failover,host_monitoring", "read_write_splitting,failover,host_monitoring_v2"])
360361
@enable_on_features([TestEnvironmentFeatures.NETWORK_OUTAGES_ENABLED,
361362
TestEnvironmentFeatures.ABORT_CONNECTION_SUPPORTED])
362363
@enable_on_num_instances(min_instances=3)
363364
@disable_on_engines([DatabaseEngine.MYSQL])
364365
def test_failover_to_new_reader__switch_read_only(
365366
self, test_environment: TestEnvironment, test_driver: TestDriver,
366-
proxied_failover_props, conn_utils, rds_utils):
367+
proxied_failover_props, conn_utils, rds_utils, plugins):
367368
WrapperProperties.FAILOVER_MODE.set(proxied_failover_props, "reader-or-writer")
368369

370+
WrapperProperties.PLUGINS.set(proxied_failover_props, plugins)
371+
369372
target_driver_connect = DriverHelper.get_connect_func(test_driver)
370373
with AwsWrapperConnection.connect(
371374
target_driver_connect, **conn_utils.get_proxy_connect_params(), **proxied_failover_props) as conn:
@@ -404,13 +407,15 @@ def test_failover_to_new_reader__switch_read_only(
404407
current_id = rds_utils.query_instance_id(conn)
405408
assert other_reader_id == current_id
406409

410+
@pytest.mark.parametrize("plugins", ["read_write_splitting,failover,host_monitoring", "read_write_splitting,failover,host_monitoring_v2"])
407411
@enable_on_features([TestEnvironmentFeatures.NETWORK_OUTAGES_ENABLED,
408412
TestEnvironmentFeatures.ABORT_CONNECTION_SUPPORTED])
409413
@enable_on_num_instances(min_instances=3)
410414
@disable_on_engines([DatabaseEngine.MYSQL])
411415
def test_failover_reader_to_writer__switch_read_only(
412416
self, test_environment: TestEnvironment, test_driver: TestDriver,
413-
proxied_failover_props, conn_utils, rds_utils):
417+
proxied_failover_props, conn_utils, rds_utils, plugins):
418+
WrapperProperties.PLUGINS.set(proxied_failover_props, plugins)
414419
target_driver_connect = DriverHelper.get_connect_func(test_driver)
415420
with AwsWrapperConnection.connect(
416421
target_driver_connect, **conn_utils.get_proxy_connect_params(), **proxied_failover_props) as conn:
@@ -522,19 +527,21 @@ def test_pooled_connection__cluster_url_failover(
522527
new_driver_conn = conn.target_connection
523528
assert initial_driver_conn is not new_driver_conn
524529

530+
@pytest.mark.parametrize("plugins", ["read_write_splitting,failover,host_monitoring", "read_write_splitting,failover,host_monitoring_v2"])
525531
@enable_on_features([TestEnvironmentFeatures.FAILOVER_SUPPORTED, TestEnvironmentFeatures.NETWORK_OUTAGES_ENABLED,
526532
TestEnvironmentFeatures.ABORT_CONNECTION_SUPPORTED])
527533
@disable_on_engines([DatabaseEngine.MYSQL])
528534
def test_pooled_connection__failover_failed(
529535
self, test_environment: TestEnvironment, test_driver: TestDriver,
530-
rds_utils, conn_utils, proxied_failover_props):
536+
rds_utils, conn_utils, proxied_failover_props, plugins):
531537
writer_host = test_environment.get_writer().get_host()
532538
provider = SqlAlchemyPooledConnectionProvider(lambda _, __: {"pool_size": 1}, None, lambda host_info, props: writer_host in host_info.host)
533539
ConnectionProviderManager.set_connection_provider(provider)
534540

535541
WrapperProperties.FAILOVER_TIMEOUT_SEC.set(proxied_failover_props, "1")
536542
WrapperProperties.FAILURE_DETECTION_TIME_MS.set(proxied_failover_props, "1000")
537543
WrapperProperties.FAILURE_DETECTION_COUNT.set(proxied_failover_props, "1")
544+
WrapperProperties.PLUGINS.set(proxied_failover_props, plugins)
538545

539546
target_driver_connect = DriverHelper.get_connect_func(test_driver)
540547
with AwsWrapperConnection.connect(

0 commit comments

Comments
 (0)