Is there a way to make Sandbox like Production that will prevent the deployment with full validation if the overall coverage is under 75%?

I am building CI/CD in GitLab and have a sandbox for UAT and preview before Production. I have this command in .gitlab-ci.yml to run a full validation in the sandbox:

sfdx force:source:deploy --checkonly --sourcepath $MODIFIED_ITEMS -l RunLocalTests

However, even if the overall coverage in the deployment to sandbox is under 75%, it allows me to do any deployment I want as long as there is no error.

Is there a way to do 75% org wide coverage checking before I check-in my codes to a sandbox?


| improve this question | | | | |
  • I do t think that Salesforce enforces code coverage in Sandboxes. This should be taken up as a process check after deployment rather than being implemented before deployment. – manjit5190 Mar 7 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.