+ Start a Discussion
SandrineSandrine 

test coverage failure in Production for trigger

Helllo,

I have a trigger and a test class in Sandbox PartielHRC.
the test coverage for trigger in Sandbox is around 80% but when i deploy it in Production it has 0%, i am not bale to find the reason

The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage.

any sugggestions?
 
Best Answer chosen by Sandrine
sandeep@Salesforcesandeep@Salesforce
Make sure your trigger is getting executed or not while running same test class on production Other wise trigger would not be covered.

Thanks
Sandeep Singhal
http://www.codespokes.com/

All Answers

sandeep@Salesforcesandeep@Salesforce
Make sure your trigger is getting executed or not while running same test class on production Other wise trigger would not be covered.

Thanks
Sandeep Singhal
http://www.codespokes.com/
This was selected as the best answer
buggs sfdcbuggs sfdc
Try running Individual test run option,dont run all the test classes on your org,may be it resolves.
SandrineSandrine
i runned specific test, still i have same result, and also i do not find reason why trigger is not running
Amit Chaudhary 8Amit Chaudhary 8
Can you please post your trigger and test class ? I hope you are not using SeeAllData= true ?
GauravGargGauravGarg
Hi Sandrine,

This might be the possible scenario when we set (seeAllData = true) in test class. 

As in sandbox, we have data which can be used for test coverage but in production we don't hence the trigger failed to 0%. 

Please create test data within the test class and try deploy again.

Hope this will help you. 

Thanks,
Gaurav
SandrineSandrine
Hello, 

thank you for replies,

I have tried adding and removing (seeAllData = true), it makes no difference in Sandbox as i am creating my own test data 
GauravGargGauravGarg

Hi Sandrine,

Can you please post the code here, so that we can review it and provide you with the exact error's

Thanks,

Gaurav
Email: gauravgarg.nmims@gmail.com