adamchester / expecto-adapter

Visual Studio test adapter for Expecto (https://github.com/haf/expecto)
MIT License
28 stars 16 forks source link

No test found on test discovery #2

Closed ArtemyB closed 7 years ago

ArtemyB commented 7 years ago

That what I get in Output:

------ Discover test started ------
System.MissingMethodException: Method not found: "Microsoft.FSharp.Core.FSharpFunc`2<Expecto.Test,System.Collections.Generic.IEnumerable`1<System.Tuple`3<System.String,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit>,Expecto.FocusState>>> Expecto.TestModule.get_toTestCodeList()".
   в Discovery.DiscoverProxy.DiscoverTests(String source)
   в Discovery.DiscoverProxy.DiscoverTests(String source)
   в Discovery.Discoverer.Microsoft-VisualStudio-TestPlatform-ObjectModel-Adapter-ITestDiscoverer-DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
========== Discover test finished: 0 found (0:00:00,1572098) ==========

Couldn't figured out by myself how to solve the problem. :c

adamchester commented 7 years ago

Thanks @ArtemyB !

I believe this is due to new versions of Expecto. I will update soon.

adamchester commented 7 years ago

@ArtemyB can you try the latest version please?

mgyongyosi commented 7 years ago

@ArtemyB Sometimes the Visual Studio VSIX Test adapter integration can be tricky. If you are still getting the same exception then close VS and remove the previous Expecto.VisualStudio.TestAdapter folders from %TEMP%\VisualStudioTestExplorerExtensions\.

toburger commented 7 years ago

I'm now getting the following error message:

------ Load Playlist started ------
========== Load Playlist finished (0:00:00,0039991) ==========
------ Discover test started ------
System.InvalidOperationException: Die Sequenz enthält keine Elemente.
   bei System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
   bei <StartupCode$Expecto-VisualStudio-TestAdapter>.$Discovery.DiscoverTests@81-2.Invoke(FlatTest flatTest)
   bei Microsoft.FSharp.Collections.IEnumerator.map@111.DoMoveNext(b& )
   bei Microsoft.FSharp.Collections.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
   bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   bei Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable`1 source)
   bei Microsoft.FSharp.Collections.ArrayModule.OfSeq[T](IEnumerable`1 source)
   bei Discovery.DiscoverProxy.DiscoverTests(String source)
   bei Discovery.Discoverer.Microsoft-VisualStudio-TestPlatform-ObjectModel-Adapter-ITestDiscoverer-DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
========== Discover test finished: 0 found (0:00:00,7852373) ==========

Sorry, for the German error message. It means: "The sequence is empty"

mgyongyosi commented 7 years ago

Do you have any async test? (I could repro the problem with adding testCaseAsync to the test cases. )

I think expecto-adapter does not support async test currently, but I created a new issue for that #4.

toburger commented 7 years ago

Yes indeed, I have async tests. After commenting them out it works. Good catch!

ArtemyB commented 7 years ago

@adamchester I've tested it on the very simple test project and it works. 🎉 However it still doesn't work with the project I'm currently working with. But the errors are different. I'll try briefly describing what the tests are. The project uses C++ graph DB library with .NET bindings (Sparksee to be precise). During the tests a DB (and a file for it) is created. It also requires some not-.NET DLLs to be linked. While running the tests as a console app all is ok, but during the test discovery process the exceptions appears: System.Reflection.TargetInvocationException --> System.TypeInitializationException --> System.IO.IOException. So as I understood it can not create a file for DB. I'm not sure that these explanations suffice, so if you need more details I'll provide it. And thank you for the update. 🙂

ArtemyB commented 7 years ago

@mgyongyosi ok, thank you. I am not getting the same exceptions for now, but the details you've provided could be useful someday. 🙂

adamchester commented 7 years ago

@ArtemyB thanks for the feedback! I'm keen to understand the problem you described in more detail.

Any chance you raise a new issue with instructions on how to reproduce it?