MCPcopy
hub / github.com/perkeep/perkeep / newPostgresSorted

Function newPostgresSorted

pkg/index/postgres_test.go:31–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29)
30
31func 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
54func TestSorted_Postgres(t *testing.T) {
55 kv := newPostgresSorted(t)

Callers 1

TestSorted_PostgresFunction · 0.85

Calls 6

CloseMethod · 0.95
UsernameFunction · 0.92
SetupPostgreSQLContainerFunction · 0.92
NewKeyValueFunction · 0.92
KillRemoveMethod · 0.80
FatalMethod · 0.80

Tested by

no test coverage detected