@@ -14,14 +14,15 @@ import (
1414
1515// TestAccGrant_WithTestcontainers tests basic grant functionality
1616// Uses shared container set up in TestMain
17+ // Skips RDS (same as original test)
1718func TestAccGrant_WithTestcontainers (t * testing.T ) {
1819 // Use shared container set up in TestMain
1920 _ = getSharedMySQLContainer (t , "" )
2021
2122 dbName := fmt .Sprintf ("tf-test-%d" , rand .Intn (100 ))
2223 userName := fmt .Sprintf ("jdoe-%s" , dbName )
2324 resource .Test (t , resource.TestCase {
24- PreCheck : func () { testAccPreCheck (t ) },
25+ PreCheck : func () { testAccPreCheck (t ); testAccPreCheckSkipRds ( t ) },
2526 ProviderFactories : testAccProviderFactories ,
2627 CheckDestroy : testAccGrantCheckDestroy ,
2728 Steps : []resource.TestStep {
@@ -56,14 +57,15 @@ func TestAccGrant_WithTestcontainers(t *testing.T) {
5657}
5758
5859// TestAccRevokePrivRefresh_WithTestcontainers tests privilege revocation and refresh
60+ // Skips RDS (same as original test)
5961func TestAccRevokePrivRefresh_WithTestcontainers (t * testing.T ) {
6062 // Use shared container set up in TestMain
6163 _ = getSharedMySQLContainer (t , "" )
6264
6365 dbName := fmt .Sprintf ("tf-test-%d" , rand .Intn (100 ))
6466
6567 resource .Test (t , resource.TestCase {
66- PreCheck : func () { testAccPreCheck (t ) },
68+ PreCheck : func () { testAccPreCheck (t ); testAccPreCheckSkipRds ( t ) },
6769 ProviderFactories : testAccProviderFactories ,
6870 CheckDestroy : testAccGrantCheckDestroy ,
6971 Steps : []resource.TestStep {
@@ -142,13 +144,17 @@ func TestAccBroken_WithTestcontainers(t *testing.T) {
142144}
143145
144146// TestAccDifferentHosts_WithTestcontainers tests grants with different hosts
147+ // Skips TiDB (same as original test)
145148func TestAccDifferentHosts_WithTestcontainers (t * testing.T ) {
146149 // Use shared container set up in TestMain
147150 _ = getSharedMySQLContainer (t , "" )
148151
149152 dbName := fmt .Sprintf ("tf-test-%d" , rand .Intn (100 ))
150153 resource .Test (t , resource.TestCase {
151- PreCheck : func () { testAccPreCheck (t ) },
154+ PreCheck : func () {
155+ testAccPreCheck (t )
156+ testAccPreCheckSkipTiDB (t )
157+ },
152158 ProviderFactories : testAccProviderFactories ,
153159 CheckDestroy : testAccGrantCheckDestroy ,
154160 Steps : []resource.TestStep {
@@ -178,13 +184,18 @@ func TestAccDifferentHosts_WithTestcontainers(t *testing.T) {
178184}
179185
180186// TestAccGrantComplex_WithTestcontainers tests complex grant scenarios
187+ // Skips TiDB, RDS (same as original test)
181188func TestAccGrantComplex_WithTestcontainers (t * testing.T ) {
182189 // Use shared container set up in TestMain
183190 _ = getSharedMySQLContainer (t , "" )
184191
185192 dbName := fmt .Sprintf ("tf-test-%d" , rand .Intn (100 ))
186193 resource .Test (t , resource.TestCase {
187- PreCheck : func () { testAccPreCheck (t ) },
194+ PreCheck : func () {
195+ testAccPreCheck (t )
196+ testAccPreCheckSkipTiDB (t )
197+ testAccPreCheckSkipRds (t )
198+ },
188199 ProviderFactories : testAccProviderFactories ,
189200 CheckDestroy : testAccGrantCheckDestroy ,
190201 Steps : []resource.TestStep {
@@ -249,13 +260,20 @@ func TestAccGrantComplex_WithTestcontainers(t *testing.T) {
249260}
250261
251262// TestAccGrantComplexMySQL8_WithTestcontainers tests MySQL 8.0 specific grants
263+ // Skips RDS, MariaDB, MySQL < 8.0, TiDB (same as original test)
252264func TestAccGrantComplexMySQL8_WithTestcontainers (t * testing.T ) {
253265 // Use shared container set up in TestMain
254266 _ = getSharedMySQLContainer (t , "" )
255267
256268 dbName := fmt .Sprintf ("tf-test-%d" , rand .Intn (100 ))
257269 resource .Test (t , resource.TestCase {
258- PreCheck : func () { testAccPreCheck (t ) },
270+ PreCheck : func () {
271+ testAccPreCheck (t )
272+ testAccPreCheckSkipRds (t )
273+ testAccPreCheckSkipMariaDB (t )
274+ testAccPreCheckSkipNotMySQLVersionMin (t , "8.0.0" )
275+ testAccPreCheckSkipTiDB (t )
276+ },
259277 ProviderFactories : testAccProviderFactories ,
260278 CheckDestroy : testAccGrantCheckDestroy ,
261279 Steps : []resource.TestStep {
@@ -275,14 +293,19 @@ func TestAccGrantComplexMySQL8_WithTestcontainers(t *testing.T) {
275293}
276294
277295// TestAccGrant_role_WithTestcontainers tests role grants (requires MySQL 8.0+)
296+ // Skips RDS, MySQL < 8.0 (same as original test)
278297func TestAccGrant_role_WithTestcontainers (t * testing.T ) {
279298 // Use shared container set up in TestMain
280299 _ = getSharedMySQLContainer (t , "" )
281300
282301 dbName := fmt .Sprintf ("tf-test-%d" , rand .Intn (100 ))
283302 roleName := fmt .Sprintf ("TFRole-exp%d" , rand .Intn (100 ))
284303 resource .Test (t , resource.TestCase {
285- PreCheck : func () { testAccPreCheck (t ) },
304+ PreCheck : func () {
305+ testAccPreCheck (t )
306+ testAccPreCheckSkipRds (t )
307+ testAccPreCheckSkipNotMySQLVersionMin (t , "8.0.0" )
308+ },
286309 ProviderFactories : testAccProviderFactories ,
287310 CheckDestroy : testAccGrantCheckDestroy ,
288311 Steps : []resource.TestStep {
@@ -310,14 +333,20 @@ func TestAccGrant_role_WithTestcontainers(t *testing.T) {
310333}
311334
312335// TestAccGrant_roleToUser_WithTestcontainers tests granting roles to users (requires MySQL 8.0+)
336+ // Skips RDS, MySQL < 8.0, TiDB (same as original test)
313337func TestAccGrant_roleToUser_WithTestcontainers (t * testing.T ) {
314338 // Use shared container set up in TestMain
315339 _ = getSharedMySQLContainer (t , "" )
316340
317341 dbName := fmt .Sprintf ("tf-test-%d" , rand .Intn (100 ))
318342 roleName := fmt .Sprintf ("TFRole-%d" , rand .Intn (100 ))
319343 resource .Test (t , resource.TestCase {
320- PreCheck : func () { testAccPreCheck (t ) },
344+ PreCheck : func () {
345+ testAccPreCheck (t )
346+ testAccPreCheckSkipRds (t )
347+ testAccPreCheckSkipNotMySQLVersionMin (t , "8.0.0" )
348+ testAccPreCheckSkipTiDB (t )
349+ },
321350 ProviderFactories : testAccProviderFactories ,
322351 CheckDestroy : testAccGrantCheckDestroy ,
323352 Steps : []resource.TestStep {
@@ -334,13 +363,19 @@ func TestAccGrant_roleToUser_WithTestcontainers(t *testing.T) {
334363}
335364
336365// TestAccGrant_complexRoleGrants_WithTestcontainers tests complex role grant scenarios (requires MySQL 8.0+)
366+ // Skips MariaDB, MySQL < 8.0, TiDB (same as original test)
337367func TestAccGrant_complexRoleGrants_WithTestcontainers (t * testing.T ) {
338368 // Use shared container set up in TestMain
339369 _ = getSharedMySQLContainer (t , "" )
340370
341371 dbName := fmt .Sprintf ("tf-test-%d" , rand .Intn (100 ))
342372 resource .Test (t , resource.TestCase {
343- PreCheck : func () { testAccPreCheck (t ) },
373+ PreCheck : func () {
374+ testAccPreCheck (t )
375+ testAccPreCheckSkipMariaDB (t )
376+ testAccPreCheckSkipNotMySQLVersionMin (t , "8.0.0" )
377+ testAccPreCheckSkipTiDB (t )
378+ },
344379 ProviderFactories : testAccProviderFactories ,
345380 CheckDestroy : testAccGrantCheckDestroy ,
346381 Steps : []resource.TestStep {
0 commit comments