0

I have deployed CruiseControl.Net (Version 1.6.7981.1) server and it does the following tasks:

  1. Build trigger
  2. Labeller
  3. VSTS Soursecontrol block (Get the soursecode from TFS 2010 server)
  4. Build the code in Debug mode
  5. Run NUnit test using Nanat task
  6. Merge NUnit-Result.xml (Publisher task)

As I need to clear NUnit-Result.xml file every time before running the NUnit task, I have added a delete task in Nant.build file which deletes NUnit-results.xml before NUnit task run.

Now my problem is when my build get triggers and if my TFS server is not accessible, build get failed and only publisher task runs so Old Nunit result file merge in the failed build.

I Tried running "Prebuild" task but it works only if TFS server is accessible.

Now What I want is a task to delete Nunit-result.xml which can run even if my TFS is not accessible (either before soursecontrol block or within/after publisher block)

Thanks in advance

4

3 に答える 3

0

最後に、nunit 結果ファイルを移動または削除するパブリッシャーを配置します。その後、次のビルドにはありません。

于 2012-05-25T15:33:00.920 に答える
0

ファイルのマージの直前に、パブリッシャー設定でファイルを削除する実行タスクを追加できます。

このような:

<publishers>
  <xmllogger />
  <statistics />
  <buildpublisher>
    <sourceDir>$(buildDir)\_PublishedWebsites\$(projectName)</sourceDir>
    <publishDir>$(webDir)</publishDir>
    <useLabelSubDirectory>false</useLabelSubDirectory>
    <alwaysPublish>false</alwaysPublish>
  </buildpublisher>
  <exec>
    <executable>$(workingDir)\deleteNunitResultxml.cmd</executable>
  </exec>
   ...
</publishers>
于 2012-05-24T10:09:13.327 に答える
0

もう 1 つのオプションは、nunit タスクが実行される前に実行するタスクを作成することです。これにより、nunit-result.xml ファイルが削除されます。

例: cmd /c "del NUnit-Result.xml" を実行します。

于 2012-06-07T15:40:56.190 に答える