Replies: 4 comments 7 replies
-
@mcarvin8 thanks for your interest in sfdx-hardis :) About coverage reports, to be honest for the moment we only handle the fact that it is > to a percentage, and it's currently not very documented (but thanks to your message I will enhance that ^^ ) The coverage check is configurable these ways:
If not on these values is set, the default is 75.0% (it is recommended to update it when doing sfdx-hardis CI/CD setup) This configuration is used in the following commands:
apex test run command uses arguments Does your plugin work with those formats (maybe just the Do you mean that with your plugin we could generate reports that would show covered/uncovered lines within native GitHub, Gitlab, Azure, Bitbucket ? If so, it could indeed be interesting, and if you use the generated output (or even a fixed file name that hardis could generate and always put in the same place), we could add an option in pipelines to call your plugin to postprocess those files then send the results to Git services :) |
Beta Was this translation helpful? Give feedback.
-
Gonna close this as resolved based on the hardis updates being done. I need to work on updating my existing postrun.ts hook to work with sfdx-hardis without duplicating itself, i.e. running twice since this is looking for the standard sf commands. But the work on this side is complete. |
Beta Was this translation helpful? Give feedback.
-
See mcarvin8/apex-code-coverage-transformer#84. This is probably the path of least resistance. I want to keep the hook as an optional thing for users, so they have to create the config JSON and then set the paths to the pre-defined Hardis path. Instructions posted in my README for those using both plugins. |
Beta Was this translation helpful? Give feedback.
-
Hi. I have a quick question regarding how sfdx-hardis handles code coverage reports generated by the
sf project deploy
andsf apex test
commands from the CLI.I know sfdx-hardis uses both CLI commands to execute deployments/tests in the org. So I'm guessing hardis is limited to what code coverage reports are currently supported by the Salesforce CLI, am I correct?
Something I've seen in various CLI issues/discussions
no-map
prefix in the CLI code-baseI wrote a CLI plugin that can handle the different coverage formats from the CLI deploy and test command (just using the standard "json" format provided by both), "fix" the deploy coverage inaccuracies, and add correct file-paths per your Salesforce DX project (using the sfdx-project.json file for package directories).
https://github.com/mcarvin8/apex-code-coverage-transformer
Not sure if you already have code in hardis that can handle some of these code coverage cases, but my plugin can also handle creating 4 possible formats at the moment: sonarqube, cobertura, clover, and lcovonly.info
If you want to discuss incorporating my plugin into hardis for advanced code coverage reporting so users can use sfdx-hardis to create code coverage reports for external tools like SonarQube, GitLab (Cobertura), etc., let me know.
That way, if users use the hardis deploy or test commands, they can get accurate code coverage reports they can use elsewhere for code quality.
Beta Was this translation helpful? Give feedback.
All reactions