MCPcopy
hub / github.com/perkeep/perkeep / newMySQLSorted

Function newMySQLSorted

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

Source from the content-addressed store, hash-verified

29)
30
31func newMySQLSorted(t *testing.T) sorted.KeyValue {
32 dbname := "camlitest_" + osutil.Username()
33 containerID, ip := dockertest.SetupMySQLContainer(t, dbname)
34
35 kv, err := sorted.NewKeyValue(jsonconfig.Obj{
36 "type": "mysql",
37 "host": ip + ":3306",
38 "database": dbname,
39 "user": dockertest.MySQLUsername,
40 "password": dockertest.MySQLPassword,
41 })
42 if err != nil {
43 containerID.KillRemove(t)
44 t.Fatal(err)
45 }
46 t.Cleanup(func() {
47 kv.Close()
48 containerID.KillRemove(t)
49
50 })
51 return kv
52}
53
54func TestSorted_MySQL(t *testing.T) {
55 kv := newMySQLSorted(t)

Callers 1

TestSorted_MySQLFunction · 0.85

Calls 6

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

Tested by

no test coverage detected