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

Function TestPostgresFUSEConnect

tests/fuse_test.go:28–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26)
27
28func TestPostgresFUSEConnect(t *testing.T) {
29 if v := os.Getenv("IP_TYPE"); v == "private" || v == "psc" {
30 t.Skipf("skipping test because IP_TYPE is set to %v", v)
31 }
32 if testing.Short() {
33 t.Skip("skipping Postgres integration tests")
34 }
35 if os.Getenv("SKIP_FUSE_E2E_TESTS") == "true" {
36 t.Skip("skipping Postgres FUSE integration tests because SKIP_FUSE_E2E_TESTS is set")
37 }
38 tmpDir, cleanup := createTempDir(t)
39 defer cleanup()
40
41 host := proxy.UnixAddress(tmpDir, *postgresConnName)
42 dsn := fmt.Sprintf(
43 "host=%s user=%s password=%s database=%s sslmode=disable",
44 host, *postgresUser, *postgresPass, *postgresDB,
45 )
46 testFUSE(t, tmpDir, host, dsn)
47}
48
49func testFUSE(t *testing.T, tmpDir, host string, dsn string) {
50 tmpDir2, cleanup2 := createTempDir(t)

Callers

nothing calls this directly

Calls 3

UnixAddressFunction · 0.92
testFUSEFunction · 0.85
createTempDirFunction · 0.70

Tested by

no test coverage detected