View will return TeamCity Compatible XML Report.
Note: to get valid XML document use RptLine column and make sure that result is sorted by SECTIONORDER, SUITEORDER, and CASEORDER columns in ascending order
Note: when using sqlcmd Utility (http://msdn.microsoft.com/en-us/library/ms162773.aspx) on some of the environments make sure that variable_length_type_display_width parameter is set to 0 (zero). The default parameter setting is 256, it limits the number of characters that are returned for the large variable length text data types, and it can truncate error stack trace resulting in the inadequate messages on TeamCity servers. Setting display_width to 0 will limit the output to 1 MB and will prevent truncation issues.
Column Name |
Data Type |
Description |
RowType |
VARCHAR |
Type of the report row:
-
SUITE OPEN
-
UNITTEST
-
SUITE CLOSE
|
Suite |
VARCHAR |
Name of the Unit Test Suite |
UnitTestName |
VARCHAR |
Name of the Unit Test |
SectionOrder |
INT |
Order of the section part in the report. To get correctly formatted always order by this column first in ascending order. |
SuiteOrder |
INT |
Suites section order. To get correctly formatted document always order by this column second in ascending order. |
TestOrder |
INT |
Order of the unit test lines in the suite section on the report. To get correctly formatted document always order by this column third in ascending order. |
RptLine |
NVARCHAR |
Report line |
Example
Following SQL query will produce Team City compatible report for all unit test that have run:
SELECT
Rpt_Line
FROM
DBTD_VW_RPT_TeamCity
ORDER BY
SECTIONORDER ASC,
SUITEORDER ASC,
CASEORDER ASC;
Output
##teamcity[testSuiteStarted name='DBTD']
##teamcity[testStarted name='UT_DBTD_AssertFailOnError' captureStandardOutput='true']
##teamcity[testFinished name='UT_DBTD_AssertFailOnError']
##teamcity[testStarted name='UT_DBTD_AssertFailOnFailure' captureStandardOutput='true']
##teamcity[testFinished name='UT_DBTD_AssertFailOnFailure']
##teamcity[testStarted name='UT_DBTD_DTIsGreaterOrEqual' captureStandardOutput='true']
##teamcity[testFinished name='UT_DBTD_DTIsGreaterOrEqual']
##teamcity[testStarted name='UT_DBTD_HaveSetup' captureStandardOutput='true']
##teamcity[testFinished name='UT_DBTD_HaveSetup']
##teamcity[testSuiteFinished name='DBTD']
##teamcity[testSuiteStarted name='DBTD1']
##teamcity[testStarted name='UT_DBTD1_Test1' captureStandardOutput='true']
##teamcity[testFinished name='UT_DBTD1_Test1']
##teamcity[testStarted name='UT_DBTD1_Test2' captureStandardOutput='true']
##teamcity[testFinished name='UT_DBTD1_Test2']
##teamcity[testStarted name='UT_DBTD1_Test3' captureStandardOutput='true']
##teamcity[testFinished name='UT_DBTD1_Test3']
##teamcity[testSuiteFinished name='DBTD1']
##teamcity[testSuiteStarted name='TEST']
##teamcity[testStarted name='UT_TEST_FrameworkIgnoring' captureStandardOutput='true']
##teamcity[testIgnored name='UT_TEST_FrameworkIgnoring' [Message]='Ignored']
##teamcity[testFinished name='UT_TEST_FrameworkIgnoring']
##teamcity[testStarted name='UT_TEST_FrameworkNotIgnoring' captureStandardOutput='true']
##teamcity[testFinished name='UT_TEST_FrameworkNotIgnoring']
##teamcity[testSuiteFinished name='TEST']
##teamcity[testSuiteStarted name='TEST1']
##teamcity[testStarted name='UT_TEST1_IgnoreMe' captureStandardOutput='true']
##teamcity[testIgnored name='UT_TEST1_IgnoreMe' [Message]='Ignored']
##teamcity[testFinished name='UT_TEST1_IgnoreMe']
##teamcity[testSuiteFinished name='TEST1']
##teamcity[testSuiteStarted name='TEST2']
##teamcity[testStarted name='UT_TEST2_ShouldNotRunA' captureStandardOutput='true']
##teamcity[testIgnored name='UT_TEST2_ShouldNotRunA' [Message]='Ignored']
##teamcity[testFinished name='UT_TEST2_ShouldNotRunA']
##teamcity[testStarted name='UT_TEST2_ShouldNotRunB' captureStandardOutput='true']
##teamcity[testIgnored name='UT_TEST2_ShouldNotRunB' [Message]='Ignored']
##teamcity[testFinished name='UT_TEST2_ShouldNotRunB']
##teamcity[testSuiteFinished name='TEST2']
See Also