Hello,
We currently have SonarCloud (paid) on one of our Private Repos. An issue that we were running into was PRs from our developers that contain unit testing are being failed due to Duplication.
As a bit of background, we only have .sonarcloud.properties
in our master branch. The PRs are being made from a developer’s feature branch to our “development” branch. The PRs are still being analyzed by SonarCloud (which we want all PRs to be analyzed).
I have made some changes to the .sonarcloud.properties
as well as from the project’s Administration > Analysis Scope after the .sonarcloud.properties
changes did not work.
This is what I have in our sonarcloud.properties
:
sonar.cpd.exclusions=test/jasmine/unit/spec/**/*,test/jasmine/unit/spec/**/**/*,test/jasmine/unit/spec/**/**/**/*,test/jasmine/unit/spec/**/**/**/**/*,test/jasmine/unit/spec/lib/*_Spec.js,test/jasmine/unit/spec/restletScripts/*_Spec.js,test/jasmine/unit/spec/support/*_Spec.js,test/jasmine/unit/spec/emailCommunication/lib/*_Spec.js
Because of the fact that this hasn’t been working with sonar.cpd.exclusions
, I tried adding the things I want excluded to the sonar.exclusions
as well. It looks like the following:
sonar.exclusions=Objects/*.xml, test/jasmine/unit/spec/**/*, test/jasmine/unit/spec/**/**/*, test/jasmine/unit/spec/**/**/**/*, test/jasmine/unit/spec/**/**/**/**/*, test/jasmine/unit/spec/lib/*_Spec.js, test/jasmine/unit/spec/restletScripts/*_Spec.js, test/jasmine/unit/spec/support/*_Spec.js, test/jasmine/unit/spec/emailCommunication/lib/*_Spec.js
The exclusions do appear be working on some directories and files but not all.
An example where this exclusion appears to be working is the following:
test/jasmine/unit/spec/sfIntegration/lib/sfAdapter_Spec.js
An example where this exclusion is not working:
test/jasmine/unit/spec/emailCommunication/lib/emailCommunication_Spec.js
I believe I have accounted for all the possible patterns that would exclude this specific example (which is failing) but I wanted to see if there was anything in my configuration that seems like it would be preventing this from working correctly, or if the issue is due to .sonarcloud.properties not existing in the “development” branch.