Run NUnit Tests in VS2012 Continuous Build - visual-studio-2012

If anyone knows the correct spell to make NUnit tests run when in the Continuous build in 2012 I'd love to hear what it is.
I have scoured Google and found lots of articles like this one and I've carried out the steps it suggested I needed. I battled with the Build refusing to find nunit.framework.dll and finally got it to build. Only when it built it ignored all of the tests 'cos it would only look for and run MSTest tests :-(
I would really appreciate any pointers on how I modify the workflow to look for and execute NUnit tests.

Related

Resharper output window not showing steps anymore

Recently we had a change to our Xunit and we upgraded to Xunit 2.0 and all projects to .NET 4.5. Before this change,when I ran the feature file, I remember seeing the steps on the output window (of Resharper unit test session) of a failed test and it would pinpoint where the test failed at. But now, it only shows what kind of error it is and no steps in the output pane.
Can anyone tell me how to get the steps back as it is very annoying and difficult to find out where the test failed.
Note: We are using specflow to write the tests and run them using Resharper. The version of Resharper I am using is 8.2.1000
Support for XUnit 2.0 does not exist in Specflow yet. There is an outstanding pull request, but it still has some issues I think. So I think your options are to revert to the previous version of XUnit or roll up your sleeves and contrbute to the open PR.

VS 2012 Code Coverage

We are using VS2008 prof. in our application. In 2008 prof. code coverage feature isn’t available. So we are achieving this by creating unit test project and added its entry in .vsmdi file and running test cases we can get code coverage feature.
Now we are planning to migrate our application from VS2008 prof. to VS2012 prof. In VS2012 prof. also code coverage feature isn’t available. So we also trying the same VS2008 prof. approach to achieve it but still I am not getting code coverage option.
Please let me know if there is any way to achieve code coverage feature in VS2012.
Code Coverage is native only available in VS12 Premium and Ultimate not in Profesional. See here at "Determine how much code is being tested with code coverage analysis".
There are other alternatives that you can use to get code coverage (assuming you are using .NET) see What can I use for good quality Code Coverage for C#/.NET?.
I am partial to OpenCover for obvious reasons :)

How can I run VS2012 CppUnitTestFramework unit tests from an msbuild script?

I've written a native unit test dll that uses VS2012's CppUnitTestFramework. I can run these tests in the VS2012's IDE in the Test Explorer window.
But, I'd like to also run these tests from our MsBuild script. I guess I need to launch some test runner exe with appropriate command line, but am struggling to find information on this.
Can you help point me in the right direction. Thanks.
The Visual Studio Test Runner is a simple command line tool which needs to be called in order to find and execute the tests. Creating a small msbuild task or using the standard exec task would be enough to invoke the tests after the build.
As long as the test runner is installed properly, it should just pick up these tests and execute them.
See this blog post explaining all the command line intricacies of the new vstest.console.exe.

Why is it such an effort to setup code coverage in TeamCity?

I'm using Teamcity 6.0 and want to add code coverage to our NUnit tests.
PartCover has been a massive issue due to it not running on x64 server and so now I have to go and git it and build it myself :(
Also, jetBrains, if you know the xslt is broken, make it easier for me to fix it.
Does anyone else have PartCover working?. Maybe this might help :
http://www.jeremyskinner.co.uk/2010/07/23/using-teamcity-with-partcover-4/
Don't bother! Just install dotCover. It just works!

make ccnet self test

i want to run a test project in ccnet,
can anyone help?
i am not using NUnit. I am using [Test Class()] attribute in my web project, and wanna run this project from ccnet
It appears the test framework would be MsTest
In order to run MsTest on the build server you have to install visual studio or do a work around or hack (alternate hack).
Then you can use MsTest.exe
Here is the official documentation on running MSTest tests.
Similar question and more hacks or work-arounds
If you're using NUnit, you may want to take a look at the documentation
I'd suggest looking in CCNet to run a msbuild task
There are a number of examples to run MSTest from MSBuild tasks.
This one looks prommesing:
http://harriyott.com/2005/07/running-mstest-from-msbuild.aspx?post=/2005/07/running-mstest-from-msbuild.blogpost
--
I myself am using NUnit and xUnit. Might you consider switching to NUnit for testing? There is a wider adoption of NUnit in combination with CCNet, which makes searching answers easier.

Resources