You need to sign in to do that
Don't have an account?
Production Deployment of CustomLabel using VS Code (INVALID_ID_FIELD: Source validate did not run tests in the org)
I am trying to deploy customLabels to the production org. But, I am not able to deploy it as it asks to run the test classes. As we know the custom label is just the configurations, not the codes. So, we don't need to run the test classes. My production org is a very new org and it doesn't have any class or test class till now.
Please help me to fix this problem. Thanks in Advance!!!
My package.xml contains the following value only.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>*</members> <name>CustomLabel</name> </types> <version>47.0</version> </Package>
I am using the following command to deploy it.
sfdx force:source:deploy --checkonly -x ./manifest/package.xml -u myProdUserName --testlevel RunLocalTests
When I run this command, it successfully validates the deployment and generates the JobId. When I run the next command to deploy it gives an error - "INVALID_ID_FIELD: Source validate did not run tests in the org".
sfdx force:source:deploy --targetusername myProdUserName --validateddeployrequestid JobId
For all these operations, I am referring to this link of the salesforce. https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_build_mdapi_production.htm
I took some help from this link as well. https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm
Thanks for the reply!
I have removed the testevel and run this command. But it doesn't work in that case. See the screenshot.
I found one way to deploy the custom labels by using the following command.
sfdx force:source:deploy -x ./manifest/package.xml -u myProdUserName --testlevel RunLocalTests
It has only one problem that it directly deploys the component (Custom labels). It means, we didn't get the option to keep this deployment as a future-ready(Quick deploy) which we do in the changeset.
I will update here for the knowledge if I find something or Please tell me if you get it.
All Answers
Greetings!
Seems like the issue might be with the test runs.So,can you please try by removing the testlevel from the command while validating as we do not need to run any test classes when we deploy the custom labels.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Thanks for the reply!
I have removed the testevel and run this command. But it doesn't work in that case. See the screenshot.
I found one way to deploy the custom labels by using the following command.
sfdx force:source:deploy -x ./manifest/package.xml -u myProdUserName --testlevel RunLocalTests
It has only one problem that it directly deploys the component (Custom labels). It means, we didn't get the option to keep this deployment as a future-ready(Quick deploy) which we do in the changeset.
I will update here for the knowledge if I find something or Please tell me if you get it.