- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
06-25-2012 10:12 PM
I've been writing some Ruby code that utilizes wsdl2ruby and the Apex WSDL to run unit tests from ruby.
rtr = RunTestsRequest.new(:allTests => false, :classes => 'MyClassName') @sfApex.runTests(:runTestsRequest => rtr)
Code above is pretty simple, just attempting to run a single test class with a one small unit test.
Problem is that this takes way longer to execute than it should. This class executes in about 10 seconds in the browser but takes about half an hour to run as shown above from irb.
Anyone try to do something similar before?
Solved! Go to Solution.
07-05-2012 05:20 PM
I still haven't been able to figure this out. Even on a test class without any unit tests, the request times out and locks up my org for half an hour with the "Org Administration Locked" error.
Other calls, such as compileClasses work properly. Can someone provide an example of the soap envelope used for the runTests call?
07-05-2012 06:55 PM
Well I got things working. The makeup of the soap envelope was not the issue. For anyone interested, its what you would expect.
<runTests xmlns="http://soap.sforce.com/2006/08/apex"> <apex xmlns:ns2="http://soap.sforce.com/2006/08/apex" xsi:type="ns2:RunTestsRequest"> <allTests>true|false</allTests> <classes>MyClassName</classes> </apex> </runTests>
I guess ultimately runTests does not work for some reason or another when you generate ruby from the apex wsdl using the wsdl2ruby utility bundled with soap4r.