Closed dgallo-igloo closed 6 months ago
@dgallo-igloo, as you noticed, ...Script.WebHost
is only available in the functions runtime. It is not a package available that can be referenced. This is the exact reason why AuthHelper
is there; to interact with the functions host libraries. As runtime gets updated the library is also updated and loaded by the runtime. We cannot have a hard dependency on a specific version.
If you are in control of your test environment and your runtime version is locked, you might be able to store and reference the dll within the test project and load it.
@dgallo-igloo I will close this issue as the solution would require Functions runtime to be loaded.
@dgallo-igloo, by looking into the functions core tools project I found out they publish the webhost assembly to an Azure Artifacts repo, not NuGet. You can check NuGet.config to check them out. And you can see how I utilized the package for my in-proc test project.
I am trying to setup integration tests in my project to test my functions through the full HTTP pipeline rather than unit testing at the function level and bypassing the pipeline.
When I attempt to setup the test server in my test class, I am getting the following error
The setup of the test server is done like so and this is where the error is being raised within:
Then the test looks like this:
After some research, it seems as though the
Microsoft.Azure.WebJobs.Script.WebHost
assembly is provided by the Azure Functions Runtime. Since, I'm using a TestServer, its not running in the Azure Functions Runtime.Is there an approach to perform tests like this when Darkloop is being used?