<tfoot id='KICFM'></tfoot>
        <bdo id='KICFM'></bdo><ul id='KICFM'></ul>
    1. <i id='KICFM'><tr id='KICFM'><dt id='KICFM'><q id='KICFM'><span id='KICFM'><b id='KICFM'><form id='KICFM'><ins id='KICFM'></ins><ul id='KICFM'></ul><sub id='KICFM'></sub></form><legend id='KICFM'></legend><bdo id='KICFM'><pre id='KICFM'><center id='KICFM'></center></pre></bdo></b><th id='KICFM'></th></span></q></dt></tr></i><div id='KICFM'><tfoot id='KICFM'></tfoot><dl id='KICFM'><fieldset id='KICFM'></fieldset></dl></div>

      <small id='KICFM'></small><noframes id='KICFM'>

      1. <legend id='KICFM'><style id='KICFM'><dir id='KICFM'><q id='KICFM'></q></dir></style></legend>

        如何让 TeamCity 使用 MSTest 运行测试?

        时间:2023-05-20

            <tbody id='3swya'></tbody>

            <tfoot id='3swya'></tfoot>
          1. <i id='3swya'><tr id='3swya'><dt id='3swya'><q id='3swya'><span id='3swya'><b id='3swya'><form id='3swya'><ins id='3swya'></ins><ul id='3swya'></ul><sub id='3swya'></sub></form><legend id='3swya'></legend><bdo id='3swya'><pre id='3swya'><center id='3swya'></center></pre></bdo></b><th id='3swya'></th></span></q></dt></tr></i><div id='3swya'><tfoot id='3swya'></tfoot><dl id='3swya'><fieldset id='3swya'></fieldset></dl></div>

            <small id='3swya'></small><noframes id='3swya'>

                • <bdo id='3swya'></bdo><ul id='3swya'></ul>
                  <legend id='3swya'><style id='3swya'><dir id='3swya'><q id='3swya'></q></dir></style></legend>
                  本文介绍了如何让 TeamCity 使用 MSTest 运行测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我想弄清楚如何让 TeamCity 运行我的 MSTest.我已经使用以下参数设置了构建步骤:

                  I am trying to figure out how to make TeamCity run my MSTests. I have setup a build step using the following parameters:

                  • MSTest.exe 的路径: %system.MSTest.10.0%
                  • 列出程序集文件: ProjectsMetadude..TestsinDebugMetadude..Test.dll
                  • MSTest 运行配置文件: Local.testsettings
                  • Path to MSTest.exe: %system.MSTest.10.0%
                  • List assembly files: ProjectsMetadude..TestsinDebugMetadude..Test.dll
                  • MSTest run configuration file: Local.testsettings

                  但是,当此步骤运行时,它不会执行任何测试.这是日志的输出:

                  However when this step runs, it does not execute any tests. This is the output from the log:

                  [02:13:49]: Step 2/2: Run Unit Tests (MSTest)
                  [02:13:49]: [Step 2/2] Starting: "D:Program Files (x86)TeamCityuildAgentpluginsdotnetPlugininJetBrains.BuildServer.NUnitLauncher.exe" #TeamCityImplicit
                  [02:13:49]: [Step 2/2] in directory: D:Program Files (x86)TeamCityuildAgentwork1f82da3df0f560b6
                  [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
                  

                  我已尝试使用以下命令指定要运行的测试:

                  I have tried to specify the tests to run using the following:

                  • 测试: Tests.Metadude.Core.Extensions.StringExtensionsTests
                  • Tests: Tests.Metadude.Core.Extensions.StringExtensionsTests

                  但这不起作用.我似乎在 Google 上找不到任何与 TeamCity 中的 MSTest 构建步骤相关的文档.

                  But that doesn't work. I can't seem to find any documentation on google related to the MSTest build step in TeamCity.

                  更新好吧,我是个白痴.好吧,这可能有点苛刻,但是测试程序集的程序集名称中缺少一个s".不过,如果能在构建日志中得到这样的效果,那就太好了.

                  UPDATE Ok, I am an idiot. Well that might be a little harsh, but the test assembly was missing an "s" from the assembly name. Would have been nice to get something to that effect in the build log though.

                  推荐答案

                  首先,确保您要测试的程序集存在于该位置.

                  Firstly, Ensure the assembly you are trying to test exists at that location.

                  您的相对路径:项目Metadude..TestsinDebugMetadude..Test.dll

                  your relative path: ProjectsMetadude..TestsinDebugMetadude..Test.dll

                  但是,如果您的文件不存在,我希望 TC 会记录一些内容.看起来它正在运行的 MSTest 没有任何参数.

                  However I would expect something logged by TC if your file didnt exist. It looks like its running MSTest without any arguments somehow.

                  如果您确定路径正确,请尝试在不指定 .testsettings 文件的情况下进行尝试,看看会发生什么.我在没有这个的情况下在 TC 中成功使用了 MSTest(但你可能需要它).我正在做的另一件事是我指定 MSTest.exe 的完整路径,即

                  If you are sure the path is correct try it without specifying the .testsettings file to see what happens. I'm using MSTest succesfully in TC without this (but you may need it). The other thing I'm doing different is I specify the FULL path to MSTest.exe, ie

                  C:Program FilesMicrosoft Visual Studio 10.0Common7IDEMSTest.exe

                  C:Program FilesMicrosoft Visual Studio 10.0Common7IDEMSTest.exe

                  而不是他们的变量'%system.MSTest.10.0%'

                  我不记得为什么我这样做了,但会有一个很好的理由(比如使用他们的变量时它不起作用)

                  I can't recall why I did this but there would have been a good reason (like it didnt work when using their variable)

                  这篇关于如何让 TeamCity 使用 MSTest 运行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Release 中部署 PDB 文件 下一篇:Visual Studio (.sln) 生成运行程序和 MSBuild 之间的差异

                  相关文章

                  1. <i id='f3CAA'><tr id='f3CAA'><dt id='f3CAA'><q id='f3CAA'><span id='f3CAA'><b id='f3CAA'><form id='f3CAA'><ins id='f3CAA'></ins><ul id='f3CAA'></ul><sub id='f3CAA'></sub></form><legend id='f3CAA'></legend><bdo id='f3CAA'><pre id='f3CAA'><center id='f3CAA'></center></pre></bdo></b><th id='f3CAA'></th></span></q></dt></tr></i><div id='f3CAA'><tfoot id='f3CAA'></tfoot><dl id='f3CAA'><fieldset id='f3CAA'></fieldset></dl></div>

                    <small id='f3CAA'></small><noframes id='f3CAA'>

                      <bdo id='f3CAA'></bdo><ul id='f3CAA'></ul>
                    <tfoot id='f3CAA'></tfoot>

                      <legend id='f3CAA'><style id='f3CAA'><dir id='f3CAA'><q id='f3CAA'></q></dir></style></legend>