You need to sign in to do that
Don't have an account?
Bernie X
Code coverage difference betweeen sandbox and production
I have been struggling to understand why code coverage for a trigger is 100% in sandbox and 0% when attempting to deploy to production.
Differences in validation rules.
Differences in required fields.
Not including the appropriate class(es) that provide coverage.
Incorrectly written test methods that rely on hard-coded ID values.
Incorrectly written trigger code that relies on hard-coded ID values.
Compilation errors while trying to deploy the package.
Difference in installed packages that are causing testing failures.
In short, you'll have to check the deployment logs to ascertain why the deployment failed. Setup > Monitoring > Deployments should be able to help you.
I suppose something is wrong with quering from a test/production point of view. Now the question is why have a double standard?
Details: My test class gets data from a SOQL query with a limit of 1. In the developer console query editor, this results in one row; however, in the force.com IDE validation log, the SOQL query generates no rows (SOQL_EXECUTE_END|[8]|Rows:0). By increasing the limit to 10, I now have 100% code coverage for my trigger.