-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sfdx Version 7.151.1 force:mdapi:deploy cannot fails when attempting to deploy metadata without apex classes #1542
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
Also experiencing the same error. I have a metadata format package folder as follows:
Executing the following command to deploy:
I have tested this deployment with the following sfdx versions:
While not exhaustive, it appears that the issue was introduced with
Using
|
Hi @alan-morey first off, wow, thank you for all of that research and investigating 👏 👏 . We've been working on getting a prod org to use to replicate this issue, but just from comparing the current vs the If you're up for it, could you try modifying your local file and remove that default value? That might help us speed up the process and verify the fix at the same time. Depending on OS and install type (npm vs installer) you should be able to run |
Hi @WillieRuemmele, I made the change as you suggested and removed line 129 from
I then tried setting the default to an empty string:
However, that also results in error:
Also tried setting default to |
Hi @alan-morey thank you so much for making those changes, and I apologize for the delay getting back to you. Could you try one more thing for me? Could you remove lines 58-59 of that same file?
I've done some research, and testing between the Just as a reminder: if you remove those, and the deploy succeeds - you will be deploying to prod |
Hi @WillieRuemmele, I removed those 2 lines and deployment request goes through:
|
Hey @alan-morey 🎉 great news! we'll get this fixed right away! 😎 Thank you so much for all of your help |
@WillieRuemmele Facing the same issue, any idea which version of the sfdx-cli will the fix be a part of? |
Hi @ganesh2109-cloud I'm planning on getting those changes into this week's |
Summary
Hi. We use
sfdx force:mdapi:deploy
to deploy metadata to our org. We have specifically decided to omit the--testlevel
flag, as it is very convenient that the cli chooses the testlevel based on the metadata (for apex classes and such, it isRunLocalTests
, whileNoTestRun
is selected when there are no apex classes or similar (see https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_running_tests.htm for reference on when each is choosen).However, today when trying to deploy with Version 7.151.1, we received the error
sf:INVALID_OPERATION: INVALID_OPERATION: testLevel of NoTestRun cannot be used in production organizations
. We tried revering to version 7.150.0 but got the same result. Revering back to 7.145.0, however, resulted in the expected scenario: The deployment was successful.Thus, the error reported here is that in at least versions 7.150.0-7.151.0, a wrongful error is thrown when attempting to deploy metadata with NoTestRun, when the metadata does not contain any apex classes or similar that requires unit tests.
Steps To Reproduce:
sfdx force:mdapi:deploy
towards a production org, without specifying the--testlevel
flag.Expected result
The metadata deployment is allowed and successful.
Actual result
The error
sf:INVALID_OPERATION: INVALID_OPERATION: testLevel of NoTestRun cannot be used in production organizations
is thrown.System Information
I cannot supply this as the error was received on our cloud agents used for builds and deployments. The agent simply runs
npm install sfdx-cli --global
at the start of the run, to get the latest version of the cli.Additional information
The text was updated successfully, but these errors were encountered: