Skip to content

Properly configure SonarQube source dir when tests and source dir overlap #1090

@nathanjmcdougall

Description

@nathanjmcdougall

These directories need to be disjoint. When using src layout, this works fine:

          sonar.sources=./src
          sonar.tests=./tests

But if we have a flat layout, this doesn't work, because files get indexed twice:

          sonar.sources=./
          sonar.tests=./tests

The exclusions should simply be set/augmented to always include ./tests via comma separation and this will fix the issue.

Test strategy is probably just regression-style unit tests to make sure the config contents are sound, and then I'll test them manually on a live pipeline.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions