All unittests with code coverage failing on branch

Because I practice Test Driven Development, I write alot of unittests. When code gets branched, most of the times these unittests all fail (an yes, they all ran green on the main branch). Most of the tests failed with the exception “Could not load file or assembly”.

Time to do some investigating, my dear Watson.

Nothing could be wrong with the tests themselve, because I was sure they worked and since they all failed, it was a global problem. I checked out the test settings we use (x.testsettings, should be next to your sln file) and went through all the tabs.

On the Data and Diagnostics tab I found we only had Code Coverage enabled, so I took a closer look at that by selecting the line and clicking configure at the top of the grid.

Aha, seems like all of these paths are still pointing to my main branch! I have no idea why these paths are not relative, but after selecting the correct assemblies (the ones from my branch) and deselecting the ones from the main brach, all was well and I could return to my unittesting bliss.

Now this is still a bit of a bummer if I have to do this for every branch I make. I should probably try to change these paths to relative ones, but I have not done that yet.

Has anybody else encountered the same problem? How did you solve it?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s