Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

Visual Studio fails to run some tests #47

Closed
dougbu opened this issue Oct 19, 2014 · 6 comments
Closed

Visual Studio fails to run some tests #47

dougbu opened this issue Oct 19, 2014 · 6 comments

Comments

@dougbu
Copy link
Member

dougbu commented Oct 19, 2014

"Run All" in the Razor repository does not execute all of the tests. This command leaves 50 to 150 tests in the "Not Run Tests" bucket. An "Unexpected error detected. Check the Tests Output pane for details." message displays in the VS status bar.
Not sure what distinguishes the "Not Tun" tests but hit this consistently (assuming tests show up in Text Explorer at all 😦 ). Repeated "Run All" invocations can be better or worse but never run everything.
The mentioned Output pane shows:

Test adapter sent back a result for an unknown test case. Ignoring result for 'Microsoft.AspNet.Razor.Runtime.TagHelpers.TagHelperExecutionContextTest.Add_MaintainsTagHelpers'.
Test adapter sent back a result for an unknown test case. Ignoring result for 'Microsoft.AspNet.Razor.Runtime.Test.TagHelpers.TagHelperScopeManagerTest.End_ThrowsIfNoScope'.
Test adapter sent back a result for an unknown test case. Ignoring result for 'Microsoft.AspNet.Razor.Runtime.TagHelpers.TagHelperDescriptorResolverTest.TypeResolver_OnlyReturnsValidTagHelpersForAssemblyLookup'.
...

Suspect there should be as many lines in that block as not run tests.
Note selecting the "Not run tests" successfully executes the problematic tests. Haven't seen any errors reported when executing tests from the command line.

@dougbu
Copy link
Member Author

dougbu commented Oct 19, 2014

/cc @rynowak

@FabGeek
Copy link

FabGeek commented Apr 15, 2015

Dougbu,
I know its a old post, but for others benefit we had the same issue for some tests. Closing Visual Studio and re-opening it followed with rebuild and re-running all tests resolved the issue.

@Eilon
Copy link
Member

Eilon commented Jul 8, 2015

This has been fixed.

@Eilon Eilon closed this as completed Jul 8, 2015
@hanslai
Copy link

hanslai commented Nov 12, 2017

Still having the same problem with Visual Studio 2017 Version 15.4.3.

Close and restart Visual Studio and test run fine again.

@aadhoc
Copy link

aadhoc commented Jan 16, 2018

[ Probable answer included below !! ]

Also having problem with Visual Studio 2017 Version 15.4.5.
After Clean/Build, Output window contains:

[1/16/2018 10:03:57 AM Informational] ========== Discover test finished: 34 found (0:00:04.9669993) ==========
[1/16/2018 10:05:24 AM Informational] ------ Run test started ------
[1/16/2018 10:05:25 AM Informational] [xUnit.net 00:00:00.4034143]   Discovering: ApplicationCoreTest
[1/16/2018 10:05:25 AM Informational] [xUnit.net 00:00:00.4828386]   Discovered:  ApplicationCoreTest
[1/16/2018 10:05:25 AM Informational] [xUnit.net 00:00:00.5216601]   Starting:    ApplicationCoreTest
[1/16/2018 10:05:25 AM Informational] [xUnit.net 00:00:00.7406277]   Finished:    ApplicationCoreTest
[1/16/2018 10:05:25 AM Error] Test adapter sent back a result for an unknown test case. Ignoring result for 'ApplicationCoreTest.ClientGroups.Domain.ValidateClientCreationTests.Validates_WhenTheNameIsMissing_ReturnsError'.
[1/16/2018 10:05:25 AM Error] Test adapter sent back a result for an unknown test case. Ignoring result for 'ApplicationCoreTest.ClientGroups.Domain.ValidateClientCreationTests.Validates_WhenTheNameIsValid_ReturnsNoErrors'.

Just noticed that I have these nuget dependencies:
ApplicationCoreTest:
xunit (2.3.0)
xunit.runner.visualstudio (2.2.0)

WebApiTest:
xunit (2.2.0)
xunit.runner.visualstudio (2.2.0)

.... and the project with the xunit (2.2.0) works, while the xunit (2.3.0) doesn't. Also might be a mismatch with the runner (both are 2.2.0). I just changed that failing one to be xunit (2.2.0) and the problem seems to have gone away. Not sure if this is the permanent solution, but it makes sense that it could be.

@StingyJack
Copy link

For the silent skipping of tests, see microsoft/testfx#241 and microsoft/testfx#499

The "Test adapter sent back a result for an unknown test case" (that it executed!), I'll probably log an issue for that later as it shows for every test when I "Run All".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants