Forum Discussion
mmkumaram
14 years agoOccasional Contributor
Good to know that its working now.
Regarding results, While we run the test from test complete we output two type of test results
1. A text/xml file which contains the total number of test passed and failed, which is then used in msbuild to post results in Teamcity build summary. Below is the MSbuild code that reads the text file and prints results in teamcity.
2. Html result file which contains the test steps and its results.These html files are copied to teamcity build artifacts and then displayed on the Test Summary Page. Refer :http://confluence.jetbrains.net/display/TCD5/Including+Third-Party+Reports+in+the+Build+Results to find out how to set up custom build report tabs in teamcity.
Hope this is useful.
Thanks,
Muthu
Regarding results, While we run the test from test complete we output two type of test results
1. A text/xml file which contains the total number of test passed and failed, which is then used in msbuild to post results in Teamcity build summary. Below is the MSbuild code that reads the text file and prints results in teamcity.
<Target Name="SummarizeResults">
<ItemGroup>
<NbTestsFailedFile Include="$(MSBuildProjectDirectory)\..\..\Reports\TotalNbTestsFailed.txt"/>
<NbTestsAbortedFile Include="$(MSBuildProjectDirectory)\..\..\Reports\TotalNbTestsAborted.txt"/>
<NbTestsPassedFile Include="$(MSBuildProjectDirectory)\..\..\Reports\TotalNbTestsPassed.txt"/>
<BuildDateFile Include="$(MSBuildProjectDirectory)\..\..\Reports\BuildDate.txt"/>
</ItemGroup>
<ReadLinesFromFile
File="@(NbTestsFailedFile)" ContinueOnError='true'>
<Output
TaskParameter="Lines"
ItemName="testsFailed"
/>
</ReadLinesFromFile>
<ReadLinesFromFile
File="@(NbTestsAbortedFile)" ContinueOnError='true'>
<Output
TaskParameter="Lines"
ItemName="testsAborted"
/>
</ReadLinesFromFile>
<ReadLinesFromFile
File="@(NbTestsPassedFile)" ContinueOnError='true'>
<Output
TaskParameter="Lines"
ItemName="testsPassed"
/>
</ReadLinesFromFile>
<ReadLinesFromFile
File="@(BuildDateFile)" ContinueOnError='true'>
<Output
TaskParameter="Lines"
ItemName="buildDate"
/>
</ReadLinesFromFile>
</Target>
<Target Name="TestLogging">
<TeamCitySetStatus Status="FAILURE" Text="Tests Failed:@(testsFailed), Passed:@(testsPassed), Aborted:@(testsAborted); Build:@(buildDate)" Condition ="'@(testsFailed)' != '0' And '@(testsFailed)' != ''"/>
<TeamCitySetStatus Status="ERROR" Text="Tests Failed:@(testsFailed), Passed:@(testsPassed), Aborted:@(testsAborted); Build:@(buildDate)" Condition ="'@(testsFailed)' == '' Or '@(testsAborted)' != '0'"/>
<TeamCitySetStatus Status="ERROR" Text="Tests Failed:@(testsFailed), Passed:@(testsPassed), Aborted:@(testsAborted); Build:@(buildDate)" Condition = "'@(testsFailed)' == '0' And '@(testsAborted)' == '0' And '@(testsPassed)' == '0'"/>
<TeamCitySetStatus Status="SUCCESS" Text="Tests Failed:@(testsFailed), Passed:@(testsPassed), Aborted:@(testsAborted); Build:@(buildDate) " Condition ="'@(testsFailed)' == '0' And '@(testsAborted)' == '0' And '@(testsPassed)' != '0'"/>
<Error Text = "FAILED" Condition =" '@(testsFailed)' != '0' And '@(testsFailed)' != ''"/>
<Warning Text = "ABORTED" Condition =" '@(testsFailed)' == '' Or '@(testsAborted)' != '0'"/>
<Warning Text = "ABORTED" Condition =" '@(testsFailed)' == '0' And '@(testsAborted)' == '0' And '@(testsPassed)' == '0'"/>
<Message Text = "PASSED" Condition =" '@(testsFailed)' == '0' And '@(testsAborted)' == '0' And '@(testsPassed)' != '0'"/>
</Target>
2. Html result file which contains the test steps and its results.These html files are copied to teamcity build artifacts and then displayed on the Test Summary Page. Refer :http://confluence.jetbrains.net/display/TCD5/Including+Third-Party+Reports+in+the+Build+Results to find out how to set up custom build report tabs in teamcity.
Hope this is useful.
Thanks,
Muthu
Related Content
- 5 years ago
- 8 years ago
- 9 years ago
- 14 years ago
Recent Discussions
- 3 days ago