Running Specflow tests in TFS Build - tfs

How can I get my TFS build to run my Specflow tests? I have the tests running in the local VS build, but they aren't being picked up in the TFS build. Please could someone post the steps I would take to have the build run the specflow tests, and report on the results. Thanks.

I guess specflow uses nunit tests. you need to set up nunit in build server
http://www.mytechfinds.com/articles/software-testing/6-test-automation/72-running-nunit-tests-from-team-foundation-server-2012-continuous-integration-build

If you use SpecRun, it will automatically take care of TFS Build integration. Installing SpecRun is just referring the NuGet package from the SpecFlow project.

Related

unit testing with nunit with integration with jenkins C#

To preface, I've already installed the Jenkins plugin for NUnit, I'm using the following plugins :
NUnit v3.12.0
NUnit3TestAdaptor
Microsoft.NET.Test.Sdk
Microsoft.NETcore.App
All installed via NuGet on Visual Studio 2017.
This is the batch command I'm using to try to run the unit test after being committed to Jenkins.
"C:\ProgramData\chocolatey\bin\nunit3-console.exe"
testCSharpe\bin\Debug\netcoreapp2.1\testCSharpe.dll
When I build the project, it keeps showing me this error.
Any idea how to go about this?
Short answer: NUnit3-console does not yet run .NET Core tests.

How do I run NUnit tests on TFS?

Question:
How do I run NUnit tests on TFS?
Attempts:
I've searched the web and am still struggling to figure out the exact steps required to accomplish (to what I believe is) a trivial task.
I added the NUnit3TestAdapter package to my test project.
However, my tests are still not being discovered.
TFS displays the following message:
No test runs are available for this build. Enable automated tests in
your build pipeline by running your test framework of choice, such as
JUnit, Visual Studio Test, or xUnit. If you choose to run tests using
a custom task or runner, you can publish results using the Publish
Test Results task.
Expectation:
I'm surprised that NUnit is not an option that I can just select from.Hence, it's the standard unit test framework for .Net.
How do I run NUnit tests on TFS?
There is a blog here describes clearly how to run NUnit tests on TFS: Running NUnit Tests in a TFS 2015 Build vNext
Simply summarized as follows:
Add Nuget Package for NUnit Test Adapter
Specify path of custom Test Adapter inside build definition
Copying adapters inside Visual Studio TestWindows folder
Specify Path to Custom Test Adapter with nunit packages
Note:
You do need to edit the Visual Studio Test task’s advanced settings
to point at the NuGet packages folder for your solution (which will be
populated via NuGet restore) so the custom nUnit test adaptor can be
found i.e. usually setting it to $(Build.SourcesDirectory)\packages
Some other tutorial for you reference:
xUnit or NUnit with Visual Studio Online Build
Running nUnit and Jasmine.JS unit tests in TFS/VSO vNext build

How to run C++ tests based on GoogleTest with TFS 2015

We have a Visual Studio 2015 solution containing some C++ projects and some tests based on Google Test Framework.
Now I would like to run those tests with the quite new TFS 2015 build features. I know that there is the "Visual Studio Test" build step that is able to run custom test adapters (like the Google Test Adapter?).
Is this the easiest way to setup things? What exactly has to be installed on the (on premise) TFS2015 build server and how to configure the build steps?
Thanks for you help! Sebastian
Yes, the simplest way is just using google test adapter in ""Visual Studio Test" build " task. Just as the feature statement which will using VSTest.Console.exe
You need to install visual studio on your build server(agent). About how to conigure the build steps, there has been a detailed tutorial with Xunit test which also applies to google test. Plesae refer this blog: Running xUnit tests in TFS Build vNext

BVT's after Jenkins build on Perforce VC

I have set up a Jenkins project using the Perforce Plugin and am now working on configuring the "Publish JUnit test result report" post-build action so that it will run build verification tests upon successful builds.
It's telling me that I need to "first set up your build to run tests" - but I am unsure if I should be doing this via Visual Studio since I don't have TFS. Is there another way to do this apart from TFS?
I ended up solving this issue by using MSTest and its Jenkins plugin. For those of you here with the same question I had, you can find some pretty good directions on how to get this working here (although I used the version you can find in VS 2012).

Can I get TFS to deploy and execute tests on a different server?

I'm looking to get TFS to build and deploy to our manual and auto TEST environments.
manual TEST - overnight updates
auto TEST - continuous integration
Once deployed, I want TFS to deploy and run a set of web-integration tests (SpecFlow / Selenium / nUnit) on another server (acting pseudo client of the website).
I then want TFS to collate the results of these tests and report back.
What's the best approach to get this working?
You'd normally change the build process template to do what you want. Adding steps to deploy could be one of these customozations. Have a look at the Build Release Deploy build template from the Microsoft ALM Rangers which includes steps to publish the build to another machine.
You can also make use of WebDeploy and add a set of publish profiles to your solution. Team Build will happily execute those steps during build, if told to do so.
In TFS you can use a Test Agent to then execute tests from a remote machine and have the results added to the test results for your build.
Seeing that you'd like to use NUnit ad SpecFlow I suggest using TFS 2012 in combination with Visual Studio 2012, which have built-in support for executing 3rd party based tests. You'll need to install the NUnit adapter and put the assemblies for it in source control so that Team Build will pick them up.

Resources