Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Parameter count mismatch in Discovery #29

Open
jackfoxy opened this issue Aug 24, 2017 · 3 comments
Open

Parameter count mismatch in Discovery #29

jackfoxy opened this issue Aug 24, 2017 · 3 comments

Comments

@jackfoxy
Copy link

To reproduce, use my project https://github.com/jackfoxy/PSlogger

Checkout initial commit in master branch. (I will be making more commits, and the initial commit is quite simple, with only one test in one test list.)

Attempting test discovery results in:

[8/24/2017 12:35:06 PM Informational] ------ Discover test started ------
[8/24/2017 12:35:07 PM Error] System.Reflection.TargetParameterCountException: Parameter count mismatch.
   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at [email protected](a focusedState)
   at Microsoft.FSharp.Core.OptionModule.Map[T,TResult](FSharpFunc`2 mapping, FSharpOption`1 option)
   at Expecto.Impl.testFromMember(MemberInfo mi)
   at [email protected](MemberInfo mi)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@165.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at [email protected](Type t)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@165.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at Expecto.Impl.testFromAssemblyWithFilter(FSharpFunc`2 typeFilter, Assembly a)
   at [email protected](Assembly a)
   at Discovery.DiscoverProxy.DiscoverTests(String source)
   at Discovery.DiscoverProxy.DiscoverTests(String source)
   at Discovery.Discoverer.Microsoft-VisualStudio-TestPlatform-ObjectModel-Adapter-ITestDiscoverer-DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
[8/24/2017 12:35:07 PM Informational] ========== Discover test finished: 0 found (0:00:00.7190687) ==========
@alex-bogomaz
Copy link

@jackfoxy - in this file https://github.com/jackfoxy/PSlogger/blob/master/tests/PSlogger.Tests/Tests.fs
you actually have parametrized test list:

[<Tests>]
let testSimpleTests azureConnectionString =
    testList "write and read log record" [
        testCase "equality no optional" <| fun () ->
            let testDate = DateTime.UtcNow.AddDays(-7.)
            let inLog = {log1 with 

Not sure how it is possible to handle such tests in "Test Explorer" window.
Should adapter skip such test lists?

@jackfoxy
Copy link
Author

jackfoxy commented Sep 9, 2017

Perfect! Thanks, @alex-bogomaz
Closing this issue @MNie

@jackfoxy jackfoxy closed this as completed Sep 9, 2017
@jackfoxy jackfoxy reopened this Sep 9, 2017
@jackfoxy
Copy link
Author

jackfoxy commented Sep 9, 2017

@alex-bogomaz @MNie I closed this prematurely.

A better behavior would be to trap this exception, write a message that parameterized lists cannot be handled by the adapter, and continue to process the non-parameterized lists.

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

No branches or pull requests

3 participants