Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
In-Memory Integration Testing #1390
I would like to be able to run integration tests using the Azure Function runtime.
I can use a
There are several problems:
It would be great if we had a solution similar to AspNetCore that might look something like:
// arrange var testHost = new TestHost(relativePathToCsproj); // act await testHost.RunFunctionAsync("MyFunction", maxInvocations: 1); // assert...
A few things I would like to see included:
If the tools to do this already exist (within this project or any other), please let me know.
I would start by looking at our own e2e tests. For example we have this test fixture that should get you started.
If you end up building a test harness along the lines of what you outlined above that could be pretty useful in general, you should let us know.
Reopen this if you're still blocked.
referenced this issue
Oct 25, 2017
I don't want to try and craft a solution based on volatile infrastructure, but this is something that is sorely needed, especially when the risk of runtime errors is so high because of Azure/azure-functions-host#992
It looks like JobHost may be the thing I'm looking for in the future?
Can anyone provide me with the current design/direction so I don't do work that boxes me into a corner in future versions? Between this repository and the azure-functions-cli repo, I'm thoroughly confused as to how the runtime actually works.
Spent some time this weekend playing with this during some travel. I shared my project here. As @paulbatum suggested it follows the same patterns used by the azure functions host project. It's a proof of concept but does allow me to execute the Azure Functions Host inside the test suite and not as an external executable. Has some kinks (wasn't able to ever get the breakpoints inside the function to fire when debugging) but should enable you to verify assembly loading as part of a test