How to run unit tests in TFS (using vNext) - jasmine

I have the following project in my Visual Studio 2015 solution. I want to execute jasmine tests as part of our TFS CI build. I can run my tests successfully when I open the SpecRunner.html file although I'm failing to get them to run as part of the TFS build. I've included a screen shot of my TFS build step definition. The build is successful but the tests are not executed.
Please advise, any help greatly appreciated.
Many thanks,
Project and file locations
TFS build step

First make sure your environment on the build sever is set correct. You could manually run the test on the build server.
To use a NuGet package for the Chutzpah test runner , then you can avoid having to manually unpack the VSIX and get it into source control to deploy it to the build host.
About the detail step and build definition you could take a look at this tutorial: nUnit and Jasmine.JS unit tests in TFS/VSO vNext build

Related

TFS and golang continuous Integration

I'm tracking the files of my golang app in a local TFS server integrated with git. I want to define build, test, and deploy steps but I can't find any tool for that.
How can I define a build and test step for the project that shows the test results in the Team's web site? thank you.
You can use the vNext build system in TFS2017 and add Command Line task in the build definition to run the build and test just like what you do on local machine:
And then add a "Publish Test Result" task to publish the test result to TFS so that you can check the test result from the TFS Website. A limitation is that "Publish Test Result" task only support four Test Result Format for now: JUnit, NUnit, VSTest and XUnit.

How to get output in team build in TFS

I started learning TFS Team build. I am having a basic doubt. I referred this
article. I followed the steps exactly and got succeeded. I created a Console Application and pushed in TFS using TeamServices. My doubt is when we build a Console application in visual studio we will get an exe in bin folder.
Same way in this team build how to get the output in my local machine ?
What is the difference between the local build using Visual studio and this team build ?
EDIT :
I added like this. Still I am not able to see the output in the RELEASE folder.
I got the result as success saying
Still I couldn't figure out the output - the exe produced as a result of build.
Am I doing anything wrong ?
Note : I have a requirement like what you explained in the answer. So why I am using TFS team build. Since I am new I am experimenting with a small example.
When to use a build system
Team Build does not replace Visual Studio build. Use Team Build when you have a complex / lengthy build, to easily integrate running unit tests as part of the build or to deploy assemblies to a server after the build is complete.
Most people will setup a TFS build definition to run as "Continous Integration" build, meaning that whenever a commit is checked in, a build occurs. The build would compile and run tests and if it fails all developers can be notified.
How to get to the build output
When using a build system like TFS build, the build is done on a remote machine. If you want to retrieve the output of the build, add a Publish Build Artifacts step to your build definition. Since the build happened on a remote machine, the remote machine does not have access to your local developer machine.
The artifacts (assemblies) will be available for download on the build summary page:

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 can I run all NUnit Tests in Team City?

We are using TeamCity 6.0 to build VS C# solutions each commit.
Once the build is complete, a different test TC project runs. So that developers can add/remove/edit VS unit test projects, how can I make TeamCity use the the sln file or search for test dll's?
I don't want to have to edit the build each time a new test project is added to the VS solution.
Run tests from: **\*Test*.dll Doesn't appear to work, it only get s the first Test (which is currently failing)
Fixed :) -
RTFL (Read the log!)
Run tests from: **\bin\debug\*Test*.dll

Running Unit Test Projects on TFS 2010. Team Build 2010 Is Not Compiling Test DLLs

I have set up a TFS 2010 Team Build Configuration to run continuous builds.
I currently have 2 Test Projects that run inside Visual Studio 2010 IDE with no problems.
When I queue the solution (with the test projects) to build, the build log reports:
"No Test Results".
My Build Process parameters Automated Test Rule matches my test assembly names:
Run tests in assemblies matching **\*_Test.dll.
After inspecting the Build folder C:/Builds/2/[ProjectName]/[BuildName]/Binaries, I noticed that there were no .dll/.pdb files for my test projects built; even though all other project required dlls are in here.
The Test Project folders do exist in C:/Builds/2/[ProjectName/[BuildName]/Sources.
My Build Process parameters referenced under "Items to Build" => "Configurations to Build" :
Any CPU|Relase
Under Configuration Manager for my soltuion, for Any CPU and Release, I Do have my Test Projects checked off under the Build column.
From all of the documentation I have read, my tests should be running, but from the above inspection it appears that they are not even building.
Any insight or ideas into getting these unit test projects to compile and run on my TFS 2010 Build Server would be greatly appreciated.
Thanks!
When setting up the build, you can point to the vsmdi file instead of putting in the wildcard. Does that yield the same result?

Resources