Visual studio 2012: Run web performance on build - visual-studio-2010

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.

Related

Visual Studio Online build with javascript tests

I want to include a run of my Jasmine JavaScript tests when building my solution but can't really find any good walkthroughs or tutorials on how to do this.
Previously we had chutzpah install on the build server and this would run the tests but builds on TFS2012 are a bit different to VSO. Someone has mentioned to me that the karma extensions would be useful but not sure where to start yet.
Any tips welcome.
I recently wrote a blogpost about enabling JavaScript unit tests in Visual Studio Online (Visual Studio Team Services :)) Hopefully this helps a little.

How to Run the Unit Test As the part of Build (Not continuous integration)

I have Nunit unit test which i need to run as the part of my MS build.. I know that running all the test will slow up the build So, i need to run only the impacted test is there any way to find that out..
AFAIK running only impacted tests is not possible yet for NUnit tests. But this is possible for MSTests in Visual Studio 2010 Ultimate/Test Professional:
Recommending Tests to Run That are Affected by Code Changes
You can use Visual Studio Ultimate or Visual Studio Test Professional
2010 to help you determine which tests might have to be run, based on
coding changes that were made to the application you are testing. To
be able to use this functionality, you have to use Team Foundation
Build to build your application and use Microsoft Visual Studio 2010
for version control for your source code
Anyway you can use MSBuild Community NUnit Task to run tests from a set of the assemblies. You can do this as dependency target of standard AfterBuild target by specifying DependsOnTargets attribute.
<NUnit Assemblies="..."
IncludeCategory="..."
ExcludeCategory="..."
ToolPath="$(NUnitDllsPath)"
ProjectConfiguration="$(Configuration)"
OutputXmlFile="$(NUnitOutputPath)\UnitTests.xml"
ContinueOnError="true">
To know the impacted tests you need to track the test case code coverage. Only this way you can examine what test is impacted by the changes you are checking in. I don't know of any tool that does what you want besides Microsofts Team Foundation Server.
Running your tests as a part of the build can be done trough the Build Events properties of your project. You can execute the command line tool for NUnit.
But as PVitt already pointed out, I don't know if NUnit can work with Test Impact analysis.

Implement VSTS 2010 for Unit and Load Testing with accordance to TFS

I have to implement VSTS 2010 for Unit and Load Testing.
But I didn't know the process of implementing VSTS 2010 but I know the process of performing load testing
I have to implement VSTS 2010 for Unit and Load on my present TFS environment.
Can anyone provide some advice and guidance with regard to implementing VSTS 2010 for unit and load along with TFS, so that any one can use VSTS like TFS.
You can use Visual Studio to create and run unit tests.
http://msdn.microsoft.com/en-us/library/ms182532.aspx
You can use TFS Team Build to automate running unit tests.
http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx
But running LOAD tests with TFS? hmmmm. I don't know if anyone has done it before but I don't like the idea. Load test environments need to be very controlled environments and I don't see a reason to do LOAD testing as a part of continuous integration.
I believe it can be done by digging into TFS 2010 Lab Management with virtual machines or something but it not worth the effort.

NUnit vs Visual Studio 2010's MSTest?

I realise that there are many older questions addressing the general question of NUnit v MSTest for versions of Visual Studio up to 2008 (such as this one).
Microsoft have a history of getting things right in their 3rd version. For MSTest, that is VS2010.
Have they done so with MSTest? Would you use it in a new project in preference to NUnit?
My specific concerns:
speed
running tests within CruiseControl.NET (either commandline or MSBuild task)
code coverage reports from CC.NET
can you run MSTest tests in debug mode
(We use ReSharper, so test-runners are not an issue for us. We have used NUnit for the last few years. We do not have TFS.)
List item speed is same, but MsTest may be a bit slower because it creates folder for test run every time
MSBuid and CC.Net is big pain. You can't run MSTest on computer without VS on it (not 100 sure about 2010, but with 2008 it is so)
not sure, sorry
yes you can, from visual studio
My recommendation is following: if NUnit satisfies you - use it, forget about MSTest
To correct some old information on the thread;
It IS possible to run 64 bit tests in 2010
From VS2008 forward it is not neccesary to have MSTEST create directories anc opy the binaries in, just disable deployment, in 2010 thats the default but you have to set it in 2008
2010 MSTEST is faster but as its a generalised test framework that also runs load/web/UI tests there are compromises in the design that will lead to it being slower. Jamie Cansdale appears to have managed to get perf increases with the lastest releases of TestDriven.net's support for MSTEST
I've mainly used NUnit, some xUnit and some MSTest. They seem functionality equivalent, but I don't like the MSTest test runner. It runs in visual studio so it either crowds the screen or is on another monitor getting in the way everytime I tab to visual studio. (I run NUnit on another monitor, but it doesn't cover everything on that monitor everytime I focus visual studio). It takes too many clicks to find out what test failed and why.
NUnit can run in the background until a test fails, at which point it shows you information about the breaking test. This seems like the ideal for keeping red/green/refactor going smoothly.
Nope. Same issues regarding appdomains and assembly resolving still exist. I would avoid unless you want the new goodness for other functional testing or integration with Team System.
I don't know much about CruseControl.net, but you can debug tests. We currently don't use TFS either, and the MSTest is working for us.
If you think you'll ever run your tests in 64 bit mode, use NUnit. MsTest is only x86.
One major difference between the two is that MSTest makes a copy of the current DLLs every time it runs a test. If you're doing TDD and running your tests frequently, this can eat up a lot of hard drive space.
If you're using MSTest, you can change this setting in Tools > Options > Test Tools > Test Execution. "Limit number of old Test Results to" is set to 25 by default in Visual Studio 2010. I usually change it to 1.
MSUnit runs your test cases under conditions that are different from the actual execution environment. Specifically, the deployed files differ from those that are deployed when you run your actual project. Nethertheless, there is the [DeploymentItem]-Attribute to specify which files shall be deployed by MSUnit. So if your application depends on any external
files, such as
database files
database configuration file
application configuration file
...
then MSUnit is not the right choice, because the MSUnit tests never cover what your file system is going to look like in execution environment. The Visual Studio Project File settings for deploying files (Copy always, Content, etc.) are ignored by the MSUnit runner. So those settings cannot be tested.

Integrating Visual Studio Test Project with Cruise Control

I'm looking into using Visual Studio 2008's built in unit test projects instead of NUnit and I was wondering if anyone has any experience in trying to integrate this type of unit test project with Cruise Control.Net.
From some of the initial research it doesn't appear to be a super simple solution.
It appears that doing this involves having Visual Studio 2008 actually installed on the continuous integration server, which could be a deal breaker.
Then configure the MSTest.exe to run in the tasks list, but first you'll have to make a batch file to delete the results files from previous passes as this file's existence causes an error.
Then create a xslt to format the results and put it into the dashboard.config file.
The code project article I found has a lot more detail.
Integrating Visual Studio Team System 2008 Unit Tests with CruiseControl.NET

Resources