TFS 2013 Build Summary Not Showing Test Results - visual-studio-2013

Similar issue as this question (which does not have an answer), except we are using TFS 2013 Update 4. Our tests are written using NUnit and are configured to run through the build definition, which uses the default (not upgrade) template.
We just installed a full version of VS 2013 Premium on the build server (because prior tests were not being run at all). With that installed, the tests are run (if I did down into the log I can see them and the results, and if we force a failure the build appropriately fails) but the build summary says that 0/0 tests were run.
I followed the steps in the selected answer to this question, and it now shows the code coverage results, but still no dice on the actual tests or their results.
I also found this blog article that appears to be the same issue from TFS 2010. I have verified that all users have the View Test Runs permission set to allow, and I tried using a TFS administrator account just to be sure. Still no dice.
How do I make TFS show me what tests were run in the summary, and also in the Test Results window that the build summary links to?

Each individual test needs to be associated with a test case work item in Team Foundation Server. See this link for information on how to associate your tests. In my work, we're using TFS 2015, but I know this works in TFS 2013 as I have done this work in the past. Once the test case work item is associated with your automation (using Visual Studio to link the test automation to the test case) then there must be a build definition for the product under test that runs your test automation as part of the build. When a build is queued, your tests are run as part of the new build. Once the build is done, you can then view the detailed test results.
Plus the other StackOverflow post here describes how to view the detailed results.

Related

Using XUnit with Visual Studio Online

I've setup my build as below using the build definition. I'm using XUnit and locally my tests are discovered and run. I've tested the glob **\*spec*.dll and it finds all my test dlls and the build log shows that those dlls are in fact built.
However in the build log I get
Run VS Test Runner
No test found. Make sure that installed test
discoverers & executors, platform & framework
version settings are appropriate and try again.
Which seems to suggest it is trying to use the MSTest test runner instead of the XUnit test runner. How do I tell the build for visual studio online to use the XUnit test runner and discoverer?
This might be out of date now, but this is how I have it setup and working - downvote and let me know if it's wrong and I'll delete this. I got it from a blog post/MSDN page, but I can't locate it any more.
First you need to create a TFVC Team Project (doesn't matter if you don't use it again).
Into $/MyTFVC/BuildProcessTemplate/CustomActivities/
Checking the following files from xunit.net:
Now in VS, click the BUILD, Manage Build Controllers... option. Select the "Hosted Build Controller (Hosted)" and click "Properties...".
Enter the path where you checked in the DLL's into the "Version control path to custom assemblies" field:
You should be good to go.

How to run Code Coverage on a nightly build with TFS 2008/Visual Studio 2010

I currently have a solution with a number of projects which include Unit Tests.
We've got a CI build and a separate Scheduled build and I would like to be able to run Code Coverage on the latter (not the CI).
At the moment we are using Visual Studio 2010 and TFS 2008. None of these can be changed.
I've looked around for hours and lots of suggestions mention a Process tab to select in the Build Definition however further investigation shows that the combination of VS/TFS that we have does not have this option.
Another source says to modify some testsettings such that they contain the Code Coverage option (which I have done) and then define the Test Settings file in the build - but I have no idea how to do this (http://www.codewrecks.com/blog/index.php/2010/06/14/running-code-coverage-in-tfs2010-builds/).
I have a testsettings configuration that will run code coverage locally so my issue is that I need the MSBuild TFSBuild.proj file to know which testsettings file to use when running it's tests (through the <RunTest>true</RunTest> option).
Any help on this would be greatly appreciated. I've trawled through the various other proposed solutions but none seem to match this. They either use a better version of TFS, or do something else.
EDIT. I suspect I might be restricted to using an Exec task within the build script and running the Vsperfmon.exe command with some arguments. If this is the case please provide an example because I've no idea how to capture the results from this command and tie them to my Scheduled build.
Thanks all.

Visual studio 2012: Run web performance on build

I´m new to Visual Studio and this might be very easy to do but i've been researching for almost a week now and haven't got any results.
The thing is i'm trying to do some QA on a web project in visual studio 2010 that is under a TFS. I've recorded and coded some of my tests but i need this tests to run when there is a new check in by any of the developers.
I've read some of the How To's from MSDN but this step by step walkthroughs are not specific enough for the web performance test.
Thank you in advance
In you case you need to edit the build definition to include Build Verification Tests (BVTs) : theses tests can do check post build and also post deploy.
Web Performance Test, Load Test, Coded UI Test ... it's quite the same for TFS : some code to run to check something.
The good starting point is here.

Publishing test results to build after running manual test in MS Test Manager

I'm exploring using Microsoft Test Manager as an option for for my company to switch over to. We already use Visual Studio/TFS for our development, source control, builds, scrum process, etc.
I've been able to use Test Manager to run manual tests, but I can't find anyway to publish these results to a build or any easy way to associate these test runs with work items.
The build summary in Visual Studio does show that a test run as having completed after I run a test in MTM against that build, but when I try to view the results I get "Downloading the selected test run failed. Test run XX does not have a run summary attachment. The .trx file is either not published or upgraded."
Is it possible to publish results to TFS after running a manual test in MTM?

How important is Visual Studio's .vsmdi file?

Here's the scenario:
'User A' has created unit tests through Visual Studio 2010. The test project and unit test source code have been checked into version control. 'User B' gets the test project and unit test source code from version control. 'User B' then opens the test project and receives a message saying "Error loading blah.blah.blah.vsmdi: Input file not found: blah.blah.blah.vsmdi." However, 'User B' can still run the unit tests successfully.
Now, regardless of whether 'User A' should have checked in the .vsmdi file, there don't appear to be any negative effects, other than the error message.
Is there any harm in not having the .vsmdi file? Or, conversely, what is the benefit of having the .vsmdi file?
The following link gives a bit of good information *.vsmdi files
http://notgartner.wordpress.com/2011/02/10/what-is-a-vsmdi-file/
In brief, content of the link helpful here is:
Originally the use of the *.vsmdi file was a requirement to get MSTest integration with MSBuild working on a TFS build server, however this requirement has since been removed once again removing the utility of the file.
Assuming that you are just using the Test View to run your tests these files are perfectly safe to delete. If you want to try and tackle the problem, there is an imperfect solution. Simply remove all the files from your disk and in version control (assuming you are using TFS here, or any version control system that is integrated with Visual Studio), then instruct the version control system to perform an exclusive check-out.
Well, from what I have gathered, there is no harm in not having the .vsmdi file, when using VS 2010.
Using VSMDI files in VSTS 2005 have known to have many issues regarding maintainability.
Though it may have potential in the future releases of VS, currently it seems better to stay away from it.
Check out the below MSDN blog that details the workaround. Please note this applies only to VS2005. VSTS 2008 now uses testcontainers instead.
How to run tests in a build without test metadata files and test lists (.vsmdi files)

Resources