Reputation: 1330
I've got a bunch of unit tests that was written in VS 2015. The same tests worked when upgrading to 2017. Then I had a system breakdown after a VS 2017 update, and I then reinstalled the system and a fresh VS 2017 15.7.1.
The Unit Tests are basic MSTests, some simple tests just calling some classes in a class library that gets data from some excel files. And some more complex, running Selenium Webdriver and doing this and that.
Now, in VS 2017 15.7.1, none of the tests work anymore. That is, they're not running at all. When running them, the progress bar in the Test Explorer shows the moving green as normal, then it just goes back to white, and the test is still shown as not run.
The Output, when setting the logging level to Diagnostic, is this:
[14.05.18 15:12:50 Diagnostic] About to Enqueue operation 'RunSelectedOperation', hashcode:21607723
[14.05.18 15:12:50 Diagnostic] Enqueue operation 'RunSelectedOperation', hashcode:21607723
[14.05.18 15:12:50 Diagnostic] Operation left in the the queue: 1
[14.05.18 15:12:50 Diagnostic] 'RunSelectedOperation', hashcode:21607723
[14.05.18 15:12:50 Diagnostic]
[14.05.18 15:12:50 Diagnostic] Processing Queue .....
[14.05.18 15:12:50 Diagnostic] Operation Dequeue : 'RunSelectedOperation'
[14.05.18 15:12:50 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=OperationSetStarted, operationInProgress=False
[14.05.18 15:12:50 Diagnostic] TestDiscoveryStats.OperationStateChanged State=OperationSetStarted, InProgress=False
[14.05.18 15:12:50 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=ChangeDetectionStarting, operationInProgress=True
[14.05.18 15:12:50 Diagnostic] TestDiscoveryStats.OperationStateChanged State=ChangeDetectionStarting, InProgress=False
[14.05.18 15:12:50 Diagnostic] We programmatically start the build in TestWindowHost.UpdateContainer...
[14.05.18 15:12:50 Diagnostic] After we await the build that programmatically started in TestWindowHost.UpdateContainer...
[14.05.18 15:12:50 Diagnostic] TestContainer update (build) complete : 266 ms
[14.05.18 15:12:50 Diagnostic] Adding the Project in Project Map for Guid 098d9992-63a7-41c5-b5b3-6ce5e783f868
[14.05.18 15:12:50 Diagnostic] Time taken for fetching Roslyn supported projects: 0 milliseconds.
[14.05.18 15:12:50 Diagnostic] Adding the Project in Project Map for Guid 1e96f94e-161d-41eb-8546-edd8cd13aff4
[14.05.18 15:12:50 Diagnostic] Adding the Project in Project Map for Guid 3a39b466-3d4f-4a0c-b110-f045d0975713
[14.05.18 15:12:50 Diagnostic] Adding the Project in Project Map for Guid 69c4cbe6-5541-45ac-8d23-852bce725f99
[14.05.18 15:12:50 Diagnostic] Adding the Project in Project Map for Guid 1b84143e-3826-4937-8073-0d2a9b89982a
[14.05.18 15:12:50 Diagnostic] Adding the Project in Project Map for Guid e30be865-289f-4f78-8d26-9fd1802cf87b
[14.05.18 15:12:51 Diagnostic] Adding the Project in Project Map for Guid 79f803ca-528e-419f-92e8-d9df4c5624d0
[14.05.18 15:12:51 Diagnostic] Adding the Project in Project Map for Guid fe6a60de-81f3-4f58-bb72-47956957e916
[14.05.18 15:12:51 Diagnostic] Adding the Project in Project Map for Guid 36f10149-4d39-47f5-924f-726b36f30b83
[14.05.18 15:12:51 Diagnostic] test container discoverer executor://vsprojectoutputcontainerdiscoverer/v1, discovered 8 containers
[14.05.18 15:12:51 Diagnostic] Containers from 'Microsoft.VisualStudio.TestWindow.VsAdapters.VsProjectOutputContainerDiscoverer' :
[14.05.18 15:12:51 Diagnostic] C:\Source\Workspaces\QA\Opus3TestAutomation\Authentication\bin\Debug\Authentication.dll:executor://vsprojectoutputcontainerdiscoverer/v1
[14.05.18 15:12:51 Diagnostic] C:\Source\Workspaces\QA\Opus3TestAutomation\Common\bin\Debug\Common.dll:executor://vsprojectoutputcontainerdiscoverer/v1
[14.05.18 15:12:51 Diagnostic] C:\Source\Workspaces\QA\Opus3TestAutomation\FlowTests\bin\Debug\FlowTests.dll:executor://vsprojectoutputcontainerdiscoverer/v1
[14.05.18 15:12:51 Diagnostic] C:\Source\Workspaces\QA\Opus3TestAutomation\Opus3TestAutomation\bin\Debug\Opus3TestAutomation.dll:executor://vsprojectoutputcontainerdiscoverer/v1
[14.05.18 15:12:51 Diagnostic] C:\Source\Workspaces\QA\Opus3TestAutomation\OpusAutomation\bin\Debug\OpusAutomation.dll:executor://vsprojectoutputcontainerdiscoverer/v1
[14.05.18 15:12:51 Diagnostic] C:\Source\Workspaces\QA\Opus3TestAutomation\OpusResources\bin\Debug\OpusResources.dll:executor://vsprojectoutputcontainerdiscoverer/v1
[14.05.18 15:12:51 Diagnostic] C:\Source\Workspaces\QA\Opus3TestAutomation\OpusTests\bin\Debug\OpusTests.dll:executor://vsprojectoutputcontainerdiscoverer/v1
[14.05.18 15:12:51 Diagnostic] C:\Source\Workspaces\QA\Opus3TestAutomation\TestData\bin\Debug\TestData.dll:executor://vsprojectoutputcontainerdiscoverer/v1
[14.05.18 15:12:51 Diagnostic] test container discoverer executor://testexplorerservicecontainerdiscoverer/v1, discovered 0 containers
[14.05.18 15:12:51 Diagnostic] No containers found from 'Microsoft.VisualStudio.TestWindow.Extensibility.TestExplorerServiceContainerDiscoverer' :
[14.05.18 15:12:51 Diagnostic] test container discoverer executor://cpsprojectoutputtestcontainerdiscoverer/v2, discovered 0 containers
[14.05.18 15:12:51 Diagnostic] No containers found from 'Microsoft.VisualStudio.TestWindow.Extensions.CPSTestContainerDiscoverer' :
[14.05.18 15:12:51 Diagnostic] test container discoverer executor://powershelltestexecutor/v1, discovered 0 containers
[14.05.18 15:12:51 Diagnostic] No containers found from 'PowerShellTools.TestAdapter.PowerShellTestContainerDiscoverer' :
[14.05.18 15:12:51 Diagnostic] test container discoverer executor://orderedtestadapter/v1, discovered 0 containers
[14.05.18 15:12:51 Diagnostic] No containers found from 'Microsoft.VisualStudio.MSTest.TestWindow.OrderedTestContainerDiscoverer' :
[14.05.18 15:12:51 Diagnostic] test container discoverer executor://generictestadapter/v1, discovered 0 containers
[14.05.18 15:12:51 Diagnostic] No containers found from 'Microsoft.VisualStudio.MSTest.TestWindow.GenericTestContainerDiscoverer' :
[14.05.18 15:12:51 Diagnostic] test container discoverer executor://webtestadapter/v1, discovered 0 containers
[14.05.18 15:12:51 Diagnostic] No containers found from 'Microsoft.VisualStudio.MSTest.TestWindow.WebTestContainerDiscoverer' :
[14.05.18 15:12:51 Diagnostic] DiscoveryOperation<RunSelectedOperation> FinishedChangedCotainers, changed container count is 0
[14.05.18 15:12:51 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=ChangeDetectionFinished, operationInProgress=False
[14.05.18 15:12:51 Diagnostic] TestDiscoveryStats.OperationStateChanged State=ChangeDetectionFinished, InProgress=False
[14.05.18 15:12:51 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=TestExecutionStarting, operationInProgress=False
[14.05.18 15:12:51 Diagnostic] TestDiscoveryStats.OperationStateChanged State=TestExecutionStarting, InProgress=False
[14.05.18 15:12:51 Informational] ------ Run test started ------
[14.05.18 15:12:51 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=TestExecutionStarted, operationInProgress=False
[14.05.18 15:12:51 Diagnostic] TestDiscoveryStats.OperationStateChanged State=TestExecutionStarted, InProgress=False
[14.05.18 15:12:51 Diagnostic] RunSettings Content:
<RunSettings>
<RunConfiguration>
<TargetFrameworkVersion>Framework45</TargetFrameworkVersion>
<ResultsDirectory>C:\Source\Workspaces\QA\
Opus3TestAutomation\TestResults</ResultsDirectory>
<SolutionDirectory>C:\Source\Workspaces\QA\Opus3TestAutomation\
</SolutionDirectory>
<TargetPlatform>X86</TargetPlatform>
</RunConfiguration>
<MSTest>
<SettingsFile>C:\Source\Workspaces\QA\Opus3TestAutomation\
Opus3TestAutomation.testsettings</SettingsFile>
<ForcedLegacyMode>true</ForcedLegacyMode>
<IgnoreTestImpact>true</IgnoreTestImpact>
</MSTest>
</RunSettings>
[14.05.18 15:12:51 Diagnostic] Final RunSettings for the current TestRunCriteria:
<RunSettings>
<RunConfiguration>
<TargetFrameworkVersion>Framework45</TargetFrameworkVersion>
<ResultsDirectory>C:\Source\Workspaces\QA\
Opus3TestAutomation\TestResults</ResultsDirectory>
<SolutionDirectory>C:\Source\Workspaces\QA\Opus3TestAutomation\
</SolutionDirectory>
<TargetPlatform>X86</TargetPlatform>
<CollectSourceInformation>False</CollectSourceInformation>
</RunConfiguration>
<MSTest>
<SettingsFile>C:\Source\Workspaces\QA\
Opus3TestAutomation\Opus3TestAutomation.testsettings</SettingsFile>
<ForcedLegacyMode>true</ForcedLegacyMode>
<IgnoreTestImpact>true</IgnoreTestImpact>
</MSTest>
</RunSettings>
[14.05.18 15:12:53 Warning] Warning : A testsettings file or a runsettings with a ForcedLegacyMode set to true is not supported with the MSTest V2 Adapter.
[14.05.18 15:12:53 Warning] No test is available in C:\Source\Workspaces\QA\Opus3TestAutomation\FlowTests\bin\Debug\FlowTests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
[14.05.18 15:12:53 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=OperationSetFinished, operationInProgress=False
[14.05.18 15:12:53 Diagnostic] TestDiscoveryStats.OperationStateChanged State=OperationSetFinished, InProgress=False
[14.05.18 15:12:53 Diagnostic] *** Run finished using 'InMemoryUnitTestWriter' ***
[14.05.18 15:12:53 Informational] ========== Run test finished: 0 run (0:00:02,1963655) ==========
[14.05.18 15:12:53 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=TestExecutionFinished, operationInProgress=False
[14.05.18 15:12:53 Diagnostic] TestDiscoveryStats.OperationStateChanged State=TestExecutionFinished, InProgress=False
Aparently, VS doesn't find any tests, even though the tests are listed in the Test Explorer.
It also seems that this, or similar, is a problem with updates from time to time; I've seen it mentioned for at least VS 2015 and 2017 after an update. I haven't found a sensible solution to it, though. And it's EXTREMELY annoying having to install VS 2015 alongside 2017 just to be able to do something as basic as run my unit tests.
(By the way, does anyone know if MS actually do ANY testing at all before they ship VS updates? It seems that a bug like this (if it is indeed a bug) should be VERY hard not to catch if you have half a qa dept.)
UPDATE:
This has nothing to do with whether or not I'm running tests in Debug or Release.
This line has been suggested as a potential cause:
[15.05.18 09:47:23 Warning] Warning : A testsettings file or a runsettings with a ForcedLegacyMode set to true is not supported with the MSTest V2 Adapter.
However, that's a warning and not an error. Removing it has no effect whatsoever.
Also, the testsettings file in use is completely default/empty, and has no parameters or arguments specified. Also, this file is necessary in the solution if I want to run my tests from the command line, which I have to do since I'm using an Excel sheet to run and record test runs. This problem occurs when running the test in VS Test Explorer, however; I haven't even gotten to running them from the command line yet in the latest VS 2017 update.
Upvotes: 0
Views: 868
Reputation:
I've seen this too, and the following worked for me:
Upvotes: 1