-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fluent test framework #12215
Fluent test framework #12215
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12215 +/- ##
============================================
+ Coverage 61.73% 61.76% +0.03%
+ Complexity 1152 207 -945
============================================
Files 2424 2424
Lines 132526 132526
Branches 20483 20483
============================================
+ Hits 81810 81850 +40
+ Misses 44720 44675 -45
- Partials 5996 6001 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
c99a7cb
to
ff6f1ff
Compare
b0380c5
to
e92d5bd
Compare
import org.testng.annotations.BeforeClass; | ||
|
||
|
||
public class AbstractAggregationFunctionTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class AbstractAggregationFunctionTest { | |
public abstract class BaseAggregationFunctionTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just use abstract? We use that name pattern in several places (AbstractMetric
, AbstractRule
, AbstractCommand
, AbstractPlanNode
...) and it is also a common name in JDK (AbstractList
, AbstractChronology
...)
What I'm actually going to add for sure is the abstract class qualifier.
I found very difficult to understand most of the tests Pinot has. Some of them need to be complex given they are testing different service topologies or casuistics, but sometimes we just want to test a simple operator and in order to do so we need to create new classes that derive from BaseQueriesTest, which are usually not easy to read. Specially when the data the test will use is defined in csvs or other files.
This PR adds a fluent framework on top of BaseQueriesTest so we can define different tests in the same class in a fluent way that are close to the usual When-Given-Then tests.
This PR includes an example in pinot-core/src/test/java/org/apache/pinot/core/query/aggregation/function/CountAggregationFunctionTest.java, although I think we can improve that test before merging this PR.
I think a framework like would be easier to read and I plan to use it to cover most of the aggregation operations in order to feel confident once I modify them to support
nullHandlingEnabled
.