簡體   English   中英

如何讓TeamCity使用MSTest運行測試?

[英]How to get TeamCity to run tests using MSTest?

我想弄清楚如何讓TeamCity運行我的MSTests。 我使用以下參數設置了構建步驟:

  • MSTest.exe的路徑:system.MSTest.10.0
  • 列出程序集文件: Projects \\ Metadude。 .Tests \\ BIN \\調試\\ Metadude。 .Test.dll
  • MSTest運行配置文件: Local.testsettings

但是,當此步驟運行時,它不會執行任何測試。 這是日志的輸出:

[02:13:49]: Step 2/2: Run Unit Tests (MSTest)
[02:13:49]: [Step 2/2] Starting: "D:\Program Files (x86)\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe" #TeamCityImplicit
[02:13:49]: [Step 2/2] in directory: D:\Program Files (x86)\TeamCity\buildAgent\work\1f82da3df0f560b6
[02:13:50]: [Step 2/2] Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1
[02:13:50]: [Step 2/2] Copyright (c) Microsoft Corporation. All rights reserved.
[02:13:50]: [Step 2/2]
[02:13:50]: [Step 2/2] Please specify tests to run, or specify the /publish switch to publish results.
[02:13:50]: [Step 2/2] For switch syntax, type "MSTest /help"
[02:13:50]: [Step 2/2] Process exited with code 1
[02:13:50]: Publishing internal artifacts
[02:13:50]: [Publishing internal artifacts] Sending build.finish.properties.gz file
[02:13:50]: Build finished

我試圖使用以下內容指定要運行的測試:

  • 測試: Tests.Metadude.Core.Extensions.StringExtensionsTests

但這不起作用。 我似乎無法在谷歌上找到與TeamCity中的MSTest構建步驟相關的任何文檔。

更新好的,我是個白痴。 好吧,這可能有點苛刻,但測試組件缺少程序集名稱中的“s”。 本來很高興在構建日志中獲得某些效果。

首先,確保您嘗試測試的程序集存在於該位置。

你的相對路徑:Projects \\ Metadude..Tests \\ bin \\ Debug \\ Metadude..Test.dll

但是,如果您的文件不存在,我會期望TC記錄的內容。 看起來它運行的MSTest沒有任何參數。

如果您確定路徑是正確的,請嘗試它而不指定.testsettings文件以查看會發生什么。 我在沒有這個的情況下在TC中成功使用MSTest(但你可能需要它)。 我正在做的另一件事是我指定MSTest.exe的FULL路徑,即

C:\\ Program Files \\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ MSTest.exe

而不是他們的變量'%system.MSTest.10.0%'

我不記得為什么我這樣做但是有一個很好的理由(就像它在使用他們的變量時沒有工作)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM