TFS Build not executing unit tests


After writing over a 100 unit tests for some business logic and running the tests locally it was time to let the build server execute the job.  I went to the trouble to organize the tests into lists which matched the namespace of the business logic.
 
When I created my build project and selected the option to run the unit tests the logfile always contained the following error:
 
Starting execution…
        MSBUILD : warning : Specified cast is not valid.
        The previous error was converted to a warning because the task was called with ContinueOnError=true.
        C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets : warning : There are no results to be published.
        Build continuing because "ContinueOnError" on the task "TestToolsTask" is set to "true".
    Done building target "RunTestWithConfiguration" in project "TFSBuild.proj".
The error as it turns out is due to empty test lists being selected for the Build Server to execute.  If the list does not contain at least one test you will receive this error, only lists which actually contain tests can be selected.
 
 

About wesmacdonald

Wes MacDonald is a Visual Studio ALM MVP, PSD, MCT and a Principal Consultant for LIKE 10 INC., a SharePoint Server, Visual Studio and Team Foundation Server Consulting Firm providing premium support and guidance services.

No comments yet... Be the first to leave a reply!

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: