function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SF DEVSF DEV 

Migration testcase issues

i got two classes with code coverage 86, 95.

But when im migrating its not allowing, the lines which are covered its showing as not under coverage. 

How to solve?

Best Answer chosen by Admin (Salesforce Developers) 
Bhawani SharmaBhawani Sharma
Are you dependent on any profile which exist in Sandbox and not in prod?
Please paste the line which are being covered in PROD.

All Answers

Bhawani SharmaBhawani Sharma
Please check your test methods if they are dependent on org data. you can use @SeeAllData=false in your test methods to see the actual coverage in sandbox.
SF DEVSF DEV

Tried its showing the same percentage in sandbox.

 

Bhawani SharmaBhawani Sharma
Are you dependent on any profile which exist in Sandbox and not in prod?
Please paste the line which are being covered in PROD.
This was selected as the best answer
SF DEVSF DEV

Hey thanks, yes it was profile issue. 

Now its solved.

Thanks for help.