You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Zoltan Haindrich <ki...@rxd.hu> on 2018/10/03 10:19:43 UTC

Re: CALCITE-2458 Use of Kotlin for unit tests

Hello,

I would like to note that this change have also altered that now all tests in the core module are now compiled by the kotlin compiler.
As I think Calcite is still a java library: I think that it would be better to compile and run the main tests by the supported platform's tools - and probably move the 
kotlin tests into a separate submodule.
Right now it is not possible to compile the core module's tests without kotlin support: because the only kotlin test which contains "hello world" have made into the 
CalcitesSuite.java.

regards,
Zoltan


On 9/24/18 11:43 PM, Vladimir Sitnikov wrote:
> Thanks everybody for your comments.
> 
> I've received no strong objections so far, so I assume lazy consensus.
> I've merged the PR in
> https://git-wip-us.apache.org/repos/asf?p=calcite.git;a=commit;h=55d86646fe598d215bd53dbeac2bbbf32a9506f9
> 
> Vladimir
> 

Re: CALCITE-2458 Use of Kotlin for unit tests

Posted by Vladimir Sitnikov <si...@gmail.com>.
Zoltan>if I run the java compiler it cames back complaining that it doesn't
know what the testkt is.

In other words, Kotlin compiles *.kt files, and javac compiles *.java files.
As for me it looks great.

Zoltan>But still: are there any benefits that kotlin is added to the core
module?

Some of them are highlighted in CALCITE-2458 description.
On top of that, having "core" tests in "core" module simplifies development
flow: one can run tests from within IDE (e.g. hack relevant class and run
relevant test), one can just use `mvn test` to run the tests, and so on.
Building "just two modules" with maven is a pain.
Maven modules are processed sequentially, so adding more modules would pile
up overhead.
Then there's "release artifacts", and what sense would it make "core-tests"
artifact published to Central?

Vladimir

Re: CALCITE-2458 Use of Kotlin for unit tests

Posted by Zoltan Haindrich <ki...@rxd.hu>.
On 10/3/18 2:35 PM, Vladimir Sitnikov wrote:
>  > mvn install -pl core -DskipTests -Dcheckstyle.skip org.jetbrains.kotlin:kotlin-maven-plugin:1.2.71:test-compile
> 
> What do you mean by "install" here?
> "install" here builds the full project with all the plugins, and it includes regular javac stuff.

yes; that install was misplaced...my mistake; sorry - if I run the java compiler it cames back complaining that it doesn't know what the testkt is.


But still: are there any benefits that kotlin is added to the core module?

Re: CALCITE-2458 Use of Kotlin for unit tests

Posted by Vladimir Sitnikov <si...@gmail.com>.
> mvn install -pl core -DskipTests -Dcheckstyle.skip
org.jetbrains.kotlin:kotlin-maven-plugin:1.2.71:test-compile

What do you mean by "install" here?
"install" here builds the full project with all the plugins, and it
includes regular javac stuff.

Vladimir

Re: CALCITE-2458 Use of Kotlin for unit tests

Posted by Zoltan Haindrich <ki...@rxd.hu>.

On 10/3/18 12:50 PM, Vladimir Sitnikov wrote:
>> I would like to note that this change have also altered that now all tests
> in the core module are now compiled by the kotlin compiler.
> 
> What do you mean by that?

If I understand it correctly it works by wrapping around the java compiler somewhere inside the plugin; to enable bi directional callability between kotlin and java classes.

...or I'm interpreting the output of the below commands incorrectly?

rm -r core/target/{test-,}classes/
mvn install -pl core -DskipTests -Dcheckstyle.skip org.jetbrains.kotlin:kotlin-maven-plugin:1.2.71:test-compile
find core/target/test-classes -name *.class|head


> 
>> Right now it is not possible to compile the core module's tests without
> kotlin support
> 
> Why do you want that?
> Even if Kotlin tests are moved to a separate module, it would be impossible
> to compile that module "without kotlin support".

I tend to only work with a single module; which I have something to do...in Calcite that's usually just core; I don't see any reason to load all the others - it will just 
compile them all the time - and it usually just fills my workspace with stuff I don't need - if it was a separate module: I wouldn't ever load the kotlin test module...only 
if it breaks...


Zoltan

Re: CALCITE-2458 Use of Kotlin for unit tests

Posted by Vladimir Sitnikov <si...@gmail.com>.
>I would like to note that this change have also altered that now all tests
in the core module are now compiled by the kotlin compiler.

What do you mean by that?

>Right now it is not possible to compile the core module's tests without
kotlin support

Why do you want that?
Even if Kotlin tests are moved to a separate module, it would be impossible
to compile that module "without kotlin support".

Vladimir