function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shannon Andreas 1Shannon Andreas 1 

Commenting out a test class?

Hello all!

I am trying to deploy a change set to deactivate one of my triggers in production. When I try to validate or deploy, i get the following error:

System.QueryException: List has no rows for assignment to SObject 
Stack Trace: Class.CreateContractWAttachmentTrgTest.attachmentTest: line 20, column 1

I read that I can comment out the test class, but I am having trouble with it because I have never done this. Can you tell me how I can do this easily? I tried using /* and */ at the beginning of the test class and the end, respectively. I am getting the following error when I try to save:

Error: Compile Error: unexpected token: '<EOF>' at line 30 column 0

Thanks!

Shannon
Best Answer chosen by Shannon Andreas 1
James LoghryJames Loghry
The better approach is to run the test(s) in sandbox with your trigger deactived, and then you can fix the test class before you deploy it along with the same change set where you deactivate the trigger.
 

All Answers

James LoghryJames Loghry
The better approach is to run the test(s) in sandbox with your trigger deactived, and then you can fix the test class before you deploy it along with the same change set where you deactivate the trigger.
 
This was selected as the best answer
Shannon Andreas 1Shannon Andreas 1
You are a darn genious! 

I did as you said and it is throwing the same type of error. I commented out the section that was causing the error and redeployed. All is good now!!!

Thank you sooo much!

Shannon