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
Tony White (BNE)Tony White (BNE) 

When running tests via Winter 16 Developer Console and selecting test methods to run, do the setup methods run?

I am currently trying to debug a test class and have found that when you select just a single test method from the class it does not run the setup methods.  I need to run the code as various users, I am setting up the users in a @testSetup method, and then querying for that user in the first line of the test method.

When I run all tests in the class, it gets past this first line.
If I select just a single test method (so can focus on the errors it is producing) then it fails on the first line.
There is no option when you select the test methods to run to include the testSetup methods...

Anyone else seeing this?  Until I found this issue I thought the new feature was fantastic cause I no longer would have to comment out the other test methods to be able to just get debug for a single test method.  I see no metion of the test setup not running, in the release notes.

Tony White (BNE)Tony White (BNE)
Also finding if you use rerun then it does not run the setup methods either...
Tony White (BNE)Tony White (BNE)
This issue has now been resolved - it appears Salesforce have fixed this.