Can you have automated regression/integration test

2019-03-17 00:52发布

问题:

Can you have automated regression/integration tests for Azure Logic Apps?

And if you can, how? ... especially in the context of CI/CD builds and deployments

... and if you can't, why not!!

回答1:

There isn't any out-of-the-box tooling yet to provide automated testing of Azure Logic Apps. We have a few customers who have followed one of the following patterns. There is also this article that goes into detail on how to create a Logic App deployment template:

  1. After deployment (using a release management tool like Visual Studio Release Management), a series of unit tests are run (writtin in something like C#) to test the Logic App.

Since a logic app could have any kind of trigger (on queue item, on HTTP request), the code usually performs the action and asserts the result.

  1. A logic app in the resource group that can run a series of basic tests in a workflow. This one requires a bit more chewing on, but idea being you have a workflow that makes use of connectors or "calling nested apps" to perform basic validation tests (ensure connections are active, etc.)

It's something we have had discussions on from time-to-time, but would love to know if you have any thoughts on what types of tooling/configuration you'd want to configure for an app (remember that some apps "trigger" on something like a message in a queue or a file in FTP).



回答2:


I would like to share one of the approach for LogicApp testing that my team has followed.
First level of validation is the ARM template deployment status (ProvisioningState) which should not have any errors.
After that we have developed test automation using the logic app sdk which does the following

  1. Get auth token.
  2. Execute a specific logic app trigger with a synthetic transaction.
  3. Waits till the execution is completed.
  4. Gets logic app & its action status (succeed, failed or skipped), validates it as per the expected scenario.
  5. Gets the outputs from each action execution, validates them against an expected scenario.
  6. Repeat above steps for all the various cases that logic app might go through.
  7. Hook this all-in CI/CD :)

Deployed an LA, ran a synthetic transaction & validated the results. Hope this helps.