Skip to content

Commit

Permalink
testserver/datastore: default to mysql8, check arm
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Jul 14, 2023
1 parent 4790e80 commit 40cf4a9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/testserver/datastore/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"database/sql"
"fmt"
"runtime"
"testing"

"github.com/google/uuid"
Expand Down Expand Up @@ -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
Expand All @@ -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"
}

Expand Down

0 comments on commit 40cf4a9

Please sign in to comment.