Kotlin Unit testing

Hi folks,

Looking for a bit of help here.  We're embracing the * as code mantra and so moving to use Kotlin.  But it really comes into its own when we can run unit tests prior to pushing the changes into TC.  So have created a new test module and added a few spek tests in there.  This test module references the actual .teamcity module and when the tests are executed from inside IntelliJ everything is good.  But if I run from maven no tests are found.  The structure is as follows

top

pom.xml

-> .teamcity

->-> pom.xml

-> tests

->-> pom.xml

The top level pom just defines the two modules

<modules>
<module>./.teamcity</module>
<module>./tests</module>
</modules>

The .teamcity pom is as generated and the test pom has additional dependencies for spek, junit and the surefire plugin defined

<build>
<testSourceDirectory>${project.basedir}/tests</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<includes>
<include>**/*Tests.*</include>
</includes>
</configuration>
</plugin>
...
</project>

but in maven I get the following message 

[INFO] ------------------------------------------------------------------------
[INFO] Building Build_And_Test_Project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ build_and_test ---
[INFO] Deleting C:\BB\IressTeamCity\mso-core\tests\target
[INFO]
[INFO] --- kotlin-maven-plugin:1.1.4-3:compile (compile) @ build_and_test ---
[INFO] Kotlin version 1.1.4-3 (JRE 1.8.0_112-b15)
[WARNING] No sources found skipping Kotlin compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ build_and_test ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\BB\IressTeamCity\mso-core\tests\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ build_and_test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-cli) @ build_and_test ---
[INFO] No tests to run.

 

By nature I'm a .NET developer and this is my first venture into the world of IntelliJ and maven, so be gentle.

 

0

Please sign in to leave a comment.