1

I'm working on an existing multi project solution with xUnit, dotnet core and netstandard projects but re-sharper tests don't seem to find any tests nor be able to run any independently.

I have to do it with the Visual Studio test explorer.

The error is: Test-case objects missing for the following elements: Foo.Media.Tests.Controllers.media_api_should.allow_to_upload_media_files

The test project is a netcoreapp3.1. and it uses Microsoft.NET.Test.Sdk 16.5.0, xunit 2.41 and xunit.runner.visualstudio 2.41. Using Resharper 2019.3.2 on Visual Studio 2019 16.4.5

Any advice why no tests are found despite rebuild, restarting VS and deleting .vs folder when the VS test explorer has no any issue?

and the logs:

15:42:36.023 |I| CodeCompletionSessionManager  | :1                 | strategies.Count > 0
15:46:42.406 |W| VsMouseClickNavigationDisablerSinceVs10| :1                 | GoToDefMouseHandler is not found among TextView properties.
15:54:12.237 |I| UnitTestLaunch                | :1                 | Host Controller: DebugHostController
15:54:12.242 |I| UnitTestLaunch                | :332               | BuildStage started
15:54:12.242 |I| UnitTestLaunch                | :332               | Build policy: Automatic
15:54:12.308 |I| UnitTestSolutionBuilder       | :1                 | Got request to build 1 projects (BuildPolicy: Automatic)
15:54:14.853 |I| UnitTestLaunch                | :1                 | 10 projects built
15:54:14.853 |I| UnitTestLaunch                | :306               | BuildStage completed
15:54:14.853 |I| UnitTestLaunch                | :306               | RefreshProjectPropertiesStage started
15:54:14.854 |I| UnitTestLaunch                | :307               | RefreshProjectPropertiesStage completed
15:54:14.854 |I| UnitTestLaunch                | :307               | DiscoveryStage started
15:54:14.855 |I| UnitTestLaunch                | :307               | Test exploration required for 1 projects
15:54:14.855 |I| UnitTestLaunch                | :307               | DiscoveryStage completed
15:54:14.855 |I| UnitTestLaunch                | :307               | BuildPipelineStage started
15:54:14.855 |I| UnitTestLaunch                | :307               | BuildPipelineStage completed
15:54:14.855 |I| UnitTestLaunch                | :307               | ApplyRulesStage started
15:54:14.856 |I| UnitTestLaunch                | :307               | Got 1 elements (1 explicit) to run
15:54:14.856 |I| UnitTestLaunch                | :307               | Created 1 unit-test runs
15:54:14.856 |I| UnitTestLaunch                | :307               | ApplyRulesStage completed
15:54:14.856 |I| UnitTestLaunch                | :307               | RunTestsStage started
15:54:14.857 |I| UnitTestLaunch                | :307               | Running up to 1 unit-test runs in parallel
15:54:14.857 |I| UnitTestLaunch                | :249               | Run: 5c8a4200-77ea-4e31-9be5-ec04cf2b2eb1 - Starting
15:54:14.859 |I| UnitTestLaunch                | :97                | [ProcessStartInfoPatchResult]
  Original request: DotNetCoreRequest
  Success: True
  ErrorMessage: <Empty>
  Original StartInfo: FileName = 'vstest', Arguments = '/port:63422  ', WorkDir = 'D:\src\my-project\tests\Foo.Modules\Foo.Media.Tests'
  Patched  StartInfo: FileName = 'dotnet', Arguments = '"vstest" /port:63422  ', WorkDir = 'D:\src\my-project\tests\Foo.Modules\Foo.Media.Tests'

15:54:14.859 |I| XunitDotNetVsTestRunStrategy  | :97                | [ProcessStartInfoPatchResult]
  Original request: DotNetCoreRequest
  Success: True
  ErrorMessage: <Empty>
  Original StartInfo: FileName = 'vstest', Arguments = '/port:63422  ', WorkDir = 'D:\src\my-project\tests\Foo.Modules\Foo.Media.Tests'
  Patched  StartInfo: FileName = 'dotnet', Arguments = '"vstest" /port:63422  ', WorkDir = 'D:\src\my-project\tests\Foo.Modules\Foo.Media.Tests'

15:54:14.859 |I| UnitTestLaunch                | :97                | Starting process: dotnet "vstest" /port:63422  
15:54:14.859 |I| XunitDotNetVsTestRunStrategy  | :97                | Starting process: dotnet "vstest" /port:63422  
15:54:14.862 |I| UnitTestLaunch                | :97                | Started process with pid 13192
15:54:14.862 |I| XunitDotNetVsTestRunStrategy  | :97                | Started process with pid 13192
15:54:15.124 |I| UnitTestSessionTree           | JetPool(S) #6:72   | UnitTestStatusTuple::UnitTestSessionTree.Status: “Own: None Propagated: Unknown | Ignored” -> “Own: None Propagated: Unknown | Pending”
15:54:15.284 |I| JsonBasedUnitTestServer       | :29                | 127.0.0.1:63423 connected
15:54:15.334 |I| JsonBasedRemoteChannel        | :97                | Sending message 'ProtocolVersion'
15:54:15.334 |I| JsonBasedRemoteChannel        | :97                | Sent message 'ProtocolVersion'
15:54:15.339 |W| UnitTestLaunch                | :97                | Test-case objects missing for the following elements:
  Foo.Media.Tests.Controllers.media_api_should.allow_to_upload_media_files
Rebuild the project and try again.
15:54:15.339 |I| JsonBasedRemoteChannel        | :97                | Sending message 'TestSession.Terminate'
15:54:15.339 |I| JsonBasedRemoteChannel        | :97                | Sent message 'TestSession.Terminate'
15:54:15.340 |I| JsonBasedRemoteChannel        | :191               | Can't read a string from the stream (Abort = False)
15:54:15.370 |I| UnitTestLaunch                | :280               | Process dotnet:13192 has exited with code (0)
15:54:15.370 |I| XunitDotNetVsTestRunStrategy  | :280               | Process dotnet:13192 has exited with code (0)
15:54:15.370 |I| UnitTestLaunch                | :280               | Output stream: Microsoft (R) Test Execution Command Line Tool Version 16.3.0
Copyright (c) Microsoft Corporation.  All rights reserved.



15:54:15.370 |I| XunitDotNetVsTestRunStrategy  | :280               | Output stream: Microsoft (R) Test Execution Command Line Tool Version 16.3.0
Copyright (c) Microsoft Corporation.  All rights reserved.



15:54:15.370 |I| UnitTestLaunch                | :97                | Run: 5c8a4200-77ea-4e31-9be5-ec04cf2b2eb1 - Finished
15:54:15.370 |I| UnitTestLaunch                | :40                | RunTestsStage completed
15:54:15.370 |I| UnitTestLaunch                | :40                | FinishLaunchStage started
15:54:15.371 |I| UnitTestLaunch                | :40                | Finishing launch
15:54:15.371 |I| UnitTestLaunch                | :40                | Launch is finished
15:54:15.371 |I| UnitTestLaunch                | :40                | FinishLaunchStage completed
15:54:15.439 |I| UnitTestSessionTree           | JetPool(S) #6:72   | UnitTestStatusTuple::UnitTestSessionTree.Status: “Own: None Propagated: Unknown | Pending” -> “Own: None Propagated: Unknown | Ignored”
diegosasw
  • 13,734
  • 16
  • 95
  • 159
  • may be I have the same issue, but with 2.1 projects. Resharper doest not recognize the xunit-tests – Jehof Mar 19 '20 at 13:36

0 Answers0