0

Is there a way to get a report of the code coverage during or from a deployment?

Currently I have 85% total coverage in my production (cleared all test and ran all test to be sure this is accurate), but when I'm deploying a very simple change right now (not even enough lines of code to offset my current coverage) I get 57/57 100% successful test but failed deployment because of 74% coverage.

My guess is since the code I'm deploying is so minor (even if no lines were covered I'd still have enough total coverage), is that something is failing (silently) causing previous code in production to no longer be covered. Unfortunately I can't see what files are short based from this deployment because the only report I get back is 74% and no test failures :(

Appreciate the help

UPDATE:

I posted a ticket to SF support. Took a few days to get a response and initially they wouldn't even help because we apparently do not have developer support (typical SalesForce support to not even read your problem before quoting you your licensing limits).

Anyways, after a call to a sales rep they they finally looked into the issue and responded with the following:

Connection User 04/01/2015 10:09:34 AM PDT

Hi Nick,

I further checked on this and found that yes we are experiencing issues with test class at our end.

The bad line coverage issues as you mentioned on stack trace has not been identified as bug though but I checked that many customers are complaining the same.

Since this is been complained by plenty of customers our R & D team will take notice on it and might create a public known issue link for customers.

There are other issues too , related to test class only, for instance - https://success.salesforce.com/issues_view?id=a1p30000000T4oRAAS

Bottom line is - as of now no known issue is published for your concerned problem however I confirm that other users are also facing the same so we might see a bug link on it.

Recompilation and clearing Test execution history might help but sometimes it doesn't.

Kindly let me know if you have any other concern too regarding this.

Thanks, Ashish Developer support salesforce.com

So that's that for now I take it. For now my best results have come from using the HaoIDE add-on with Sublime and getting test result back from there. Also in the Developer Console I've found other perspectives that give more detailed information per each test I run. I'll post more follow up as I have it.

  • 85% in your dev org or your production ? A few things to check - that you are not using seeAllData=true on your test methods and that all validation rules, formulas & workflows that may be used or triggered in your tests match what you have dev'd against.. – Jim Mar 25 '15 at 5:17
  • I do have a couple methods that use seeAllData=true at the time I found there is no other way for those test. I know we have validations, formulas, WF, etc, but they've not been an issue before not sure what would change especially if the deployment doesn't report that to me some how – Xtremefaith Mar 25 '15 at 5:21
  • Ok check that the data you require for the test method actually exists in the org, you can check the deployment log by going to setup -> deployment status -> view details although not sure that will be much help if its successful. – Jim Mar 25 '15 at 5:27
  • I think SF did change code coverage functionalty. Check my answer here: developer.salesforce.com/forums?id=906F0000000B27eIAC – Simon Mar 25 '15 at 9:09
  • @SImon this matches my experience as well! I've had to move some of my static variables because they seem to be causing issues all a sudden even though they were fine before. Also last night I finally bumped CC to 86% thinking I would make 75% during deployment... turns out I was right BUT after successful deployment I cleared history and tested everything again and currently still have 86% CC. Basically the results are the most inconsistent thing right now. – Xtremefaith Mar 25 '15 at 19:29
0

To follow through with the solution for this post, I've since got more details and a solution posted here. Essentially there are some glitches with testing between perceived coverage and actual coverage. This solution helps to clarify the two and provides steps to clear the aggregate table that stores results causing some of the inconsistencies.

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.