Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration test error post upgrade to 4.0.56-beta.4 #135

Open
davidjsteele opened this issue Feb 26, 2020 · 4 comments
Open

Integration test error post upgrade to 4.0.56-beta.4 #135

davidjsteele opened this issue Feb 26, 2020 · 4 comments

Comments

@davidjsteele
Copy link

Hi,

Having trouble running my integration tests after upgrading to latest version of FM and Azure SDK running on .net Core 3.1.

    <PackageReference Include="FluentAssertions" Version="5.10.2" />
    <PackageReference Include="FunctionMonkey.Testing" Version="4.0.56-beta.4" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
    <PackageReference Include="NSubstitute" Version="4.2.1" />
    <PackageReference Include="Xbehave" Version="2.4.1" />
    <PackageReference Include="xunit" Version="2.4.1" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"> 
    <PackageReference Include="FunctionMonkey.Testing" Version="4.0.56-beta.4" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.3" />

App runs fine, just the tests that are broken.

System.ArgumentNullException : Value cannot be null. (Parameter 'provider')
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.AspNetCore.Mvc.ObjectResult.ExecuteResultAsync(ActionContext context)
   at I2BAPI.Application.Framework.Handlers.ApiResponse.ExecuteResultAsync(ActionContext context)

Any insight would be much appreciated.
Thanks

@mmeckes
Copy link

mmeckes commented Mar 16, 2020

I'm getting the same issue with integration tests on 4.0.56-beta.4.

@mmeckes
Copy link

mmeckes commented May 1, 2020

@davidjsteele did you ever find a solution for this? I'm still struggling to get integration tests to run with ExecuteHttpAsync

@davidjsteele
Copy link
Author

@mmeckes if memory serves this was actually down to a problem with discovery of app.config files as part of ioc resolution. If you can provide more info might be able to help

@mmeckes
Copy link

mmeckes commented May 1, 2020

@davidjsteele any help appreciated. I know it's been a while since you raised this issue.
My tests were working fine but something happened when I upgraded to 4.0.56-beta.4. I also updated a bunch of other packages so it could be something else, so I'm spending some time trying to track it down.

<PackageReference Include="FunctionMonkey.Testing" Version="4.0.56-beta.4" />
    <PackageReference Include="JetBrains.DotMemoryUnit" Version="3.1.20200127.214830" />
    <PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
    <PackageReference Include="NSubstitute" Version="4.2.1" />
    <PackageReference Include="Xbehave" Version="2.4.1" />
    <PackageReference Include="xunit" Version="2.4.1" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">

As soon as I call ExecuteHttpAsync I the error below where the provider is not getting injected in correctly. It does feel like there is some config that is off that is stopping it from resolving the dependencies correctly, but I'm struggling to track it down.

System.ArgumentNullException : Value cannot be null. (Parameter 'provider')
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.AspNetCore.Mvc.StatusCodeResult.ExecuteResult(ActionContext context)
   at Microsoft.AspNetCore.Mvc.ActionResult.ExecuteResultAsync(ActionContext context)
   at FunctionMonkey.Testing.Implementation.AspNetRuntime.CreateHttpResponse(ActionContext actionContext, IActionResult actionResult)
   at FunctionMonkey.Testing.AcceptanceTestScaffold.ExecuteHttpAsync[TResult](ICommand`1 command, HttpMethod method)
   at MakeItDonate.Tests.Acceptance.AddCharityShould.<>c__DisplayClass2_0.<<ReceiveBadRequestOnInvalidCharity>b__1>d.MoveNext() in C:\Users\mattm\source\repos\MakeItDonate\MakeItDonate.Tests\Acceptance\AddCharityShould.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
   at Xbehave.Execution.Invoker.<>c__DisplayClass0_1.<<Invoke>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---

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

No branches or pull requests

2 participants