I would like to exclude all of our test files in a repo from code duplication checks. Our test files are across multiple levels in our file structure in folders called tests/ and are named *.integration.test.ts. The exclusion file patterns we have added under Administration > General Settings > Analysis scope are not working. Please advise.
Hi,
Welcome to the community!
Tests are exempt from code duplication checks automatically. If yours are being swept up then it’s because they’re being misidentified.
You should start by making sure your sonar.sources
value is narrow enough, and that, optionally, your sonar.tests
value is correct.
After that, if this is still a problem (and really, you should do everything you can to get those tests correctly identified as tests rather than source files) then you can use a duplications exclusion.
HTH,
Ann