mcarvin8 / apex-code-coverage-transformer

A Salesforce CLI plugin to transform apex code coverage JSONs into Generic Test Coverage Reports (XML) for SonarQube.
MIT License
5 stars 0 forks source link

could you share an example of your sonar config #20

Open mathpaquette opened 1 week ago

mathpaquette commented 1 week ago

Hello, first, thanks for the effort of making it available for us ! Just wondering how's your config looks like? Could you share an example with us for managing sf run test test-result-codecoverage.json and the generated coverage file ?

Regards

mcarvin8 commented 3 days ago

Thanks @mathpaquette for submitting this. Sorry I've been on travel for a bit and just catching up on notifications.

I'd like to confirm what config you're looking for? I have an example of this plugin's generated coverage XML in the repo readme, as well as example Salesforce CLI commands to reference to generate the original JSON files for sf run test command. I believe I have a typo in my readme with the default sf run test JSON file (which is test-result-codecoverage.json as you've listed it).

Not sure if you mean my team's sonar-project.properties file for sonar config??

Here's my sonar properties file in case that's what you're looking for.

# Specify Salesforce Apex as the primary language to be analyzed
sonar.language=apex

# Define the source directories to find the source files
sonar.sources=force-app/main/default/classes,force-app/main/default/triggers

# Encoding of source files
sonar.sourceEncoding=UTF-8

# Specify the Apex file suffixes
sonar.apex.file.suffixes=cls,trigger

# Specify Salesforce rules profile for Apex
sonar.apex.rules.profile=salesforce

# Specify file extensions to scan
sonar.inclusions=**/*.cls,**/*.trigger

# Do not include test classes in coverage results
sonar.coverage.exclusions=**/*test*.cls,**/*Test*.cls,**/*TEST*.cls