From f9b8478673963be3fb98e61e22a18e7ba64b524d Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Fri, 7 Jul 2023 16:19:03 -0400 Subject: [PATCH] testserver/datastore: default to mysql8, check arm --- internal/testserver/datastore/mysql.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/testserver/datastore/mysql.go b/internal/testserver/datastore/mysql.go index afd633aa73..caa32fa7f3 100644 --- a/internal/testserver/datastore/mysql.go +++ b/internal/testserver/datastore/mysql.go @@ -7,6 +7,7 @@ import ( "context" "database/sql" "fmt" + "runtime" "testing" "github.com/google/uuid" @@ -44,7 +45,11 @@ type MySQLTesterOptions struct { // RunMySQLForTesting returns a RunningEngineForTest for the mysql driver // backed by a MySQL instance with RunningEngineForTest options - no prefix is added, and datastore migration is run. func RunMySQLForTesting(t testing.TB, bridgeNetworkName string) RunningEngineForTest { - return RunMySQLForTestingWithOptions(t, MySQLTesterOptions{Prefix: "", MigrateForNewDatastore: true}, bridgeNetworkName) + return RunMySQLForTestingWithOptions(t, MySQLTesterOptions{ + Prefix: "", + MigrateForNewDatastore: true, + UseV8: true, + }, bridgeNetworkName) } // RunMySQLForTestingWithOptions returns a RunningEngineForTest for the mysql driver @@ -54,7 +59,9 @@ func RunMySQLForTestingWithOptions(t testing.TB, options MySQLTesterOptions, bri require.NoError(t, err) containerImageTag := "5" - if options.UseV8 { + if runtime.GOARCH == "arm64" && !options.UseV8 { + t.Fatal("MySQL 5 does not support arm64") + } else if options.UseV8 { containerImageTag = "8" } @@ -63,7 +70,6 @@ func RunMySQLForTestingWithOptions(t testing.TB, options MySQLTesterOptions, bri Name: name, Repository: "mysql", Tag: containerImageTag, - Platform: "linux/amd64", // mysql:5 image does not have arm support Env: []string{"MYSQL_ROOT_PASSWORD=secret"}, ExposedPorts: []string{mysqlPortPair}, Cmd: []string{"--max-connections=500"}, // accommodate tests using the same container