quick-perf / quickperf

QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
https://github.com/quick-perf/doc/wiki/QuickPerf
Apache License 2.0
488 stars 65 forks source link

Add a lenient mode to @ExpectJdbcBatching #144

Open jeanbisutti opened 3 years ago

jeanbisutti commented 3 years ago

Today, @ExpectJdbcBatching makes a test fails if INSERT, UPDATE or DELETE statements are executed without JDBC batching.

This issue follows #132. It aims to add a boolean lenient element to ExpectJdbcbatching annotation. The default value will be false.

With a true value, the test will not fail if the batch size would be less than two with JDBC batching. For example, if just one INSERT is executed without JDBC batching, the test will not fail.

gmarziou commented 3 years ago

This looks great. However, I wonder whether true/false is enough or a numerical threshold would cover more use cases.