VSTS build fails test phase but 100% tests pass

We recently came across this situation, while we were trying to integrate unit testing for one of the applications into VSTS build definition. So strangely enough, all of the test cases were passed but still the task failed:

build failure error with all test cases passed
build failure error with all test cases passed

When we went through logs, we have observed that vsts test task was also trying to parse the Microsoft.VisualStudio*.dll files:

vsts test task logs
vsts test task logs

Since the name of the dll starts with Microsoft.VisualStudio, it was easily guessable that this dll was written by Microsoft and as such there was no need for us to test this dll. Now why it was testing those dlls is for something, we needed to look into.

If we look at the default configuration for test task, it would tries to test all assemblies that would have the test name in there and exception for files required by test adapter itself:

Default test task configuration for assemblies
Default test task configuration for assemblies

The solution was simply to remove the unwanted dlls from test assemblies list:

modified test task configuration
modified test task configuration

Once we did that, the build was green again. At this time, it did not checked those dlls and there was no error to report:

build success after correcting test configuration
build success after correcting test configuration

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s