MCPcopy Index your code
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / TestPostgresUnix

Function TestPostgresUnix

tests/postgres_test.go:73–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestPostgresUnix(t *testing.T) {
74 if testing.Short() {
75 t.Skip("skipping Postgres integration tests")
76 }
77 requirePostgresVars(t)
78 tmpDir, cleanup := createTempDir(t)
79 defer cleanup()
80
81 dsn := fmt.Sprintf("host=%s user=%s password=%s database=%s sslmode=disable",
82 // re-use utility function to determine the Unix address in a
83 // Windows-friendly way.
84 proxy.UnixAddress(tmpDir, *postgresConnName),
85 *postgresUser, *postgresPass, *postgresDB)
86
87 // Prepare the initial arguments
88 args := []string{"--unix-socket", tmpDir, *postgresConnName}
89 // Add the IP type flag using the helper
90 args = AddIPTypeFlag(args)
91 // Run the test
92 proxyConnTest(t, args, "pgx", dsn)
93}
94
95func TestPostgresMCPUnix(t *testing.T) {
96 if testing.Short() {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected