Important disambiguation: Here I am NOT trying to test my Azure Function. Rather, I am investigating the possiblity of using an Azure Function to test my other code.
I am developing an Azure web application in C#. I want to have really good coverage of unit and integration tests (aka end-to-end-tests). We use Jenkins as our main continuous integration tool. We have a suite of tests that runs on each Jenkins push. We have the following conflict of interests:
- We want our mandatory Jenkins test suite to be reasonably fast (a few minutes).
- We want to have automated tests of a number of complex scenarios that can be quite long-running (potentially many minutes).
So I am investigating how to auto-run our long-running tests somewhere other than our regular Jenkins pipeline.
Since we need Azure anyway, I have looked into having an Azure Function run some of our tests. It would run every evening and would need to get the newest code (either take it from GitHub, or our regular Jenkins job could put the code as an artifact somewhere else where the test runner can get it) and run the tests.
Does this seem sane? Can I get any standard test runner (e.g. dotnet test
) to run from an Azure Function? Is that reasonably practical, or does it sound like a bad idea? I am a novice to Azure Functions, so I don't know how difficult this would be.
Alternatives might be:
- A separate Jenkins pipeline.
- GitHub Actions.
- Azure DevOps.
- Azure container apps (which I have not looked into at all).
We are using C#, .NET 5.0+ and ASP.Net Core.
Thanks a lot in advance!