You need to sign in to do that
Don't have an account?
sivanov
Salesforce test classes failing
Hello,
Our company is trying to deploy Apex code for the first time from sandbox to production. I read in your docs that you need to have 75% coverage or above to deploy. When I run validation, it seems like a lot of test cases that we didn't write (I'm guessing they are Salesforce tests) are failing, and seem to have lower than 100% coverage. I am guessing this is also pulling our overall coverage down. Is there anyone who could point me in the right direction for how to get these tests cases to pass so that I could deploy?
Here's an example of a test failure in a class that is also not written by us:
Class: AttachmentsToFilesControllerTest
Method: migrationBatchRunStandardUser
Errors: NAMForbiddenException: You don't have permission to access these fields on ContentVersion. Ask your Salesforce admin for help.
Any ideas why so many of these built-in classes have such low coverage and seem to be failing?
I have attached a screenshot of the dev console after I run tests on sandbox:
Our company is trying to deploy Apex code for the first time from sandbox to production. I read in your docs that you need to have 75% coverage or above to deploy. When I run validation, it seems like a lot of test cases that we didn't write (I'm guessing they are Salesforce tests) are failing, and seem to have lower than 100% coverage. I am guessing this is also pulling our overall coverage down. Is there anyone who could point me in the right direction for how to get these tests cases to pass so that I could deploy?
Here's an example of a test failure in a class that is also not written by us:
Class: AttachmentsToFilesControllerTest
Method: migrationBatchRunStandardUser
Errors: NAMForbiddenException: You don't have permission to access these fields on ContentVersion. Ask your Salesforce admin for help.
Any ideas why so many of these built-in classes have such low coverage and seem to be failing?
I have attached a screenshot of the dev console after I run tests on sandbox:
All Answers
I did as you said and supplied a comma-separated list of tests to run and it worked line a charm for me and I was able to deploy. Thanks for the help!