TestPostgreSQLKV tests against a real PostgreSQL instance, using a Docker container.
(t *testing.T)
| 28 | |
| 29 | // TestPostgreSQLKV tests against a real PostgreSQL instance, using a Docker container. |
| 30 | func TestPostgreSQLKV(t *testing.T) { |
| 31 | dbname := "camlitest_" + osutil.Username() |
| 32 | containerID, ip := dockertest.SetupPostgreSQLContainer(t, dbname) |
| 33 | defer containerID.KillRemove(t) |
| 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 | t.Fatalf("postgres.NewKeyValue = %v", err) |
| 45 | } |
| 46 | kvtest.TestSorted(t, kv) |
| 47 | } |
| 48 | |
| 49 | func TestPostgresDBNaming(t *testing.T) { |
| 50 | cases := []struct { |
nothing calls this directly
no test coverage detected