On our build server, we have a space disk problem. After investigation, we found a lot of te.processhost.managed_xxx_xxx_xxx.itrace files in C:\Windows\Temp. It's take nearly 50Go.
There were created on a process building in TFS 2015 vNext, on the task Visual Studio Test but there are never delete automatically.
There were not created if we disable Codecoverage option (but we need this option of course).
How can we disable automaticaly creation of these files ? Or automaticaly delete these files in the process (without script) ? Any option ? Other idea ?
From TFS 2015 Update 3 (upgrade your TFS if your version is lower than this Update 3), there is a task named Delete files, you could add this task after Visual Studio Test task to delete the .itrace files.
I faced the same issue with build agents of version 2.122.1, "Visual Studio Test 1.*" and TFS 2017 Update 3.
I worked around it with a scheduled run of the following PowerShell script:
get-childitem -Path $env:SystemRoot\Temp -Filter *.itrace | where-object {$_.lastwritetime -lt (get-date).AddHours(-1)} | Foreach-Object { del $_.FullName }
Related
I'm working in Linux Mint 19 & using JetBrains. I have Team Foundation Server 2015 Update 4 installed on premise by my company whenever I try to checkout a project from the TFS I'm getting this message:
The workspace 'SmartGPS_Git' already exists for you on this computer
or another. Please try checking out the repository again with a
different unique directory name.
TEE CLC tool is configured in JetBrains WebStorm.
I tried to
Uninstall JetBrains WebStorm & reinstall it
remove TEE CLC tool with no luck
tf workspace /server:http://{TFSServername}:8080/tfs/{CollectionName} /delete “{workspacename};{owner}” it didn't even work
On Windows you can remove any workspace with the Visual Studio but here I don't have Visual Studio.
Please try to use /collection instead of /server to delete the workspace, the command should look like:
workspace /delete [/collection:<url>] [<workspacename;[workspaceowner]>]
Also, you can try to create a new workspace to see whether the issue persists:
workspace /new [/noprompt] [/template:<value>] [/computer:<value>] [/comment:<value>|#valuefile]
[/collection:<url>] [/location:server|local] [/filetime:current|checkin]
[/permission:Private|PublicLimited|Public] [<workspacename;[workspaceowner]>]
I want to make a build definitios in TFS 2015 that copies all files in a repository to a given UNC.
This is not a VS project, but a set of web files that all are compiled.
Any ideas how this can be solved?
Copy Files task exists in TFS 2015.3 and newer versions. You could upgrade your TFS 2015 to the latest edition TFS 2015.4 and use this task.
Otherwise, you could use Copy and Publish Build Artifacts task, which is available since TFS 2015 RTM.
I ended up writing a PowerShell for the job.
#
# Deploy.ps1
#
param (
[Parameter(Mandatory=$true)][string]$targetPath
)
Function Deploy-Package() {
Copy-Item "$Env:BUILD_SOURCESDIRECTORY\*" $targetPath -Recurse
}
Deploy-Package
Write-Host -ForegroundColor Green "Deployment successful"
I need to check-in some files generated during a TFS 2017 vNext build.
In my old XAML build I could easily do that using the tf checkin command since the files reside in the build workspace.
In the new vNext build, The workspace owner is Project Build Service or Project Collection Build Service, even when I configure the agent to run under a different account.
Any way to perform the check-in on the build workspace? Or somehow configure who owns that workspace?
There are Add and Check in changes tasks in TFVC Build Tasks extension.
Regarding no pending changes, you need to add the files to the list of pending changes for the workspace by calling TF add command.
It's not a recommend way to check-in/ modify source code during a build pipeline. If you really want to do this, you could edit the build worspace files and use tf commands in custom/powershell task eq:
cd $env:BUILD_SOURCESDIRECTORY
$TFFile = Get-Item "C:\Program Files (x86)\Microsoft Visual Studio 1x.0\Common7\IDE\TF.exe"
$tfOutput = [string]( & $TFFile.FullName checkin /noprompt /override:"***NO_CI*** New version is $newVersion." /comment:"***NO_CI*** New version is $newVersion." 2>&1)
Another way is installing TFS Power Tool and use the Windows PowerShell Cmdlets to check in the files. Refer to this link for more details: PowerShell and TFS: The Basics and Beyond
I am new to TFS and want to integrate OpenCover with TFS. If any has done this please help!
This question is rather old but maybe you are still interested. With current Version of TFS (2015 Update 2) this is now possible as a "vsts Extension".
See here for details: https://github.com/RobertK66/vsts-opencover
Since the answer doesn't specify the version of TFS, here is an answer for 2015/2017.
OpenCover can be run from TFS using the Powershell build step. You need to get the contents of the OpenCover NuGet package onto TFS and run OpenCover.console.exe from there.
Since TFS doesn't support the format produced by OpenCover, you need to take one additional step and convert the results to Cobertura format. It's possible using the OpenCoverToCoberturaConverter NuGet package.
I've described the whole process in much more detail on my blog:
http://codewithstyle.info/setting-up-coverage-reports-on-vsts-with-opencover/
OpenCover is just a console application so you can just modify your scripts to get OpenCover to run your unit tests.
I haven't used TFS for several years and it has changed since then however this blog post should help
To incorporate coverage measurement of OpenCover the build process of TFS (second half)
The original is in Japanese but if you are familiar with TFS then the screens will probably be obvious.
OpenCover also comes with an MSBuild task that may help you with your integration.
I've just integrated opencover with TFS Build, to generate a xml with the results that will be processed by sonar:
Created a RunCoverage.cmd at the root of my source folder
Installed / copied in TFS Servers the Opencover binaries and added into Path(must restart TFS Services to enable TFS to see it).
Created a new actitivity in the build definition, that is, editing the build template (before sonar execution activity) to run the cmd:
Running command line statements from TFS custom activity
http://msdn.microsoft.com/en-us/library/gg265783.aspx
There is the cmd contents:
#REM #echo suppresses command line. ^ is line continuation character
#ECHO Executing OpenCover...
OpenCover.Console.exe -register:user ^
-target:"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" ^
-targetargs:"/testcontainer:%~dp0test.dll /usestderr /resultsfile:%~dp0MSTestsResults.trx" ^
-output:%~dp0opencovertests.xml
But i'm facing three issues (that are related with my concrete implementation, but you may face them):
The Tests are runned twice (one for template itself, and other for OpenCover)
The MsTest.exe in the TFS Servers is not in the same path, so when the Controller asigns an agent (if the match is done by tags) then if the agent executing the build is in a TFS Server that does not have the MSTest in the right path it will fail.
How to inject in cmd the corresponding test runner (MsTest, XUnit, Nunit, etc...) depending on the test project
Hope that it helps! (and someone can help me ;-)
How do I make the command to run sonar-runner at the end of the build TFS (Team Foundation Server) in continuous integration?
Info: TFS 2013, Windows Server 2008 R2, sonar-runner 2.3
The only way to execute arbitrary commands as part of the build process is to add an InvokeProcess activity to the BuildProcessTemplate. This isn't as difficult as it may seem at first.
Make a copy of the DefaultTemplate.xaml which is located in the /BuildProcessTemplates folder of your team project. Name it whatever you want - SonarRunnerTemplate.xaml or something.
Open up the new template in Visual Studio
Hit "Collapse All" at the top right to ease navigation to the proper activity.
Browse to Process > Sequence > Run On Agent > Try Compule, Test, and Associate Changesets and Work Items > in the Finally clause > Revert Workspace and Copy Files > If DropBuild And DropLocation is Set
In the "Then" box you will see a Copy Files to Drop Location activity. Move this into the "Else" box temporarily.
Add a Sequence activity from the Toolbox into the (now empty) Then box
Move the Copy Files to Drop Location (which we moved earlier) back into the Sequence activity you just added to the Then box.
Add a InvokeProcess activity from the Toolbox to run AFTER the "Copy Files to Drop Location" activity
Open the Properties for the InvokeProcess activity. The FileName field is the command which you need to execute. In this case, the command to execute your Sonar runner. It might be easiest to write a batch or powershell script which runs Sonar... and then invoke that.
Save the build process template and add it to TFS. You can then use this template for your build definition.
One issue with this approach is that the build will not "finish" until after the InvokeProcess command has returned. So if your sonar run takes a really long time (I know I have seen it take over 24 hours for a large codebase) the build will take forever to complete. This can be mitigated by having your script spawn off the Sonar process asynchronously.
There is now an official way to get MsBuild and TeamBuild to work with SonarQube, as part of a collaboration between Microsoft and SonarQube. You can find all the details on the SonarQube website:
http://www.sonarqube.org/announcing-sonarqube-integration-with-msbuild-and-team-build/
And on the Microsoft ALM website:
http://blogs.msdn.com/b/visualstudioalm/archive/2015/04/28/technical-debt-management-announcing-sonarqube-integration-with-msbuild-and-team-build.aspx
There is also documentation prepared by the ALM rangers that describe how to install SonarQube and integrate it with an existing TFS server:
https://vsarguidance.codeplex.com/downloads/get/1452516