我对此非常恼火。\ TestResults和测试部署混乱。 现在我试图彻底关闭它,但没有任何工作。 从这里开始 :
考虑直接在构建输出目录中运行你的单元测试,以便测试运行更快。 在签入测试后,这在构建服务器上特别有用。 为此,请向您的解决方案添加.runsettings文件,包括False,然后在Test,Test Settings菜单中选择该文件。 在根本不使用DeploymentItemAttribute的任何测试运行中都会出现相同的效果。 但是,如果您使用的是.testsettings文件(Web和加载测试,编码的UI测试以及将应用程序部署到远程计算机的任何测试)所需的文件,则无法避免使用部署文件夹。
我试图创建一个空的解决方案,只有C#单元测试项目包含单个单元测试文件,其中包含单行: string text = File.ReadAllText("test.txt"); 并猜测它在哪里查找这个文件? C:\ Code \ TestDeployment \ TestResults \ iLonely_ILONELY-PC 2013-02-17 13_33_37 \ Out \ test.txt
我试图添加test.runsettings文件到解决方案,如下所述:
<!-- MSTest adapter --> <MSTest> <MapInconclusiveToFailed>True</MapInconclusiveToFailed> <CaptureTraceOutput>false</CaptureTraceOutput> <DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete> <DeploymentEnabled>False</DeploymentEnabled> </MSTest>我通过测试 - >测试设置 - >选择测试设置文件选择它,运行测试...并且结果是相同的。
任何人都可以解释我如何从Output \ bin {Configuration}文件夹运行测试吗?
重要提示:我没有.testsettings文件,我没有使用DeploymentItem属性 。
I'm seriously annoyed with this .\TestResults and test deployment mess. Now I'm trying to completely turn it off, but nothing works. From here:
Consider running your unit tests directly in the build output directory, so that testing runs more rapidly. This is especially useful on the build server after you have checked in your tests. To do this, add a .runsettings file to your solution, include False, and select the file in the Test, Test Settings menu. The same effect occurs in any test run in which DeploymentItemAttribute is not used at all. However, you cannot avoid using a deployment folder if you are using a .testsettings file, which is required for web and load tests, coded UI tests, and any test in which you deploy an application to remote machines.
I tried to create an empty solution with only C# Unit Test project that contains single unit test file with single line in it: string text = File.ReadAllText("test.txt"); And guess where it looks up this file? C:\Code\TestDeployment\TestResults\iLonely_ILONELY-PC 2013-02-17 13_33_37\Out\test.txt
I tried to add test.runsettings file to the solution, as described here:
<!-- MSTest adapter --> <MSTest> <MapInconclusiveToFailed>True</MapInconclusiveToFailed> <CaptureTraceOutput>false</CaptureTraceOutput> <DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete> <DeploymentEnabled>False</DeploymentEnabled> </MSTest>I selected it through Test -> Test settings -> Select test settings file, ran tests... And the result was the same.
Can anyone explain me how to run tests from Output\bin{Configuration} folder?
IMPORTANT: I don't have a .testsettings file, I don't use DeploymentItem attribute.
最满意答案
关于如何控制ReSharper测试运行器的MSTest部署的后续问题,我只是遇到了同样的问题并解决了它。
默认情况下,它不起作用,但您可以根据这些指示将ReSharper指向您的.testsettings文件来使其工作。
I figured out that this is a ReSharper issue. When I run test by VS runner, everything works fine, it runs from Output\bin{Configuration}. When I run test by ReSharper runner, it runs from deployment dir no matter what I do. Now, the question is: how to control MSTest deployment for ReSharper test runner?
如何关闭VS2012中的测试部署(How to turn off test deployment in VS2012)我对此非常恼火。\ TestResults和测试部署混乱。 现在我试图彻底关闭它,但没有任何工作。 从这里开始 :
考虑直接在构建输出目录中运行你的单元测试,以便测试运行更快。 在签入测试后,这在构建服务器上特别有用。 为此,请向您的解决方案添加.runsettings文件,包括False,然后在Test,Test Settings菜单中选择该文件。 在根本不使用DeploymentItemAttribute的任何测试运行中都会出现相同的效果。 但是,如果您使用的是.testsettings文件(Web和加载测试,编码的UI测试以及将应用程序部署到远程计算机的任何测试)所需的文件,则无法避免使用部署文件夹。
我试图创建一个空的解决方案,只有C#单元测试项目包含单个单元测试文件,其中包含单行: string text = File.ReadAllText("test.txt"); 并猜测它在哪里查找这个文件? C:\ Code \ TestDeployment \ TestResults \ iLonely_ILONELY-PC 2013-02-17 13_33_37 \ Out \ test.txt
我试图添加test.runsettings文件到解决方案,如下所述:
<!-- MSTest adapter --> <MSTest> <MapInconclusiveToFailed>True</MapInconclusiveToFailed> <CaptureTraceOutput>false</CaptureTraceOutput> <DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete> <DeploymentEnabled>False</DeploymentEnabled> </MSTest>我通过测试 - >测试设置 - >选择测试设置文件选择它,运行测试...并且结果是相同的。
任何人都可以解释我如何从Output \ bin {Configuration}文件夹运行测试吗?
重要提示:我没有.testsettings文件,我没有使用DeploymentItem属性 。
I'm seriously annoyed with this .\TestResults and test deployment mess. Now I'm trying to completely turn it off, but nothing works. From here:
Consider running your unit tests directly in the build output directory, so that testing runs more rapidly. This is especially useful on the build server after you have checked in your tests. To do this, add a .runsettings file to your solution, include False, and select the file in the Test, Test Settings menu. The same effect occurs in any test run in which DeploymentItemAttribute is not used at all. However, you cannot avoid using a deployment folder if you are using a .testsettings file, which is required for web and load tests, coded UI tests, and any test in which you deploy an application to remote machines.
I tried to create an empty solution with only C# Unit Test project that contains single unit test file with single line in it: string text = File.ReadAllText("test.txt"); And guess where it looks up this file? C:\Code\TestDeployment\TestResults\iLonely_ILONELY-PC 2013-02-17 13_33_37\Out\test.txt
I tried to add test.runsettings file to the solution, as described here:
<!-- MSTest adapter --> <MSTest> <MapInconclusiveToFailed>True</MapInconclusiveToFailed> <CaptureTraceOutput>false</CaptureTraceOutput> <DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete> <DeploymentEnabled>False</DeploymentEnabled> </MSTest>I selected it through Test -> Test settings -> Select test settings file, ran tests... And the result was the same.
Can anyone explain me how to run tests from Output\bin{Configuration} folder?
IMPORTANT: I don't have a .testsettings file, I don't use DeploymentItem attribute.
最满意答案
关于如何控制ReSharper测试运行器的MSTest部署的后续问题,我只是遇到了同样的问题并解决了它。
默认情况下,它不起作用,但您可以根据这些指示将ReSharper指向您的.testsettings文件来使其工作。
I figured out that this is a ReSharper issue. When I run test by VS runner, everything works fine, it runs from Output\bin{Configuration}. When I run test by ReSharper runner, it runs from deployment dir no matter what I do. Now, the question is: how to control MSTest deployment for ReSharper test runner?
发布评论