I want to deploy some of my classes (which are above 83% each) from sandbox to production. But it is showing code coverage error while deploying through change set.
There are other classes without test class in sandbox. By mistakenly I clicked run all tests in developer console. Is that the reason for showing code coverage error?
Best Answer
By running all tests in Sandbox is not going to affect anything while deploying in production env.
When you deploy a changeset it runs all tests in the prod env and its got nothing to do with classes in Sandbox without test class.
you can restrict the running of all test classes while deploying by also specifying only a single or multiple test classes by choosing the Run specified tests radio button and giving comma seperated names of the test classes to run.
Also take a look at the answers in the link below, there could be a pointer as to why your code is failing in prodn. Can't get code coverage over 75% when deploying to production