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
hokusaihokusai 

I get different results for "run all tests" from browser and IDE

This should not be the case.  the browser appears to be accurate.  If I make a new ecplipse project it fixes the problem.  is this a bug?
Best Answer chosen by Admin (Salesforce Developers) 
JonPJonP

There is no true "Run All Tests" command in the IDE.  Running all the tests in the IDE limits you to the test classes actually in your IDE project.  (There is no outside-the-browser equivalent to the Run All Tests button.  That precise function is not exposed in any API.)

 

What's probably happening is that after you initially create your Force.com project in the IDE, some new classes are getting created in your org outside the IDE.  But until you refresh your Force.com project or explicitly add those classes (depending on how you've set up your project), those tests don't get run from the IDE.  When you create a new Force.com project, however, you wind up getting all the classes including the new ones.

 

To update an existing Force.com project with new classes added to the org, right-click on the "src" or "classes" folder and choose either "Force.com > Add/Remove Metadata Components" (to explicitly select which classes to add) or "Force.com > Refresh from Server" (if you selected "Subscribe to Apex classes" when you created your project).

All Answers

JonPJonP

There is no true "Run All Tests" command in the IDE.  Running all the tests in the IDE limits you to the test classes actually in your IDE project.  (There is no outside-the-browser equivalent to the Run All Tests button.  That precise function is not exposed in any API.)

 

What's probably happening is that after you initially create your Force.com project in the IDE, some new classes are getting created in your org outside the IDE.  But until you refresh your Force.com project or explicitly add those classes (depending on how you've set up your project), those tests don't get run from the IDE.  When you create a new Force.com project, however, you wind up getting all the classes including the new ones.

 

To update an existing Force.com project with new classes added to the org, right-click on the "src" or "classes" folder and choose either "Force.com > Add/Remove Metadata Components" (to explicitly select which classes to add) or "Force.com > Refresh from Server" (if you selected "Subscribe to Apex classes" when you created your project).

This was selected as the best answer
hokusaihokusai
Thanks for the quick reply.  I really appreciate it.  I did a refresh just before I "Ran Tests" in the IDE.