Azure-Samples / azure-functions-tests

Demonstrates how to run automated tests in C# and JavaScript
MIT License
38 stars 23 forks source link

Azure functions integration tests. #1

Open xavierjohn opened 5 years ago

xavierjohn commented 5 years ago

How do we test Azure functions using actual http POST and GET methods? The current sample does not prove the routing has been hooked up correctly.

I want to write integration tests similar to https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-2.2

xavierjohn commented 5 years ago

Maybe sample can be made based on https://blog.kloud.com.au/2018/11/08/integration-testing-precompiled-v2-azure-functions/

p0onage commented 5 years ago

It's not an integration test as it doesn't test the function runs successfully but you can unit test the body of your azure function using my extended test factory. PR here https://github.com/Azure-Samples/azure-functions-tests/pull/2

raschmitt commented 4 years ago

Is it really necessary? Do you want to make sure your code is working or that Azure Functions itself is?

Personally, I've seen some strategies around but I don't think any of them are really worth the cost.