So I'm currently restructuring our Unit Test framework/pattern because it needs it and because I'm trying to track down an issue and at this point I've broken it down as simply as I can and still can't figure out the issue. This may seem small at first but I think it will lead me to the real problem.
The Problem:
I have 2 unit tests, I discovered that they run in alphabetical order no mater the order I arrange them. The first does an INSERT on a List<Account> and the second one will eventually run an UPDATE on those accounts. But for now I simply just want to debug that the second unit 2 is firing, something like:
@isTest public static void bulkUpdateAccounts() {
System.debug('I made it!');
}
IF I change the function name to be in alphabetical priority it runs first and I can see in the debug log both test ran. BUT if it runs second, then it never runs. Why is that? Well because there is an INSERT at the end of the first test, If I remove the INSERT but keep everything else the same then I get the results I expect (both test run).
Naturally I went to Setup > Customize > Accounts > Triggers to get an idea of anything that is triggering the account. I removed all custom triggers included the TriggerHandler framework from Kevin O'Hara, as well as any packages that were installed and now there is nothing on this page. So as far as I know thing outside standard SalesForce should be effecting an Account INSERT.
With that said does anyone have any other suggestions or insights that could help me with this? I'm running out of possibilities to test. Also this issue is the same cause with testing in production which I believe is preventing deployment since I can't get over 75% because something is stopping after an INSERT

insertin a test method, create the data, perform aninsertand then assert the expected results. If you're testing the behavior of anupdate, you're going to first need to perform aninsertof some data then perform anupdateon that data, and then assert the results of properupdatebehavior. – Mark Pond Apr 02 '15 at 01:46