Edited: as #Diego Malanij pointed out in answer
https://stackoverflow.com/a/74768591/4489263 it's the MSTest.TestAdapter 3.0.0 package causing the following observed misbehavior, whereas MSTest.TestFramework 3.0.0 works well
After updating NuGet packages in a .Net 4.8 solution, MS UnitTests just reproducibly stopped working here in Visual Studio 2022 "Community Edition" on Windows 10 without having changed anything in the custom solution itself.
The same update(s) work well in a .Net6.0 solution
UnitTests
Updates:
MSTest.TestFramework.2.2.10 -> MSTest.TestFramework.3.0.0
MSTest.TestAdapter.2.2.10 -> MSTest.TestAdapter.3.0.0
The Output window in the .Net4.8 solution shows exceptions, and the Test Explorer says:
UnitTests
Tests in group: 134
Outcomes
134 Not Run
Output Window :
========== Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 127 ms ==========
Log level is set to Informational (Default).
Source code repository not available. Some features may not work as expected.
Connected to test environment '< Local Windows Environment >'
Test data store opened in 0,139 sec.
========== Starting test discovery ==========
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager.Data\bin\Debug\RingManager.Data.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager\bin\Debug\RingManager.exe. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager.CommonViews\bin\Debug\RingManager.CommonViews.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager.Common\bin\Debug\RingManager.Common.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
========== Test discovery finished: 134 Tests found in 3 sec ==========
========== Starting test run ==========
========== Test run finished: 134 Tests (134 Passed, 0 Failed, 0 Skipped) run in 16,7 sec ==========
Starting test discovery for requested test run
========== Starting test discovery ==========
========== Test discovery finished: 134 Tests found in 1,7 sec ==========
========== Starting test run ==========
An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Stack trace:
at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.TestDeployment.GetDeploymentInformation(String source)
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.ExecuteTestsInSource(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle, String source, Boolean isDeploymentDone) at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.ExecuteTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle, Boolean isDeploymentDone)
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.RunTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle, TestRunCancellationToken runCancellationToken) at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.MSTestExecutor.RunTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithTests.InvokeExecutor(LazyExtension2 executor, Tuple2 executorUri, RunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.<>c__DisplayClass46_0.b__0()
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.<>c__DisplayClass0_0.b__0()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.Run(Action action, PlatformApartmentState apartmentState, Boolean waitForCompletion)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.TryToRunInStaThread(Action action, Boolean waitForCompletion)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable`1 executorUriExtensionMap, Int64 totalTests)
========== Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 127 ms ==========
After reverting the changes via version control system - and restarting VS - all is back to normal.
So I guess I'll wait a little and then might try again with a next NuGet version, and this is more a warning than a question asking for help
I've found the same issue with my solution. Today I was able to dig a bit deeper with fusion log and the problem is that the assembly is being searched in the appbase for the testhost, rather than the location of the unit test output itself (meaning bin\debug or bin\release).
I've taken a look at the MSTest.TestAdapter package itself and its props... it has changed the structure regarding the previous version, and now it contains the Microsoft.VisualStudio.TestPlatform.TestFramework assembly (which is loaded from the packages\MSTest.TestAdapter.3.0.0\build\net462 location), but the extensions are no there.
I tried copying the missing dll in that location and tests execution succeeded, however that's clearly not a solution.
In my case this is with Visual Studio 2019, and I thought 2022 might have this solved but clearly after finding your post, that's not the case; I'll try to go a bit further with the analysis later, but as for now the only option is not updating the MSTest.TestAdapter package (the MSTest.TestFramwork is fine at 3.0.0).
MSTest.TestAdapter.3.0.1 now being available apparently cures the symptom, may have been a temporary bug in its version 3.0.0.
After installing NuGet
Updates:
MSTest.TestFramework.3.0.0 -> MSTest.TestFramework.3.0.1
MSTest.TestAdapter.2.2.10 -> MSTest.TestAdapter.3.0.1
... all seems to be okay again
I have a single module Kotlin project in IntelliJ IDEA with about one hundred lines of code. It loads some files, parses them, makes some calculations and shows result in console. Upon build it correctly executes task :compileKotlin in a few seconds but after building it waits for about 20 seconds before the Gradle process returns. As a consequence, when I make a change and reexecute the application it takes about 20 to 30 seconds from the moment when I click the Run button until the application starts executing.
If I execute the :run task from a command line with IDEA shut down, this IDLE pause happens after the application has finished execution. This keeps this command line unusable for those 20 seconds. This makes me believe that the problem is not with IDEA but with Gradle.
This pause does not happen always, only after some changes on source code. Changing a constant or rebuilding the same files does not usually cause the pause. Changing a property name usually does.
Versions:
IntelliJ IDEA: IntelliJ IDEA 2021.1.2 Build #IU-211.7442.40, built on June 1, 2021
Kotlin: 211-1.5.30-release-408-IJ7442.40
Gradle: 7.2
Gradle output:
Microsoft Windows [Versión 10.0.19042.1165]
(c) Microsoft Corporation. Todos los derechos reservados.
E:\My Folder>gradlew.bat build
BUILD SUCCESSFUL in 4s
6 actionable tasks: 6 executed
<=============> 100% EXECUTING [16s]
> IDLE
Microsoft Windows [Versión 10.0.19042.1165]
(c) Microsoft Corporation. Todos los derechos reservados.
E:\My Folder>gradlew.bat run
> Task :run
***********************************************************************
Console Output of my program
***********************************************************************
BUILD SUCCESSFUL in 11s
2 actionable tasks: 2 executed
<=============> 100% EXECUTING [15s]
> IDLE
Please see that first snippet shows BUILD SUCCESSFUL in 4s but keeps executing EXECUTING [16s], this is it has been pausing IDLE for 12 seconds at the moment I copied the output. Second snippet shows BUILD SUCCESSFUL in 11s (compilation + application execution took 11s) but keeps executing EXECUTING [15s], this is it has been pausing IDLE for 4 seconds after the application had already finished executing at the moment I copied the output.
I am working on a small Golang monorepo and I am using Bazel + gazelle to manage deps along with tests, builds, coverage,...
I am having an issue when it comes to coverage. I have followed a few examples but for some reason the coverage_report.dat file (that then will be processed by genhtml) is always empty.
This is the command that I am running with relative output
$ bazel coverage --combined_report=lcov --cache_test_results=no --test_output=all //...
INFO: Using default value for --instrumentation_filter: "^//service/hello[/:],^//service/hellotwo[/:]".
INFO: Override the above default with --instrumentation_filter
INFO: Analyzed 4 targets (0 packages loaded, 0 targets configured).
INFO: Found 2 targets and 2 test targets...
INFO: From Testing //service/hello:hello_test:
==================== Test output for //service/hello:hello_test:
PASS
coverage: 100.0% of statements
================================================================================
INFO: From Testing //service/hellotwo:hellotwo_test:
==================== Test output for //service/hellotwo:hellotwo_test:
PASS
coverage: 100.0% of statements
================================================================================
INFO: LCOV coverage report is located at /private/var/tmp/_bazel_andrea/292e77b095155ea362773b482c2c4621/execroot/__main__/bazel-out/_coverage/_coverage_report.dat
and execpath is bazel-out/_coverage/_coverage_report.dat
INFO: Elapsed time: 0.217s, Critical Path: 0.09s
INFO: 3 processes: 1 internal, 2 darwin-sandbox.
INFO: Build completed successfully, 3 total actions
//service/hello:hello_test PASSED in 0.1s
/private/var/tmp/_bazel_andrea/292e77b095155ea362773b482c2c4621/execroot/__main__/bazel-out/darwin-fastbuild/testlogs/service/hello/hello_test/coverage.dat
//service/hellotwo:hellotwo_test PASSED in 0.1s
/private/var/tmp/_bazel_andrea/292e77b095155ea362773b482c2c4621/execroot/__main__/bazel-out/darwin-fastbuild/testlogs/service/hellotwo/hellotwo_test/coverage.dat
Executed 2 out of 2 tests: 2 tests pass.
INFO: Build completed successfully, 3 total actions
The coverage is calculated but bazel-out/_coverage/_coverage_report.dat is empty. I was wondering if anyone has had this issue before and managed to find a solution to it.
I am working on a MacBook Pro with Bazel (v4.1.0) installed via Homebrew.
I am using VS2013.
I am trying to run the *.dll from the MSTest, but it fails without any execution.
If I execute the same test case manually, it always pass.
Below is the command line execution lines:
c:>"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest" /testcontainer:"E:\E_Drive\TFS_Work\PlatformSoftware\Embedded\AutomatedRe
gressionTests\Main\bin\Debug\YDOA.dll" /category:"TRLYS1D"
Microsoft (R) Test Execution Command Line Tool Version 12.0.21005.1
Copyright (c) Microsoft Corporation. All rights reserved.
Loading E:\E_Drive\TFS_Work\PlatformSoftware\Embedded\AutomatedRegressionTests\Main\bin\Debug\YDOA.dll...
Starting execution...
Results Top Level Tests
------- ---------------
Failed YDOA.InputOutputFeature.RelayAndRelayFdbkAsUsedNormalAndFALSEAndTRUE_01
Failed YDOA.InputOutputFeature.RelayAsUnusedNormalAndALLRelaysTRUE
0/2 test(s) Passed, 2 Failed
Summary
Test Run Failed.
Failed 2
Total 2
Results file: c:\TestResults\Admin_GE-6QSVBDRLU204 2015-07-08 16_10_38.trx
Test Settings: Default Test Settings
I have the reference "Microsoft.VisualStudio.QualityTools.UnitTestFramework" in my project.
mentioned is my AppConfig.
<specFlow>
<unitTestProvider name="MsTest"/>
<stepAssemblies>
In the SpecFlow - "Test Runner Tool", I have tried with all the options like : AUTO, ReSharper, VS2010MStest, VS2012, SpecRun....still I have the same problem.
I could not able to understand the problem.
Thanks,
Sai
Using NCover Community edition, I tried:
set ncover="C:\Program Files (x86)\NCover\NCover.Console.exe"
set mstest="C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe"
set testdllfolder="C:\.hudson\jobs\Project\workspace\src\TestProject\bin\Debug"
%ncover% //x coverage.xml //w %testdllfolder% %mstest% /noisolation /testcontainer:TestProject.dll
The output begins like this
Working Directory:
Assemblies:
Coverage Xml: C:.hudson\jobs\Project\workspace\src\coverage.xml
Coverage Log: Coverage.Log
Waiting for profiled application to connect...Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1
and after the MSTest output
Test Run Failed.
Passed 8
Failed 2
Inconclusive 2
Total 103
Results file: C:.hudson\jobs\Project\workspace\src\debug.trx
Test Settings: Local
Connected
Profiled process terminated. Profiler connection not established.
How to fix that?
Can you post the console output to your message? That'd tell if the session completed successfully. It could be that the coverage xml isn't showing because it's going to a directory other than the one you think it should. It's default is the current command prompt directory.
Also, you may want to try using the latest edition of NCover, v.3.4.16. You can get a 21-day trial for free at www.ncover.com/download.