Logic app Standard - Unit Testing exception when terminate with custom error code

Aperta
#9,270 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@andrew-eldridge ci sta già lavorando.

Dal 7/8/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

VSCode
Severity

P3 - Medium (Minor functionality affected)

Describe the Bug with repro steps

Unit-testing SDK throws on workflows that Terminate with a custom (non-enum) error code

Summary

UnitTestExecutor.RunWorkflowAsync throws System.ArgumentException: Requested value '<code>' was not found. instead of returning a Failed TestWorkflowRun whenever the workflow run ends with a runError.code (or an action error code) that is not a member of the ErrorResponseCode enum.

Custom Terminate error codes are valid at runtime in Logic Apps Standard (the code field is a free-form string), so this makes it impossible to unit-test any error/Catch path that terminates with a domain-specific code.

Repro

  1. Author a Stateful workflow with a Try/Catch pattern whose Catch terminates the run:

    "Terminate_-_Failed": {
      "type": "Terminate",
      "inputs": {
        "runStatus": "Failed",
        "runError": {
          "code": "@variables('ErrorCode')",
          "message": "@variables('ErrorMessage')"
        }
      }
    }
    
    

where ErrorCode resolves to a custom string, e.g. "PublisherDeliveryFailed_APICallFailed".

  1. Mock the actions so the run reaches Terminate_-_Failed, then:

    var run = await executor.Create().RunWorkflowAsync(testMock: mockData);
    
What type of Logic App Is this happening in?

Standard (VSCode)

Are you experiencing a regression?

No response

Which operating system are you using?

Windows

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

Screenshots or Videos

No response

Environment
  • Package: Microsoft.Azure.Workflows.WebJobs.Tests.Extension 1.0.3 (latest on NuGet)
  • Target framework: net8.0
  • Test framework: MSTest
Additional context
Requested value 'PublisherDeliveryFailed_APICallFailed' was not found.
   at Microsoft.Azure.Workflows.UnitTesting.TestHost.UnitTestEngine.ExecuteWorkflow(FlowPropertiesDefinition workflowDefinition, TriggerMock triggerMock, Dictionary`2 actionMocks, String appDirectory, String connections, String parameters, IDictionary`2 localSettings, String customCodeFunctionFilePath, Int32 timeoutInSeconds)
   at Microsoft.Azure.Workflows.UnitTesting.TestHost.UnitTestEngine.ExecuteWorkflow(FlowPropertiesDefinition workflowDefinition, TriggerMock triggerMock, Dictionary`2 actionMocks, String appDirectory, String connections, String parameters, IDictionary`2 localSettings, String customCodeFunctionFilePath, Int32 timeoutInSeconds)
   at Microsoft.Azure.Workflows.UnitTesting.UnitTestExecutor.RunWorkflowAsync(TestMockDefinition testMock, Int32 timeoutInSeconds)
   at Integration.Erp04.LogicApps.Tests.Failed_Run.RunAndCaptureAsync(String mockName) in C:\Repo\CHC.Integration.ERP\tests\erp04\Integration.Erp04.LogicApps\int22svc01p01-residentmovements-ecase-pub\Failed-Run\Failed-Run.cs:line 100
Lingua principale
TypeScript
Stelle
114
Fork
115
Merge medio
1g 3h
PR unite (30g)
40

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/LogicAppsUX

Tutte le issue di Azure/LogicAppsUX

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.