Allow enabling sonar rules for test sources


Thanks for coming to us with this suggestion! You will be probably happy to learn that we are actually already working on the topic, as we also feel that quality and maintainability of tests is important… and it therefore should be nicely covered in SonarQube!

We however realized that it would raise numerous questions in term of integration with existing SonarQube features, because it will have impacts on various metrics and dashboards.

As for today, we are on a really early stage of development, and still mainly brainstorming over the idea, but we are definitely moving forward. You can follow evolution of the expected feature here: Tests as First Class Citizen

Now, we really would like to know from you (or any other user reading this thread and interested by the feature) if you tried to workaround the current limitations of SonarQube. Could you answer the following questions?

  • Did you already try something to also cover your tests with other rules? (for instance: tweaking project configuration, two distinct SQ instances, etc.)
    • If yes, with what results and/or pain points?
  • What language(s) are you targeting?


1 Like