MCPcopy
hub / github.com/ent/ent / TestPostgres

Function TestPostgres

entc/integration/integration_test.go:108–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestPostgres(t *testing.T) {
109 for version, port := range map[string]int{
110 "10": 5430,
111 "11": 5431,
112 "12": 5432,
113 "13": 5433,
114 "14": 5434,
115 "15": 5435,
116 "16": 5436,
117 "17": 5437,
118 } {
119 addr := fmt.Sprintf("host=localhost port=%d user=postgres dbname=test password=pass sslmode=disable", port)
120 t.Run(version, func(t *testing.T) {
121 t.Parallel()
122 client := enttest.Open(t, dialect.Postgres, addr, opts)
123 defer client.Close()
124 for _, tt := range tests {
125 name := runtime.FuncForPC(reflect.ValueOf(tt).Pointer()).Name()
126 t.Run(name[strings.LastIndex(name, ".")+1:], func(t *testing.T) {
127 drop(t, client)
128 tt(t, client)
129 })
130 }
131 })
132 }
133}
134
135var (
136 opts = enttest.WithMigrateOptions(

Callers

nothing calls this directly

Calls 5

OpenFunction · 0.92
RunMethod · 0.80
dropFunction · 0.70
CloseMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…