jihoonson opened a new pull request #9564: Framework for aggregate testing; 
Example tests with LongSumAggregatorFactory
URL: https://github.com/apache/druid/pull/9564
   ### Description
   We currently have decent number of tests for the aggregate, but even with 
them, we have been having hard time to write good tests verifying all edge 
cases. A most recent example could be a couple of bugs found in sql-compatible 
null handling mode. I think this is because we had to write every test from 
scratch due to the lack of a good framework.
   This PR adds a new framework, `AggregateTestBase`, which generates random 
data including nulls for all data types. The data can be stored in either 
`IncrementalIndex` or `QueryableIndex` depending on a parameter, the caller can 
test reading from both of them. 
   To use the same data generator with our benchmarks in `AggregateTestBase`, I 
renamed some classes including `BenchmarkSchemaInfo`, `BenchmarkColumnSchema`, 
`BenchmarkDataGenerator`, `BenchmarkColumnValueGenerator` and moved them to 
   Some example tests are found in `LongSumAggregateTest`. This class tests 
only `aggregate()` and `bufferAggregate()` using the data generated by 
`AggregateTestBase`. There are a couple of more new tests in 
   This PR has:
   - [x] been self-reviewed.
      - [ ] using the [concurrency 
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [x] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in 
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [x] added unit tests or modified existing tests to cover new code paths.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   <!-- Check the items by putting "x" in the brackets for the done things. Not 
all of these items apply to every PR. Remove the items which are not done or 
not relevant to the PR. None of the items from the checklist above are strictly 
necessary, but it would be very helpful if you at least self-review the PR. -->
   ##### Key changed/added classes in this PR
    * `MyFoo`
    * `OurBar`
    * `TheirBaz`

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to