MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / TestMySQLUnix

Function TestMySQLUnix

tests/mysql_test.go:96–120  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94}
95
96func TestMySQLUnix(t *testing.T) {
97 if testing.Short() {
98 t.Skip("skipping MySQL integration tests")
99 }
100 requireMySQLVars(t)
101 tmpDir, cleanup := createTempDir(t)
102 defer cleanup()
103
104 cfg := mysql.Config{
105 User: *mysqlUser,
106 Passwd: *mysqlPass,
107 DBName: *mysqlDB,
108 AllowNativePasswords: true,
109 // re-use utility function to determine the Unix address in a
110 // Windows-friendly way.
111 Addr: proxy.UnixAddress(tmpDir, *mysqlConnName),
112 Net: "unix",
113 }
114 // Prepare the initial arguments
115 args := []string{"--unix-socket", tmpDir, *mysqlConnName}
116 // Add the IP type flag using the helper
117 args = AddIPTypeFlag(args)
118 // Run the test
119 proxyConnTest(t, args, "mysql", cfg.FormatDSN())
120}
121
122func TestMySQLMCPUnix(t *testing.T) {
123 if testing.Short() {

Callers

nothing calls this directly

Calls 5

UnixAddressFunction · 0.92
requireMySQLVarsFunction · 0.85
AddIPTypeFlagFunction · 0.85
proxyConnTestFunction · 0.85
createTempDirFunction · 0.70

Tested by

no test coverage detected