LogicAppUnit / TestingFramework

Unit testing framework for Azure Logic Apps (Standard)
MIT License
26 stars 13 forks source link

Removed outputData that does not appear in func output #36

Closed zzznz27 closed 2 months ago

zzznz27 commented 2 months ago

Overview

Currently the WorkflowTestHost does not start as it is awaiting output containing "Host started". After two minutes it times out and fails.

Fixing #37

Changes

Example Output

Note there is no "Host started" phrase.

 *  Executing task in folder net6.0: %userdata%\.azurelogicapps\dependencies\FuncCoreTools\func host start --verbose 

                  %%%%%%
                 %%%%%%
            @   %%%%%%    @
          @@   %%%%%%      @@
       @@@    %%%%%%%%%%%    @@@
     @@      %%%%%%%%%%        @@
       @@         %%%%       @@
         @@      %%%       @@
           @@    %%      @@
                %%
                %

Azure Functions Core Tools
Core Tools Version:       4.0.5455 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.27.5.21554

Functions:

        Workflow1: serviceBusTrigger

        WorkflowDispatcher: edgeWorkflowRuntimeTrigger

[2024-09-14T10:47:28.843Z] Host lock lease acquired by instance ID '00000000000000000000000060E8719D'.
LogicAppUnit commented 2 months ago

Hi @zzznz27 , thanks for this PR. However, I do not understand the scenario that you are describing, and fixing. If I enable the writing of all of the Function Host logs to the test output (using the writeFunctionRuntimeStartupLogs setting), I see this:

image

Are you saying that this line does not appear in the test logs when you run the tests?

This check is used to ensure that the Function Host is fully started before running the tests. Otherwise the tests can run and then take a while to fail because the Function Host never started properly.

zzznz27 commented 2 months ago

When I first started using the framework, I the fun host would hang and time out after two minutes and it was due to this line not being present in the outputData

I can do more testing today to try understand what's causing it to not be present

Your logs look like they are more verbose so. It's possible I need to enable a setting to increase logging output

mark-abrams commented 2 months ago

Hi @zzznz27 , you can enable the full Function Host logging using the writeFunctionRuntimeStartupLogs setting in the test configuration file. This is described in the wiki here.

zzznz27 commented 2 months ago

I have that enabled but 8 think the actual output of func tools is different

It must be something to do with my func tools

We can close this PR since it seems to be an issue with my setup