I am creating a build definition in visual studio 2013. As you know, while creating build definition we can also set the assembly (in "Automated Tests" section) which contains the unit test methods to run. I am able to create the definition till this point. Now, what I want is once the test run is over, I want to call an exe that will parse the Trx file generated as a result of test run and send the run results in an email.
Can anyone have an idea about where I can set the path to the exe and pass some arguments to it while creating build definition? If this cannot be done while creating definition, what else is the other way to achieve it?
Thanks!
What you ask involves multiple steps, especially if you want to pull the tool from version control (which is IMHO the best option).
See the ALM Rangers' Team Foundation Build Customization Guide for help and guidance on this topic.
Or you can just setup an email notification when the TFS Build completes. That should include the test run results, and a clickable link to go to the full build report.
Related
I am trying to clickonce-publish a client app compiled using the scriptable build system available on Visual Studio Online. It seems something new.
I was able to find some articles showing how to customize msbuild and add parameters to make it work on local TFS:
http://publicvoidlife.blogspot.pt/2014/05/continuous-integration-with-tfs-and.html?showComment=1441022327672 and
http://www.dontpaniclabs.com/blog/post/2011/04/29/clickonce-publish-and-deploy-from-team-foundation-server-2010/
But in Visual Studio Online there are some different things. I see there are some "build steps" I can set that include package/deploy scripts. Can I use them for clickonce?
If setting clickonce publish during msbuild is the way to go, how to set parameters on the "visual studio build" script?
I don't know how to specify the "publish" option on msbuild script ui nor how to specify necessary parameters.
Any ideas?
Thank you,
Just as described in the blogs you posted, you need to customize build process template to be able to publish clickonce app. Here is another link which is useful for you, from which you can check the detailed information on how to do the customization step by step (includes information on how to add arguments, how to add /t:publish msbuild arguments) (it is written for TFS2010, applies to VSO as well): http://www.codeproject.com/Articles/122388/TFS-Team-Build-with-ClickOnce-Applications
I am trying build automation for a project developed using legacy language called Team Developer 6. where each file needs to be compiled as an exe. also need to do some filter activity before building exes. there are 300 exes.
this process I could do in simple .Net utility which does the filtering and invokes Team Developer compiler for required files.
Is it possible to put this in to TFS build work flow? what is the best approach for this?
Write an MSBuild project that invokes the necessary commands for the tooling you require and check it in. In the TFS build definition, make use of the default template (at first) and set the MSBuild project file you created as the 'project to build'.
This way you can test your build process locally with MSBuild on the command line, and determine which command line switches you might need. You can set command line switches into the build definition, or if you need some further control you can modify the default template to inject the command line switches directly into the MSBuild activity.
I recommend this way, as then you won't have to create any customized workflow, and can avoid having to go down the road of using custom workflow activities in TFS (which is absolutely supported, but in my opinion a bit difficult to diagnose/debug/maintain/upgrade).
You would ideally want to use an InvokeProcess activity to call an executable which does the filtering and invoking. An alternative but more complex approach would be to create a custom activity, but that requires installation of binaries on the build servers.
I'm trying to create a build workflow for TFS that enables the following sequence of events (for now for a Web App, but in the future for Sharepoint projects to):
Build -> Test (Unit Tests) -> Deploy to IIS - Test (Coded UI) - Test (Load)
Up to the deploy I managed to configure the workflow, the problem start after. I'm having trouble the decide where to start. Is it better to create a new activity for each test using workflow components or go the powershell route?
One caveat, the virtualization infrastructure that exists is not MS so I cannot go the Lab Management route.
Thanks in advance for your insights
If you are in position to implement your test-invoking via Powershell, I think this would be your best way to proceed.You would have to implement an "execute Powershell" part in your build script (see here) & maintain your *.ps1 in the source control.For different/various projects you could construct a Build Argument that points to a user-inserted Path to the powershell-file that should execute in the given build definition. This Path could even be from source control. In this case you would have to enter $/path/.../script.ps1 in the Proces of each Build Definition and have a ConvertWorkspaceItem execute before consuming it during Build.Since you are not using MTM/Lab Management, I think this can be a nice/flexible alternative.
I've got a WPF application, developed using TFS 2010. I figured out how to get the continuous integration build basically working. On success, I want the build copied to a network location. It's not clear to me if I should be using the "drop location" or "publish" options. I really just want the simplest possible deployment: straight copy of build output.
Is there a straight-forward way to do this in TFS 2010?
Sounds like you want to use the 'This Build copies output to drop folder' option in the Build Defaults tab of a Build Definition that uses the out-of-the-box Default Template workflow. This will copy everything from your build's output including the symbols for debugging, etc. I'd recommend do this if you want the simplest way to copy the application to a network share as you stated above.
I am playing with TFS 2010, and am trying to setup a build process that will have some custom steps.
These include things like, stopping/starting IIS, search and replace files etc... across environments.
I have tried to look for examples online and have not found anything clear and meaningful on how to just run a script or something over the source files. Looking at the default build process template (DefaultTemplate.xml) I cant make much sense of it.
How do I go about doing this ?
For info on customising the TFS2010 workflow build templates have a look at Ewald Hoffman's series. Start with Part 1 (archived here).
I should also mention that since it looks like you're doing deployment then you may want to break deployment automation away from build automation.
This is almost exactly what I'd say for this question (Split build and deplyment stages, investigate TFSDeployer). One additional element is more generic - for deployment tasks you can't find an easy integrated tool you should create a custom deployment script. You can call any script by adding an "InvokeProcess" step in your Build workflow. TFSDeployer also has locations where you can insert custom PowerShell Scripts. (If you don't like PowerShell you can have PowerShell or "InvokeProcess" call a different script engine.)