# Automation tests and reports in Kotlin + Junit5 + Maven are not recognized

**URL:** <https://discuss.kotlinlang.org/t/automation-tests-and-reports-in-kotlin-junit5-maven-are-not-recognized/26007>\
**Category:** Support\
**Created:** [November 27, 2022, 9:09pm UTC](https://discuss.kotlinlang.org/t/automation-tests-and-reports-in-kotlin-junit5-maven-are-not-recognized/26007 "2022-11-27T21:09:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![orit.hod](https://avatars.discourse-cdn.com/v4/letter/o/e36b37/32.png) [@orit.hod](https://discuss.kotlinlang.org/u/orit.hod)\
**Post date:** [November 27, 2022, 9:09pm UTC](https://discuss.kotlinlang.org/t/automation-tests-and-reports-in-kotlin-junit5-maven-are-not-recognized/26007/1 "2022-11-27T21:09:16Z")

</div>

Recently, I started designing a new Automation test infrastructure in Kotlin + Junit5 + Maven. (Regression tests)

1. Test are properly run using the Intellij buttons, but it is not recognized by “mvn test”:

```auto
> *[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ CIQBE ---*
> *[INFO] No sources to compile*
> *[INFO] *
> *[INFO] --- kotlin-maven-plugin:1.7.20:test-compile (test-compile) @ CIQBE ---*
> *[WARNING] No sources found skipping Kotlin compile*
> *[INFO] *
> *[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ CIQBE ---*
> *[INFO] No tests to run.*
> *[INFO] ------------------------------------------------------------------------*
> *[INFO] BUILD SUCCESS*
> *[INFO] ------------------------------------------------------------------------*

```

1. Using “mvn site” for reports upload, also shows “0” test. (Assuming affected by the same reason )

2. My Project structure is different then default unit test structure. (See attached screenshot)  
I tried to override “testSourceDirectory” in pom file, but path was not affected:  
(also marked in screenshot)

```auto
<build>
    <testSourceDirectory>${project.basedir}/src/main/kotlin</testSourceDirectory>

```

Pom.xml:  
`<kotlin.version>1.7.20</kotlin.version>`

Can you please guide me how Kotlin tests should be configured?

![Screenshot 2022-11-27 230237](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/4/4d23cf305d59a07f6d43af165565a377d9e8250c.png)

 ![Screenshot 2022-11-27 214426](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/9/92dfd0237def53185edf317be90976b4c08c1214.png)  
 ![Screenshot 2022-11-27 230331](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/2/214d9ad28a7488d5e3276ef6de44711e64506a12.png)

---

<div class="post-metadata">

**Author:** ![orit.hod](https://avatars.discourse-cdn.com/v4/letter/o/e36b37/32.png) [@orit.hod](https://discuss.kotlinlang.org/u/orit.hod)\
**Post date:** [November 29, 2022, 7:43pm UTC](https://discuss.kotlinlang.org/t/automation-tests-and-reports-in-kotlin-junit5-maven-are-not-recognized/26007/2 "2022-11-29T19:43:33Z")

</div>

Problem is solved, using the following instructions:

> **[Running Kotlin Tests With Maven](https://www.petrikainulainen.net/programming/testing/running-kotlin-tests-with-maven/)**
>
> When we start a new project with Kotlin, one of the first things that we have to do is to create a Maven project that can compile and run our application. However, our job isn't done yet. We still have to figure out a way to compile and run our...
