Сбой TFS основывается на отказе при испытании единого блока

Я предпочитаю богомола. Это работает приятно и, легко расширяются способный или при помощи плагинов или с путем кодирования.

5
задан ROMANIA_engineer 13 January 2018 в 08:56
поделиться

1 ответ

If you have VS2008 SP1 installed on your build machine then you can simply add the following property to your TFSBuild.proj file:

<TreatTestFailureAsBuildFailure>true</TreatTestFailureAsBuildFailure>

If you don't have SP1 installed and you don't want to install it, then you can do it the old fashioned route as detailed here by the Dev Lead on the TFS Build team, Aaaron Hallberg:

  <Target Name="AfterTest">

    <!-- Refresh the build properties. -->
    <GetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                        BuildUri="$(BuildUri)"
                        Condition=" '$(IsDesktopBuild)' != 'true' ">
      <Output TaskParameter="TestSuccess" PropertyName="TestSuccess" />
    </GetBuildProperties>

    <!-- Set CompilationStatus to Failed if TestSuccess is false. -->
    <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                        BuildUri="$(BuildUri)"
                        CompilationStatus="Failed"
                        Condition=" '$(IsDesktopBuild)' != 'true' and '$(TestSuccess)' != 'true' ">

  </Target>
3
ответ дан 15 December 2019 в 06:30
поделиться
Другие вопросы по тегам:

Похожие вопросы: