48
48
49
49
@pytest .mark .group (1 )
50
50
@pytest .mark .abort_on_fail
51
- async def test_build_and_deploy (ops_test : OpsTest , mysql_charm_series : str ) -> None :
51
+ async def test_build_and_deploy (ops_test : OpsTest ) -> None :
52
52
"""Build the charm and deploy 3 units to ensure a cluster is formed."""
53
- await high_availability_test_setup (ops_test , mysql_charm_series )
53
+ await high_availability_test_setup (ops_test )
54
54
55
55
56
56
@pytest .mark .group (1 )
57
57
@pytest .mark .abort_on_fail
58
- async def test_exporter_endpoints (ops_test : OpsTest , mysql_charm_series : str ) -> None :
58
+ async def test_exporter_endpoints (ops_test : OpsTest ) -> None :
59
59
"""Test that endpoints are running."""
60
- mysql_application_name , _ = await high_availability_test_setup (ops_test , mysql_charm_series )
60
+ mysql_application_name , _ = await high_availability_test_setup (ops_test )
61
61
application = ops_test .model .applications [mysql_application_name ]
62
62
http = urllib3 .PoolManager ()
63
63
@@ -116,9 +116,9 @@ async def test_exporter_endpoints(ops_test: OpsTest, mysql_charm_series: str) ->
116
116
117
117
@pytest .mark .group (1 )
118
118
@pytest .mark .abort_on_fail
119
- async def test_custom_variables (ops_test : OpsTest , mysql_charm_series ) -> None :
119
+ async def test_custom_variables (ops_test : OpsTest ) -> None :
120
120
"""Query database for custom variables."""
121
- mysql_application_name , _ = await high_availability_test_setup (ops_test , mysql_charm_series )
121
+ mysql_application_name , _ = await high_availability_test_setup (ops_test )
122
122
application = ops_test .model .applications [mysql_application_name ]
123
123
124
124
for unit in application .units :
@@ -132,11 +132,9 @@ async def test_custom_variables(ops_test: OpsTest, mysql_charm_series) -> None:
132
132
133
133
@pytest .mark .group (1 )
134
134
@pytest .mark .abort_on_fail
135
- async def test_consistent_data_replication_across_cluster (
136
- ops_test : OpsTest , mysql_charm_series : str
137
- ) -> None :
135
+ async def test_consistent_data_replication_across_cluster (ops_test : OpsTest ) -> None :
138
136
"""Confirm that data is replicated from the primary node to all the replicas."""
139
- mysql_application_name , _ = await high_availability_test_setup (ops_test , mysql_charm_series )
137
+ mysql_application_name , _ = await high_availability_test_setup (ops_test )
140
138
141
139
# assert that there are 3 units in the mysql cluster
142
140
assert len (ops_test .model .applications [mysql_application_name ].units ) == 3
@@ -150,9 +148,9 @@ async def test_consistent_data_replication_across_cluster(
150
148
151
149
@pytest .mark .group (1 )
152
150
@pytest .mark .abort_on_fail
153
- async def test_kill_primary_check_reelection (ops_test : OpsTest , mysql_charm_series : str ) -> None :
151
+ async def test_kill_primary_check_reelection (ops_test : OpsTest ) -> None :
154
152
"""Confirm that a new primary is elected when the current primary is torn down."""
155
- mysql_application_name , _ = await high_availability_test_setup (ops_test , mysql_charm_series )
153
+ mysql_application_name , _ = await high_availability_test_setup (ops_test )
156
154
application = ops_test .model .applications [mysql_application_name ]
157
155
158
156
await ensure_all_units_continuous_writes_incrementing (ops_test )
@@ -198,10 +196,10 @@ async def test_kill_primary_check_reelection(ops_test: OpsTest, mysql_charm_seri
198
196
199
197
@pytest .mark .group (2 )
200
198
@pytest .mark .abort_on_fail
201
- async def test_scaling_without_data_loss (ops_test : OpsTest , mysql_charm_series : str ) -> None :
199
+ async def test_scaling_without_data_loss (ops_test : OpsTest ) -> None :
202
200
"""Test that data is preserved during scale up and scale down."""
203
201
# Insert values into test table from the primary unit
204
- app , _ = await high_availability_test_setup (ops_test , mysql_charm_series )
202
+ app , _ = await high_availability_test_setup (ops_test )
205
203
application = ops_test .model .applications [app ]
206
204
207
205
random_unit = application .units [0 ]
@@ -275,14 +273,14 @@ async def test_scaling_without_data_loss(ops_test: OpsTest, mysql_charm_series:
275
273
276
274
277
275
@pytest .mark .group (3 )
278
- async def test_cluster_isolation (ops_test : OpsTest , mysql_charm_series : str ) -> None :
276
+ async def test_cluster_isolation (ops_test : OpsTest ) -> None :
279
277
"""Test for cluster data isolation.
280
278
281
279
This test creates a new cluster, create a new table on both cluster, write a single record with
282
280
the application name for each cluster, retrieve and compare these records, asserting they are
283
281
not the same.
284
282
"""
285
- app , _ = await high_availability_test_setup (ops_test , mysql_charm_series )
283
+ app , _ = await high_availability_test_setup (ops_test )
286
284
apps = [app , ANOTHER_APP_NAME ]
287
285
288
286
# Build and deploy secondary charm
@@ -292,7 +290,7 @@ async def test_cluster_isolation(ops_test: OpsTest, mysql_charm_series: str) ->
292
290
charm ,
293
291
application_name = ANOTHER_APP_NAME ,
294
292
num_units = 1 ,
295
- series = mysql_charm_series ,
293
+ series = "jammy" ,
296
294
)
297
295
async with ops_test .fast_forward ("60s" ):
298
296
await ops_test .model .block_until (
@@ -358,9 +356,9 @@ async def test_cluster_isolation(ops_test: OpsTest, mysql_charm_series: str) ->
358
356
359
357
@pytest .mark .group (1 )
360
358
@pytest .mark .abort_on_fail
361
- async def test_log_rotation (ops_test : OpsTest , mysql_charm_series : str ) -> None :
359
+ async def test_log_rotation (ops_test : OpsTest ) -> None :
362
360
"""Test the log rotation of text files."""
363
- app , _ = await high_availability_test_setup (ops_test , mysql_charm_series )
361
+ app , _ = await high_availability_test_setup (ops_test )
364
362
unit = ops_test .model .applications [app ].units [0 ]
365
363
366
364
# Exclude slowquery log files as slowquery logs are not enabled by default
0 commit comments