TFS does not publish ANT test results from relative path

I created the ANT construct for the eclipse project and its unit tests using Team Foundation Server 2010. However, I cannot get it to publish unit test results for TFS.

The build.xml file itself works correctly, as it creates a project and creates an xml result file. The problem seems to be in the TFSBuild.proj file and publishing test results for TFS.

Using the following code, the build succeeds and publishes the results to TFS, as I expected:

<ItemGroup> <AntBuildFile Include="$(SolutionRoot)/StockMoves/build.xml"> <Targets></Targets> <Properties>BinariesRoot=$(BinariesRoot);BuildDefinitionName=$(BuildDefinitionName);BuildDefinitionUri=$(BuildDefinitionUri);BuildDirectory=$(BuildDirectory);BuildNumber=$(BuildNumber);DropLocation=$(DropLocation);LogLocation=$(LogLocation);SourceGetVersion=$(SourceGetVersion);TestResultsRoot=$(TestResultsRoot);TeamProject=$(TeamProject);WorkspaceName=$(WorkspaceName);WorkspaceOwner=$(WorkspaceOwner)</Properties> <Lib></Lib> </AntBuildFile> <JUnitLogFiles Include="$(SolutionRoot)/StockMoves/test/TEST-unittest.TestSuite.xml" /> </ItemGroup> 

However, when trying to change the path in which JUnit looks at this:

 <JUnitLogFiles Include="$(SolutionRoot)/**/TEST-*.TestSuite.xml" /> 

Then the test results are no longer published. I know that this formatting works, since I have successfully used it in other builds, but this one is confused.

Any help would be greatly appreciated!

+4
source share
1 answer

Looks like I solved it!

It would seem, for some reason, this file should already exist when the assembly starts. I added an empty XML file with the same name as the file obtained from the results of my testing, and now the results are published in TFS.

+1
source

All Articles