(t *testing.T)
| 29 | ) |
| 30 | |
| 31 | func newPostgresSorted(t *testing.T) sorted.KeyValue { |
| 32 | dbname := "camlitest_" + osutil.Username() |
| 33 | containerID, ip := dockertest.SetupPostgreSQLContainer(t, dbname) |
| 34 | |
| 35 | kv, err := sorted.NewKeyValue(jsonconfig.Obj{ |
| 36 | "type": "postgres", |
| 37 | "host": ip, |
| 38 | "database": dbname, |
| 39 | "user": dockertest.PostgresUsername, |
| 40 | "password": dockertest.PostgresPassword, |
| 41 | "sslmode": "disable", |
| 42 | }) |
| 43 | if err != nil { |
| 44 | containerID.KillRemove(t) |
| 45 | t.Fatal(err) |
| 46 | } |
| 47 | t.Cleanup(func() { |
| 48 | kv.Close() |
| 49 | containerID.KillRemove(t) |
| 50 | }) |
| 51 | return kv |
| 52 | } |
| 53 | |
| 54 | func TestSorted_Postgres(t *testing.T) { |
| 55 | kv := newPostgresSorted(t) |
no test coverage detected