(t *testing.T)
| 93 | } |
| 94 | |
| 95 | func TestPostgresMCPUnix(t *testing.T) { |
| 96 | if testing.Short() { |
| 97 | t.Skip("skipping Postgres integration tests") |
| 98 | } |
| 99 | requirePostgresVars(t) |
| 100 | tmpDir, cleanup := createTempDir(t) |
| 101 | defer cleanup() |
| 102 | |
| 103 | dsn := fmt.Sprintf("host=%s user=%s password=%s database=%s sslmode=disable", |
| 104 | // re-use utility function to determine the Unix address in a |
| 105 | // Windows-friendly way. |
| 106 | proxy.UnixAddress(tmpDir, *postgresMCPConnName), |
| 107 | *postgresUser, *postgresMCPPass, *postgresDB) |
| 108 | |
| 109 | // Prepare the initial arguments |
| 110 | args := []string{"--unix-socket", tmpDir, *postgresMCPConnName} |
| 111 | // Add the IP type flag using the helper |
| 112 | args = AddIPTypeFlag(args) |
| 113 | // Run the test |
| 114 | proxyConnTest(t, args, "pgx", dsn) |
| 115 | } |
| 116 | |
| 117 | func createTempDir(t *testing.T) (string, func()) { |
| 118 | testDir, err := os.MkdirTemp("", "*") |
nothing calls this directly
no test coverage detected