获得在TeamCity中运行测试的时间

时间:2016-08-31 14:46:10

标签: node.js teamcity

我正在http://[server name]/app/rest/builds/id:[build id]/statistics做请求,并得到如下响应:

<properties count="36">
    <property name="ArtifactsSize" value="1274836"/>
    <property name="BuildArtifactsPublishingTime" value="97"/>
    <property name="BuildCheckoutTime" value="1480093"/>
    <property name="BuildDuration" value="7324057"/>
    <property name="BuildDurationNetTime" value="5843867"/>
    <property name="buildStageDuration:artifactsPublishing" value="107"/>
    <property name="buildStageDuration:buildFinishing" value="3"/>
    <property name="buildStageDuration:buildStepRUNNER_107" value="20868"/>
    <property name="buildStageDuration:buildStepRUNNER_11" value="107"/>
    <property name="buildStageDuration:buildStepRUNNER_13" value="334"/>
    <property name="buildStageDuration:buildStepRUNNER_14" value="3671"/>
    <property name="buildStageDuration:firstStepPreparation" value="113"/>
    <property name="buildStageDuration:sourcesUpdate" value="1480310"/>
    <property name="BuildTestStatus" value="1"/>
    <property name="InspectionStatsE" value="0.000000"/>
    <property name="InspectionStatsW" value="0.000000"/>
    <property name="PassedTestCount" value="24"/>
    <property name="SampleStatistics" value="1"/>
    <property name="SuccessRate" value="1"/>
    <property name="TimeSpentInQueue" value="154"/>
    <property name="TotalTestCount" value="24"/>
    <property name="VisibleArtifactsSize" value="1266844"/>
</properties>

如何获得运行测试所需的时间?

1 个答案:

答案 0 :(得分:1)

您可以使用以下REST API请求获取有关在构建中运行测试的信息:

http://teamcity/app/rest/testOccurrences?locator=build:(id:<buildID>)

此处有更多详情:https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-Tests