mstest

How to read test run settings parameter value in specflow tests?

做~自己de王妃 提交于 2019-12-02 15:51:11
问题 We use .runsettings file in visual studio for running specflow tests. There we have certain parameters configured. I need to access those parameter values at run time to use in specflow test methods. I tried accessing those via TestContext as below [ClassInitialize] public static void Initialize(TestContext testContext) { var value= Convert.ToString(testContext.Properties["testParameter1"]); } I am getting the exception for testcontext instance at run time as below. "System

Long running unit test marked as passed fails TFS build - Object 'xxx.rem' has been disconnected or does not exist at the server.**

一世执手 提交于 2019-12-02 15:37:53
问题 I want to utilize TFS and MSTest for regression testing. I have a few long running unit tests ( 10+ minutes ). The unit tests can be run successfully locally on developer's machine inside VS2017. The unit test were shown as passed on TFS2017. However the build was marked as failed. This problem looks like a timeout to me between the executor and the unit test. Is there a way to increase the timeout setting in TFS? Any other ideas to fix the build? 2017-11-28T14:01:00.8504854Z ##[error]Error:

MStests taking too long to load

孤街醉人 提交于 2019-12-02 12:01:41
I have a project setup to use MSTests but they are simply taking too long to load all the the test DLLs, before even loading my project specific DLLs. I´m on Visual Studio Professional 2015 with Resharper 10.0.1 I´m attaching only part of the the logs down here since stack overflow complaint about limit, but it would be 10 times as bigger, following the same line of these dlls. The total time was around 30s, before my dlls started being loaded, but only a couple of acceptable seconds afterwards. Is there anyway to optimize this? EDIT: Actually, found that some libs are being loaded/unloaded

How to read test run settings parameter value in specflow tests?

我怕爱的太早我们不能终老 提交于 2019-12-02 07:30:16
We use .runsettings file in visual studio for running specflow tests. There we have certain parameters configured. I need to access those parameter values at run time to use in specflow test methods. I tried accessing those via TestContext as below [ClassInitialize] public static void Initialize(TestContext testContext) { var value= Convert.ToString(testContext.Properties["testParameter1"]); } I am getting the exception for testcontext instance at run time as below. "System.NullReferenceException: 'Object reference not set to an instance of an object.'" Environment Visual Studio Enterprise

How do I make a data file available to unit tests?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 05:09:31
问题 I'm using VS2008 TFS (with MSTest). I have a unit test that works reliably, relying on a data file in a subfolder of the project (ie testproject1\TestData). The data file properties are Build Action=Content, Copy Always. (It is not a test datafile as such, but a file that the production code reads and normally expects in its own folder) When the test is built and executes, the data file is correctly copied to the ...\TestResults\(testruniD)\Out folder, and the tested code finds it. Now, I

Long running unit test marked as passed fails TFS build - Object 'xxx.rem' has been disconnected or does not exist at the server.**

自闭症网瘾萝莉.ら 提交于 2019-12-02 03:59:27
I want to utilize TFS and MSTest for regression testing. I have a few long running unit tests ( 10+ minutes ). The unit tests can be run successfully locally on developer's machine inside VS2017. The unit test were shown as passed on TFS2017. However the build was marked as failed. This problem looks like a timeout to me between the executor and the unit test. Is there a way to increase the timeout setting in TFS? Any other ideas to fix the build? 2017-11-28T14:01:00.8504854Z ##[error]Error: An exception occurred while invoking executor 'executor://mstestadapter/v2': Object '/fe158daa_975c

Unable to run mstest in parallel in Visual Studio Update1

允我心安 提交于 2019-12-02 03:27:20
问题 I am developing a MSTest framework based unit test project. The issue I have is I am not able to run the test in parallel and it is running sequentially. I have added the below line in my testsettings file. <?xml version="1.0" encoding="utf-8"?> <RunSettings> <RunConfiguration> <MaxCpuCount>0</MaxCpuCount> </RunConfiguration> </RunSettings> and when I run the command vstest.console.exe C:\Git\Test.dll /TestCaseFilter:"TestCategory=Flow1|TestCategory=Flow2|TestCategory=Flow3" /settings:C:\Git

Code Coverage Results periodically gives: Empty results generated

跟風遠走 提交于 2019-12-02 01:45:36
问题 I've run into a recurring problem with a few different projects using MSTest in VS2012, where every now and then my code coverage stops working (seemingly at random) and instead gives me: Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see http://go.microsoft.com/fwlink/?LinkID=253731 I've checked the obvious (what it's suggested) but

Unable to run mstest in parallel in Visual Studio Update1

↘锁芯ラ 提交于 2019-12-02 01:39:12
I am developing a MSTest framework based unit test project. The issue I have is I am not able to run the test in parallel and it is running sequentially. I have added the below line in my testsettings file. <?xml version="1.0" encoding="utf-8"?> <RunSettings> <RunConfiguration> <MaxCpuCount>0</MaxCpuCount> </RunConfiguration> </RunSettings> and when I run the command vstest.console.exe C:\Git\Test.dll /TestCaseFilter:"TestCategory=Flow1|TestCategory=Flow2|TestCategory=Flow3" /settings:C:\Git\UIRunSettings.runsettings the test are running one by one and not in parallel. Any thoughts would be

DirectoryInfo.Exists always returns false during MSTest

こ雲淡風輕ζ 提交于 2019-12-02 00:48:15
问题 I have a little bit of logic at the boundary of my app dealing with creating directories. I would like to test that it actually creates directories as expected, but the DirectoryInfo.Exists property always returns false even when the directory actually exists. See also this question - you need to set a breakpoint to see that the directory has actually been created because MSTest will delete it when the test ends. Is there some setting that tells MSTest to allow "normal" filesystem IO during