+ Start a Discussion
David Bingham 24David Bingham 24 

I am getting a "Your code coverage is 0%. You need at least 75% coverage to complete this deployment." even though my code has 96% coverage.

User-added image

User-added image

I'm definitely including my class, trigger, and testclass in the changeset. What gives?
 
The AquinoisThe Aquinois
Hello, Can you share your test class?
Deepak Pandey 13Deepak Pandey 13
Hi David, 
     In test class  line number 82 and   38, you are query the data and using it. So in production it's not finding record such type (like query condition) and sandbox it's getting that's why code coverage is good. Exception is coming reason is - when test class run in production, it is not finding any data. on that line so exception come .
You avoid the query and insert proper record. or in production , if you have a permission then create a test record which is covering query conditions.
 
Amit Chaudhary 8Amit Chaudhary 8
Look like there is some issue in your test class. Are you using SeeAllData= True ? if yes then you need to create test data in your code.
Can you please share your Test class