Skip to content

Commit

Permalink
fix(generators): fix benchmark tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Kropachev committed May 30, 2023
1 parent 0cdbba3 commit e771939
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkg/generators/schema_mutation_stmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ func BenchmarkGenInsertStmt(t *testing.B) {
t.Run(caseName,
func(subT *testing.B) {
schema, prc, gen, rnd, useLWT, _ := getAllForTestStmt(subT, caseName)
_, _ = genInsertStmt(schema, schema.Tables[0], gen.Get(), rnd, prc, useLWT)
subT.ResetTimer()
for x := 0; x < subT.N; x++ {
_, _ = genInsertStmt(schema, schema.Tables[0], gen.Get(), rnd, prc, useLWT)
}
})
}
}
Expand All @@ -118,7 +121,10 @@ func BenchmarkGenUpdateStmt(t *testing.B) {
t.Run(caseName,
func(subT *testing.B) {
schema, prc, gen, rnd, _, _ := getAllForTestStmt(subT, caseName)
_, _ = genUpdateStmt(schema, schema.Tables[0], gen.Get(), rnd, prc)
subT.ResetTimer()
for x := 0; x < subT.N; x++ {
_, _ = genUpdateStmt(schema, schema.Tables[0], gen.Get(), rnd, prc)
}
})
}
}
Expand All @@ -129,7 +135,10 @@ func BenchmarkGenDeleteRows(t *testing.B) {
t.Run(caseName,
func(subT *testing.B) {
schema, prc, gen, rnd, _, _ := getAllForTestStmt(subT, caseName)
_, _ = genDeleteRows(schema, schema.Tables[0], gen.Get(), rnd, prc)
subT.ResetTimer()
for x := 0; x < subT.N; x++ {
_, _ = genDeleteRows(schema, schema.Tables[0], gen.Get(), rnd, prc)
}
})
}
}

0 comments on commit e771939

Please sign in to comment.