MCPcopy Create free account
hub / github.com/foxcpp/maddy / createTestDB

Function createTestDB

internal/storage/imapsql/bench_test.go:43–57  ·  view source on GitHub ↗
(tb testing.TB, compAlgo string)

Source from the content-addressed store, hash-verified

41}
42
43func createTestDB(tb testing.TB, compAlgo string) *Storage {
44 if testDB == "" || testDSN == "" || testFsstore == "" {
45 tb.Skip("-sql.testdb, -sql.testdsn and -sql.testfsstore should be specified to run this benchmark")
46 }
47
48 db, err := imapsql.New(testDB, testDSN, &imapsql.FSStore{Root: testFsstore}, imapsql.Opts{
49 CompressAlgo: compAlgo,
50 })
51 if err != nil {
52 tb.Fatal(err)
53 }
54 return &Storage{
55 Back: db,
56 }
57}
58
59func BenchmarkStorage_Delivery(b *testing.B) {
60 randomKey := "rcpt-" + strconv.FormatInt(time.Now().UnixNano(), 10) + "@example.org"

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected