4

I know from the docs that you can prevent tests from running to deploy code. When I use this command to deploy to my full sandbox

sfdx force:mdapi:deploy -d ./src/ -u Migration -w 100 -l NoTestRun

I get these errors:

Error  src/classes/AuctionTriggerTest.cls     AuctionTriggerTest     Field is not writeable: pba__Listing__c.Stage__c
Error  src/classes/AuctionTriggerTest.cls     AuctionTriggerTest     Field is not writeable: pba__Listing__c.Stage__c
Error  src/classes/AuctionTriggerTest.cls     AuctionTriggerTest     Field is not writeable: pba__Listing__c.Stage__c

There are many more. Why are my tests running?

To give you more details on the sandbox I'm trying to deploy to, the schema among the objects has changed a lot. New api names, some objects have been deleted. I just want to get the code in the full sandbox so I can edit it.

1

That's not a test running, that's a compilation error. Basically, your field in this new sandbox is read-only, perhaps because it's a formula or rollup summary field. It just so happens that this field is used in a test class, but that's only coincidental to the actual problem.

0

It seems you are deploy changes in fields from the package. Possible it's manage package therefore the fields are not writeable.

You should either remove the managed fields from the metadata files, or make sure that in both source/target sandboxes you have the same manage package version.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.