Visual Studio Test using Test Agent - visual-studio

I have a situation : I have two servers (server A and server B) and my TFS making build of my application on server A and should deploy the results on server B. After that it should run UI tests remotely.
For doing that I use TFS 2015 and I added a few steps for my build definition (if you understand what i mean ))) ).
Firs step is "Visual Studio Build" step which is build my project. -> is working fine
The second step is "Publish Build Artifacts" for publishing the build results from server A to server B (maybe it is not best solution for publishing something between machines but is working for me. If you have some advice for that, I will be appreciate to hear it).-> is working fine
Third step is "Visual Studio Test Agent Deployment" which should deploy Test Agent on server B. When this step is runed it shows 'agentlocation' is not a valid path. Ensure that the account with which build agent is running has access to this share. And the all if fails on this step but root to file vstf_testagent.exe is acceseble by everyone (For sharing of this folder was set Everyone Read/Write).
Fourth step is "Visual Studio test using Test Agent" which should run my UI tests. I hope that this step can run my UI tests.
on server A I installed Test Controller and on server B I installed Test Agent and gave him name of Test Controller. On server A I use Visual Studio 2015 but on server B I use Visual Studio 2013.
Please help me to understand problem with third step. What can it be and how to resolve it?
And can step fourth run my UI tests?
Thanks a lot for any help!

The field of "Test Agent Location" is optionally, which is used to supply the path to vstf_testagent.exe from network or local location. If no path is provided, it will be downloaded from network. You can leave this field blank and let it download from network, maybe you can deploy a test agent successfully.

Related

TFS 2015 Build Definition Failed But No Error

So I'm currently trying to play around with Team Foundation Server 2015 on premise. I got source control down and already setup my project collections and team project.
My next adventure is to try out continuous integration starting with Automated builds. I am however stuck in Build definition.
I already have an online build agent with the following specs:
Windows 7
Visual Studio 2013
Now when I que a build it fails after the following message
Waiting for console output from an agent...
I tried to download the log files but it gave me a blank folder. Do not know what next steps I should check and would really appreciate any help in this area.
Thanks
Generally this issue is caused by the agent failing to access resources for the build process.
Please first check if the agent is enabled in your Agent Pool, then try below things:
Check the connectivity
Check URL configuration of TFS as Danko mentioned above, make sure you deployed the build agent with the correct URL.
Try disable the Firewall on machine to check if the communicate issue caused the build hang.
If you are set the specific port or use proxy server for your TFS, then try to set the exception for the port on your firware. See this similar issue.
Make sure the account that the agent is run under is in the “Agent
Pool Service Account” role.
Make sure you deploy the Windows build agent by exactly following
this article.
Restart below services .
Visual Studio Team Foundation Background Job Agent
Your build agent service
Deploy a new build agent to check if that works.
Reference this similar thread for details:
2 Solutions collect form web for “vNext build on TFS 2015 hangs on MSBuild step and produces no log files”
Run Get-NetFirewallPortFilter in PowerShell (run PowerShell as
Administrator) on the TFS machine to get the port exception list.
Run the following PowerShell script to set exception for the specific
port:
$port = New-Object -ComObject HNetCfg.FWOpenPort
$port.Port = 9191
$port.Name = 'TFS CI Port:9191'
$port.Enabled = $true
$fwMgr = New-Object -ComObject HNetCfg.FwMgr
$profile = $fwMgr.LocalPolicy.CurrentProfile
$profile.GloballyOpenPorts.Add($port)
After installing the agent, it would have to appear Green, Enabled and in an IDLE state - in your WebAccess (Settings, either Build or Agent Queues directly, and verify the state there). I have experienced only once similar behavior, with accessing the resources and it was connected with how the TFS Server "Web Access URL" was set in the TFS Administration Console.You should make sure, that you are able to access your TFS from the build machine, using the exact same URL, that you have provided to your new build agent as well.

How do I run tests remotely with VS2015?

