# Junit test reports not imported

**URL:** <https://community.sonarsource.com/t/junit-test-reports-not-imported/89105>\
**Category:** SonarQube Server / Community Build\
**Tags:** junit, java\
**Created:** [April 13, 2023, 6:48am UTC](https://community.sonarsource.com/t/junit-test-reports-not-imported/89105 "2023-04-13T06:48:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohanss08](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@mohanss08](https://community.sonarsource.com/u/mohanss08)\
**Post date:** [April 13, 2023, 6:48am UTC](https://community.sonarsource.com/t/junit-test-reports-not-imported/89105/1 "2023-04-13T06:48:57Z")

</div>

I’m using `sonarqube Community EditionVersion 9.9` with this version tried to upload `junit test` reports, my analysis completed successfully but Unit Test results can’t view on the dashboard

Have the below project properties values.

```auto
sonar.projectName=AppTest
sonar.scm.disabled=true 
sonar.projectKey=app.test 
sonar.projectVersion=v1.1
sonar.sourceEncoding=UTF-8 
sonar.language=java
sonar.projectBaseDir=/sonar/gradle_build/app1 
sonar.sources=Appsrc
sonar.java.binaries=Appsrc/build/ 
sonar.junit.reportPaths=Appsrc/build/test-results/**/*.xml 
sonar.coverage.jacoco.xmlReportPaths=Appsrc/build/reports/jacoco/*.xml

```

**UT Folder view**

```auto
$ ls Appsrc/build/test-results/
testfolder testfolder1 testfolder2 testfolder3
testfolder4 testfolder5 testfolder6 testfolder7

```

I have `.xml` files inside all the above listed directories. my gradle build and ut & coverage completed before sonarqube analysis.

Can i know what is the issue with my property settings to upload UT reports?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [April 14, 2023, 8:20am UTC](https://community.sonarsource.com/t/junit-test-reports-not-imported/89105/2 "2023-04-14T08:20:14Z")

</div>

Hey there.

The analyzer is expecting a list of directories, instead of glob patterns. Like:

`sonar.junit.reportPaths=target/surefire-reports,target/failsafe-reports`

And, if this is a Gradle project, I strongly reccomend using the [Scanner for Gradle](https://docs.sonarqube.org/latest/analyzing-source-code/scanners/sonarscanner-for-gradle/) which should take care of setting these paramters automatically.

---

<div class="post-metadata">

**Author:** ![mohanss08](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@mohanss08](https://community.sonarsource.com/u/mohanss08)\
**Post date:** [April 14, 2023, 10:02am UTC](https://community.sonarsource.com/t/junit-test-reports-not-imported/89105/3 "2023-04-14T10:02:13Z")

</div>

Hello Colin,

I’m using `sonar-scanner-cli-4.8.0.2856` scanner and tried with below property value.

```auto
sonar.junit.reportPaths=Appsrc/build/test-results/testfolder/

```

Still i can’t see the `Unit Tests` result on project dashboard.

In log i have below

```auto
INFO: parsing [/sonar/gradle_build/app1/Appsrc/build/test-results/testfolder]
ERROR: Reports path not found or is not a directory: /sonar/gradle_build/app1/Appsrc/build/test-results/testfolder

```

Next with below same problem.

```auto
sonar.junit.reportPaths=Appsrc/build/test-results/testfolder/TEST-.*.xml

```

Error:

```auto
INFO: parsing [/sonar/gradle_build/app1/Appsrc/build/test-results/testfolder/Appsrc/build/test-results/testfolder/TEST-.*.xml]
ERROR: Reports path not found or is not a directory: /sonar/gradle_build/app1/Appsrc/build/test-results/testfolder/Appsrc/build/test-results/testfolder/TEST-.*.xml

```

However my code coverage results able to view on dashboard.

---

<div class="post-metadata">

**Author:** ![Nishwal\_Shetty](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nishwal_shetty/32/21793_2.png) [@Nishwal\_Shetty](https://community.sonarsource.com/u/Nishwal_Shetty)\
**Post date:** [April 17, 2023, 8:19am UTC](https://community.sonarsource.com/t/junit-test-reports-not-imported/89105/4 "2023-04-17T08:19:19Z")

</div>

any update on this ?

i have the same problem!

---

<div class="post-metadata">

**Author:** ![bgranier](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@bgranier](https://community.sonarsource.com/u/bgranier)\
**Post date:** [November 13, 2023, 10:11pm UTC](https://community.sonarsource.com/t/junit-test-reports-not-imported/89105/5 "2023-11-13T22:11:11Z")

</div>

Hi,

I am not sure to have the answer but to see my tests in Sonar UI, I have to add the sonar.tests property to sonar scanner configuration. This is the list of tests folders, like src/test/java,src/it/java.

Maybe it could help.
