Team Foundation Server Build Extensions Power Tool December 2011
The Team Foundation Build Extensions provide the ability to execute Ant or Maven builds from Team Foundation Server and publish the results of the build along with any associated JUnit test results back to Team Foundation Server.
A few months ago you said "If you would like to build the Ant or Maven project without using TEE then let me know and I'll document the manual steps to do this from Visual Studio."
Have you had a chance to document these steps? Is this info avaiable anywhere?
We have a very large existing build definition that we want to add a step to that will call ant.
I agree with jason.p.h. One major road block is the the requirement that for VS 2010 the Upgrade Template be used. Most of the other projects in the "solution" are already set up using a modified Default Template. The idea is to have one build for everything to achieve proper automation and launch only one build. Is this even possible?
I'm also interested in using a modified Default Template instead of the Upgrade Template. This would give us additional flexibility to control our builds and reduce the number of steps we need to take to run ANT (WF->MSBuild->ANT becomes WF->ANT).
Is there a way to do this today?
I have been following your articles/suggestions from teamprise days. We recently upgraded our TFS environment from 2008 to 2010. We have the Java builds working fine using these extensions and I was also able to publish JUnit test results by dropping the report file in BinariesRoot as you had earlier suggested. Now here is the issue: I had to override "AfterPublishJUnit" target in TFSBuild.proj file to fail the build when tests are failing. Also the default stated behavior of builds being "partiallySucceeded" didn't work for us. The problem though is that with this override target, the build will show "failed" status even when there is no junit test to execute. I have two questions based on this if you could answer, it would be great:
1. Why the default behavior not working for builds to be in "partial successful" state when there is no override of the target in TFSBuild.proj file setting the status.
2. If #1 above is an unresolved issue, how do we address the problem I am facing? i.e. when there are no junit tests to execute, shouldn't the "TestSuccess" parameter be null rather than false?
I am including the override target here so you can review:
<!-- Refresh the build properties. -->
Condition=" '$(IsDesktopBuild)' != 'true' ">
<Output TaskParameter="TestSuccess" PropertyName="TestSuccess" />
<!-- Set CompilationStatus to Failed if TestSuccess is false. -->
Condition=" '$(IsDesktopBuild)' != 'true' and '$(TestSuccess)' != 'true' " />
Hi Amish / Martin,
I tried overriding the AfterPublishJUnit target to fail a build when JUnit tests fail. However I am seeing that the TestSuccess and TestStatus properties never get set (default to TestSuccess=False and TestStatus=Unknown). How does TestSuccess get set when tests fail? Is there an output from the RunPublishJUnit target?
I just face the same problem on TFS 2010 SP1 and december power tools.
A workaround is to ad a condition after runing the MSBuild 3.5 activity and test if a testrun has failed then change de teststatus of the build.
Here is the condition (a litle noisy xD)
BuildDetail.BuildServer.TeamProjectCollection.GetService(Of ITestManagementService)().GetTeamProject(BuildDetail.TeamProject).TestRuns.ByBuild(BuildDetail.Uri).SelectMany(Function(tr) tr.QueryResults).Where(Function(tcr) tcr.Outcome = TestOutcome.Failed).Any()
We have custom tasks to build and deploy Java projects and .Net projects using Team build 2008. We are using PublishJUnit task to publish the Junit tests results and coverage information to TFS. We have custom reports to retrieve the coverage for .Net and Java projects.
Coverage reports were working fine for both .Net and Java projects until we upgraded to TFS 2010. It seems in TFS 2010 the coverage details are published to coverage tables (Instead of tbl_BuildInformation table).
Is there a way “PublishJunit” task would publish the coverage details to TFS 2010 Coverage tables (tbl_CoverageChange, tbl_Coverage, tbl_ModuleCoverage, tbl_BuildCodeChange, tbl_FunctionCoverage)?
Do you know how the code coverage data was getting into TFS before 2010 for Java builds? The PublishJUnit task has never been able to publish detailed test coverage data - this is something that I want us to be able to do but haven't figured out a way to get this into the warehouse yet that would work without creating a custom warehouse adapter (the test coverage file format used by TFS is currently tied pretty closely to the PE file format used for .exe and .dll files.
Our TFS code coverage report is retrieving data from [Tfs_Cobalt_Collection].[dbo].[tbl_BuildInformation] table, this table contains the build information. As part of the java build we have a custom build task which uses ICodeCoverageSummary interface to write the total # tests and total coverage information to this table. The detailed code coverage information for Java is not published to TFS databases. I Just looked at MSDN, it seems the interface ICodeCoverageSummary is obsolete
We're using this to build a Flex project however, the warnings are not being displayed on the results list (Summary shows:
Release | Any CPU
No Compilation Errors Found
No Compilation Results
No Test Results
No Code Coverage Results)
although the warnings appear on the log file:
[mxmlc] C:\Builds\Sources\src\com\common\skins\GettingStartedColumnSkin.mxml(7): Warning: CSS type selectors are not supported in components: 'global'
Any idea on how to get the warnings displayed?
How do you run your C++ build and Google Test run at the moment? Are you using workflow activities or MSBuild to do most of your test execution? (Just wanting to understand the most appropriate way of hooking up the JUnit Publish activities / tasks)
I am using TFS with Maven and Sonar. I build succesfully, but when I attempt to set up a build specifically to run a weekly Sonar, I get a "Java Heap Memory" error. I have seen the same error when I run "mvn sonar:sonar" manually on the same machine and I have fixed it by setting MAVEN_OPTS=-Xmx1024m. This appears to be ignored by my TFS builds however. (I have tried editing the mvn.bat file and my understanding is that the memory settings in the POM file apply only in situations when a fork occurs.)
First: I request sonar by replacing <Goals>install</Goals> with <Goals>sonar:sonar</Goals> in the TFSBuild.proj file. Is this the right way to do this?
Second: How do I pass in a JVM max memory that will be used when TFS controls the build?
Sample log file fragment follows:
[INFO] Cobertura Report generation was successful.
[INFO] Execute org.codehaus.mojo:cobertura-maven-plugin:2.5:cobertura done: 27942 ms
[INFO] Sensor SurefireSensor done: 0 ms
[INFO] Sensor CpdSensor...
[ERROR] FATAL ERROR
[INFO] Java heap space
I just deployed and configured this extensions and it seems to works fine. However I get the following error in the build process:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets (1515):
Unable to copy file
The specified path, file name, or both are too long.
The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
As far I can understand, the local compilation in the build agent folder [c:\1\Binaries] works fine, however after the compilation the build process is not able to copy the generated files to the output drop folder.
I'm trying to edit the process so i can change the copy to use a more powerfull copy task, but I check that is based on MSBuild.
I'm trying to run a goal with semicolons (":") with no success. It appears that goals like "sonar:sonar" will fail, I guess because of the output folder of the goals. The maven build proceeds alright, but the TFS build fails because it cannot copy the output anywhere...
Is there anyway to modify this or raise a bug?