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
GetlinGetlin 

Deploy trigger to production environment

Hi guys,

 

I have a simple issue with deployment. I have a trigger and a test class for it. While i'm trying to deploy only my trigger  deployment process  runs all test.

And some of these test are failed. Is it possible to deploy only my trigger with running only my test for it ?

 

 

Thanks for your responses!

gv007gv007

Are deploying using eclipse or any ANT script.

GetlinGetlin
Yeah. Deploy with IDE Eclipse. Is it possible to run only test for my trigger except existing ? Thanks!
gv007gv007

lot of times trigger not only cover itself.if you have 100% test coverage separately also,what is the average test coverage % now

GetlinGetlin
Coverage is 87%. But there another tests in the production environment. They are related to some other functionality, and they are failed. For my trigger I have only one test class. But when I try to deploy salesforce run all existing tests. And most of them are failed except my. Is it possible to disable these failed tests classes not to run by salesforce ? Thank you !
Nathan CrosbyNathan Crosby

When you deploy to production the test class for the new trigger/class will execute and any existing test classes will also execute. This is intentional as to provide regression tests across your existing code base. Sounds like something may have changed over time in your configuration causing your existing production code to fail....you can confirm this by running all tests in production without attempting to deploy any new components.

GetlinGetlin

This is just what I wanted to hear ! Thank you. I mean regression testing.

Yes likely something was changed, but nobody know when and what for. In this case i try to de-activate old code to deploy the new one.

 

As I understand there is no way to de-activate trigger/code directly through the Salesforce. But I can do it using Developer tools (Eclipse+ force plugin or ANT command line tool). Am I right ?

 

Thank you !

Nathan CrosbyNathan Crosby

Yes, you can, but I would not suggest this approach; however, would suggest correcting the existing code coverage issues before deploying new components. You'll only magnify the situation over time and create a potentially larger problem.

gv007gv007

I think in yours org lot of unmanaged code ,it may not related each other or may be.

 

When deploy  byug fixes for any componets did you runned entire test covergae for org.

 

It is little bit stage faceing this type os issues ,first get all the unamanged code into eclipse work space complie it ,and run the test coverage and deploy it in sandbox test it and then deploy it in production direct deployment is not suggestable,if people are using this orgs,

 

in between time try to create a case with salesforce .you probally get some help from them.

GetlinGetlin

 

 

As I've already mentioned nobody know what this old code should do. And I have no idea how this invalid code appeared in production environment.

Actually I think the simplest way (not sure that this is right) to delete this code. Is it possible to delete this code ? I tried to use deployment utils to undeploy 

this code, but had no success on it.

gv007gv007

Eclipse IDE will help you to undeploy process,it is little bit risky when people are using production environments sfdc orgs.all the best.

GetlinGetlin

 

Please, could you provide me with more additional information about this process through Eclipse IDE.

It seems that firstly I should fix all bugs and than undeploy what I want.

 

Thanks!

gv007gv007

GetIn,

           First get all the  code into eclipse work space.

-->then compile it

--->run the test (include in this test yours latest trigger and it test class )-->if you more then 75% ,or  more then that deploy the componets into salesforce org that will work fine

 

of if you got some less testcoverage ,fix it and runn the test coverage and deply it.

 

 

this is one way.

 

If you want some unwanted componets -->you can remove it into two ways -->loogging in salesforce web--->in developer environment u can remove the compoents and depends (at the time of removing make sure that that components are unwanted )

 

other way of removing compeonts from eclipse IDE

 

get all the componts in eclipse IDE and delete it ,at the time of delecting it ask delete from server press ok it will delete the compoents from salesfoce server.

 

otherwise if you want delete from ANT script --modify yours ANT script and run it.

 

 

 

 

GetlinGetlin

gv007,

 

Are you talking about developer environment ? Does it work for production ?

 

Thanks!

gv007gv007

production environment code,get it and complie it--check test coverage-->ok-->deploy it .

No -->fix the test coverage and deploy it.

 

if yours SVN and production account code is sames means you can use developer account also

GetlinGetlin
Ok. Thank you !