I've got some CodedUI tests I'd like to run on a remote machine from visual studio. Now it used to be that you'd install a test controller somewhere, a test agent on the box you want to run on, get them talking, then use a test settings file that was pointed to that controller. I was going through this and installed agents for 2015 update 3 on my run box. I noticed that there is no controller configuration option. After some googling I found this: https://vstfsalm.wordpress.com/2015/08/18/tfs-2015-test-agent-has-not-been-configured-run-the-test-agent-configuration-tool-to-configure-the-test-agent/. Very cool. So I go in to tfs to set up a machine group. Great. The part I don't get is: how can I now tell VS to run at that group? Test settings files require a controller when they are set to remote run. Do I have to downgrade the agents back to 2013? Does anyone know if Microsoft just didn't implement this work style in 2015 (on purpose or otherwise) or if it just isn't implemented yet?
To run the code UI test via vNext build on TFS update3. First make sure the code UI test can be executed successfully in your Visual Studio on your remote machine locally. Also don't forget to configure the build agent to interact with desktop.
Then you just need to add Deploy TestAgent on RemoteTestMachine task and run Functional test. When you queue a build, it will deploy your code ui test solution to the drop folder on the build server machine. Then use MSTEST to run the test assembly. It's same with running code UI test via MSTEST command line on your local machine.
Update
Q: Will the Test Agent 2015 support all the scenarios supported by
Test Controller and Test Agent of Visual Studio 2013?
A: We recommend you use Agents for Visual Studio 2015 in all the new automated testing scenarios. You can use the Deploy Test Agents task in a build definition to download and install the test agents on your machine. The following table shows the scenarios supported by Agents for Visual Studio 2013 and the alternatives for Team Foundation Server (TFS) 2015 and Team Services (TS).
Source Link: Install and configure test agents
Currently, there is no alternative for this scenarion. You may have to use test agent 2013 to achieve it.

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:

Publish from TFS 2013 to WebSite IIS : Failed with no error

At my company, we have received Team Foundation Server 2013 and Visual Studio 2013 to manage our code and deployment.
I'm trying to make it work but I can't figure out what I miss.
So here is the scenario :
I have a Web Application with no DB for the moment.
It's added to TFS and I have checked in everything.
There is a Build Controller on TFS.
On the Web Server, Web Deploy is installed and Management Services is there and allow remote management. The services are running. I have create a website but the folder with the source is empty for now.
My objective is to build on TFS and deploy from there in one single operation with the build definition.
Here is my problem, the build is working fine and everything is put in the drop folder. But it deploy nothing on the webserver and It raised no error on the build.
I tryied two techniques for the MSBuild arguments:
1) I create a publish profile in VS, when I publish from there it works but with this argument it does nothing:
/p:DeployOnBuild=true;PublishProfile=PublishIGU
2) I use this argument :
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish
/p:MSDeployServiceURL=https://{serverWeb}:8172/msdeploy.axd
/p:DeployIISAppPath=IGUDEV /p:MsDeployPublishMethod=WMSVC
/p:AllowUntrustedCertificate=True /p:UserName=DOMAIN\user
/p:Password=XXXXX
And... it still does nothing.
I read a lot on the internet and follow tutorials but I can't figure this out.
Like I don't have any error message I don't know where to start.
Thank you if you see something that could help me.

The virtual path ... maps to another application, which is not allowed. Team Foundation Server build fails

I have a WebSite project that builds successfully when running locally. I'm trying to setup Continuous Builds for this website in TFS (Visual Studio 2010) - when the build runs, it's failing with this error -
The virtual path '/abc/MasterPages/abc.master' maps to another application, which is not allowed.
Within my build agent, I'm not even trying to publish this to IIS - all I've configured it to do is to just run the build and copy the output to a specific folder.
Can anyone please let me know how I can get around this problem in TFS, as the same code runs successfully on all the developers' workstations?
Do you have publish information set as part of the project? If so remove it. Publish step needs to be done another way as part of a tfs build
Work around was to Prefix ~ in all relative URLs - for eg: '/abc/MasterPages/abc.master' will be '~/abc/MasterPages/abc.master'
That seemed to solve my problem.

Resources