Azure / Azure/LogicAppsUX

Unit test created by designer for "Publish to Queue" action immediately fails

Open
#8,405 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
111
Forks
109
Avg merge
1d 23h
Merged PRs (30d)
20

Description

### Severity

P3 - Medium (Minor functionality affected)

### Describe the Bug with repro steps

**Expected**

That creating the unit tests through the UI should create something valid and expected by the system

**Actual**

The classes created by the designer cause a failure when running the workflow in the test executor.

In the unit test, the 'Publish_to_Queue' mock action with 'ServiceProvider' type has an 'outputs' field with unexpected properties: 'content,messageId,insertedOn,expiresOn,popReceipt,nextVisibleOn'.

**Workaround?**

When I look at the outputs from an actual run in the portal it looks as though they are

```
{
"statusCode": "OK",
"body": null
}
```
If I change the class to just have these properties

```
public HttpStatusCode StatusCode { get; set; }

public JObject Body { get; set; }
```

then the error goes away

### 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

```json
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"actions": {
"Publish_to_Queue": {
"type": "ServiceProvider",
"inputs": {
"parameters": {
"queueName": "@appsetting('QueueName')",
"message": "{\"contentData\":\"\",\"contentType\":\"application/json\"}"
},
"serviceProviderConfiguration": {
"connectionName": "azureQueues",
"operationId": "putMessage",
"serviceProviderId": "/serviceProviders/azureQueues"
}
},
"runAfter": {}
},
"Response": {
"type": "Response",
"kind": "Http",
"inputs": {
"statusCode": 200,
"body": "Completed"
},
"runAfter": {
"Publish_to_Queue": [
"SUCCEEDED"
]
}
}
},
"outputs": {},
"triggers": {
"When_an_HTTP_request_is_received": {
"type": "Request",
"kind": "Http"
}
}
},
"kind": "Stateful"
}
```

### Screenshots or Videos

_No response_

### Environment

Logic Apps standard extension 5.185.9
VS Code Version: 1.105.1

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the designer-generated unit-test class for the Publish_to_Queue ServiceProvider action and compare its outputs with the supplied workflow JSON and the test executor's expected output. Reproduce the failure using the stated Logic Apps Standard and VS Code versions. Done means the generated mock has an accepted output shape and the unit test runs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, typescript
Domain
testing-qa, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.