(tb testing.TB, compAlgo string)
| 41 | } |
| 42 | |
| 43 | func 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 | |
| 59 | func BenchmarkStorage_Delivery(b *testing.B) { |
| 60 | randomKey := "rcpt-" + strconv.FormatInt(time.Now().UnixNano(), 10) + "@example.org" |
no outgoing calls
no test coverage detected