Has anyone seen this very strange behaviour before?
- I’ve got a solution whith 70 unit tests. All of them pass on my dev machine.
- Whenever I commit my changes, our continuous integration process kicks in and the build box will eventually run the same 70 unit tests.
- There is only ONE test in the build box that fails all the time.
- The error is in one line that only gets a record from our unit test db. (I know it sucks having unit test to rely on data but please don’t focus on this as it’s not relevant now)
- The most weird thing is when I logon myself to the build box, open up the same visual studio solution and manually kick off the unit tests. Result: ALL PASS!
Has anyone ever had this weird situation? I’m guessing there is some weird thing going on with Cruise Control.NET and MSTest?
thanks for your inputs but it wasn’t anything related to credentials at all.
I’ve found out that other tests that were running before that particular one were leaving my unit test database in an inconsistent state, therefore causing errors to the test in question.
It’s not a good practice to have your unit tests relying on data, so unless you are extremely bound to it like myself, this is what a recommend to everyone: DO NOT RELY ON DATA TO DO YOUR UNIT TESTING !!!! Make sure you have all the good stuff in place, specifically a good IOC/dependency injector container so your classes are loosely coupled and you can mock up any interface you may want to unit test easily!