Warning on analysis for use of sonar.tests.exclusions

Hi,

I’ve upgraded our test server to SonarQube 9.9 LTS from 8.9.5 LTS and everything looks good so far. However, we get a warning after analysis stating that we use both properties sonar.test.exclusions and sonar.tests.exclusions:

Use of sonar.test.exclusions and sonar.tests.exclusions at the same time. sonar.test.exclusions is taken into account. Consider updating your configuration

I’ve checked all configuration settings I could find and nowhere is sonar.tests.exclusions explicitely set.
The scanner context on SonarQube for the analysis only shows the values for sonar.test.exclusions. The maven scanner also logs the warning but does not show the value of sonar.tests.exclusions; even with DEBUG log level.

The version of the sonar-maven-plugin is 3.9.1.2184.

Is there any way how I could track down where the property is set?

[Edit] I’ve found this Jira ticket [PLUGINAPI-34] - Jira, introducing sonar.tests.[inclusions|exclusions] as alias of sonar.test.[inclusions|exclusions]. On the project’s ‘Analysis Scope’ page the property used is stated as sonar.test.exclusions. Should/can this property be migrated?

Hello,

Is there any way how I could track down where the property is set?

I don’t have the answer to this specific question but I would like to give some details about the ticket PLUGINAPI-34.

We introduced this alias because some users were by mistake putting an “s” at the end of “test”, in sonar.test.exclusions. Even if it would look more logical to have this “s” because it would be consistent with the property sonar.tests, this is not the choice that was made years ago, probably when Sonar was created.

Normally users who are correctly only using sonar.test.exclusions should not have the WARN message.
The official property to use is still sonar.test.exclusions.

Alex

Hi Alexandre,

is there a way to display all configured property values? I’ve checked all places where we set properties and none of them uses sonar.tests.
The analysis scope of a background tasks lists all values but doesn’t include sonar.tests. The same happens if the analysis is executed with debug logging.

Thanks,
Oliver

Hi @Alexandre_Gigleux,

I’ve found the reason for the warning:
Configuring sonar.global.test.exclusions in the global/administration analysis scope and sonar.test.exclusion in a project’s analysis scope somehow counts as duplicate configuration, too.
grafik
The warning from the scanner and the warning shown on a project should make this clear or the logic should be fixed.

Regards,
Oliver

1 Like

I get these warnings also on projects that does not have any test exclusions in them.

And as OP stated, these warnings occur even though I cannot find any place I have used the sonar.tests.exclusions.

Same for me.

Hi @Alexandre_Gigleux , any update on the topic?