Gavin,

I’m working on this in https://issues.apache.org/jira/browse/CALCITE-4885 
<https://issues.apache.org/jira/browse/CALCITE-4885>. Take a look at 
FixtureTest [1] to get an idea of how parser, validator, sql-to-rel or rule 
tests would look in your project.

My one concern is that once we make our test infrastructure public (as we have 
already started to with the new ’testkit’ module), people will expect that we 
follow semantic versioning. But we won’t. Of course semantic versioning is very 
nice if you are the consumer of a project, but it has a high cost for the 
project maintainers. Therefore there will be no guarantees of compatibility of 
the ‘testkit’ module from one release to the next. 

Julian

[1] 
https://github.com/julianhyde/calcite/blob/4885-test-fixtures/testkit/src/test/java/org/apache/calcite/test/FixtureTest.java


> On Dec 22, 2021, at 6:55 AM, Gavin Ray <[email protected]> wrote:
> 
> I am still learning the fundamentals of Calcite's API, and I've found that
> there are pre-made schemas
> and other utilities meant for testing inside of the Calcite repo.
> 
> Unfortunately it seems like a lot of these objects are private, because
> they aren't meant to be a part of the public API.
> 
> I've taken to copy-pasting entire files to be able to get tests setup in my
> own project:
> -
> https://github.com/GavinRay97/GraphQLCalcite/blob/master/src/main/kotlin/HrClusteredSchemaKotlin.kt
> 
> I think it could be valuable to others who aren't developing their code in
> the Calcite tree
> to be able to use the work that's been put into setting up premade test
> items.
> 
> Or maybe there is a better way, would appreciate any advice.
> 
> Thank you =)
> Gavin Ray

Reply via email to