5

Does somebody know about the following scenario:

I need to
- calculate an apex code coverage during deployment with Migration tool
- give the result on console,
- after that I need to decide about continuation deployment. If I will give less that 88% (for instance) of code coverage I need to mark build as failed in Jenkins and to stop a deployment, in other case I can go ahead.

So, what I need is just ability to set any value (greater 75) as required test coverage for my project.

5

I think you are going to have to write some Java code yourself to handle this. The salesforce Migration Ant code has references to the data but does not use it.

This XmlReport class (that is part of this open source project that builds on the Migration Ant tools) is collecting the coverage data for output in text form as its main purpose is to produce XmlReport format output that Jenkins can consume. You could add a threshold attribute to the Ant task and fail the task if that value is not reached when all the coverage data is added together.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.