CHEF-3160: Improve code coverage % on inspec-5 branch (#6957)

* Exclude test files and examples file from code coverage to

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Get sonarqube working for inspec-5 branch through CI

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

---------

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>
This commit is contained in:
Vasundhara Jagdale 2024-01-30 11:48:37 +00:00 committed by GitHub
parent c0e5b20290
commit d4dd13b2ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View file

@ -70,6 +70,7 @@ if [ -n "${CI_ENABLE_COVERAGE:-}" ]; then
# See sonar-project.properties for additional settings
echo "--- running sonarscanner"
sonar-scanner \
-Dsonar.branch.name=inspec-5 \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonar.progress.com
fi

View file

@ -3,14 +3,11 @@ sonar.projectKey=inspec_inspec_AYahEXtgJ4YHsO5MtHEr
sonar.projectName=Chef-Inspec-inspec
#TODO find the way to configure it through expeditor
sonar.branch.name=inspec-5
# path to test coverage report generated by simplecov
sonar.ruby.coverage.reportPaths=coverage/coverage.json
# exclude test directories from coverage
sonar.coverage.exclusions=test/*,lib/plugins/*/test/*
sonar.coverage.exclusions=lib/bundles/inspec-compliance/*,examples/**/*,test/**,lib/plugins/*/test/**/*,test/unit/**/*,test/unit/*,test/functional/*,test/fixtures/**/*,test/artifacts/**/*\
sonar.exclusions=**/*.java,**/*.js,vendor/*