Removed the extra space in expected test result (#689)

* Removed the extra space in expected test result

Signed-off-by: Arash Rohani <Arash.Rohani@gmail.com>

* Changed the output match from exact to substring to fix the issue.

Signed-off-by: Arash Rohani <Arash.Rohani@gmail.com>

* Replaced the logger.LogInformation with Console.WriteLine to fix the test issue.

Signed-off-by: Arash Rohani <Arash.Rohani@gmail.com>

* Fixed the whitespace issue and added sleep directive

Signed-off-by: Arash Rohani <Arash.Rohani@gmail.com>
This commit is contained in:
Arash Rohani 2022-06-09 20:39:00 -07:00 committed by GitHub
parent 24deefe407
commit 426af20d0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View File

@ -167,9 +167,9 @@ dotnet build
name: Run csharp subscriber
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == A: Message on A'
- '== APP == B: Message on B'
- '== APP == C: Message on C'
- '== APP == A: Message on A'
- '== APP == B: Message on B'
- '== APP == C: Message on C'
- "Exited Dapr successfully"
- "Exited App successfully"
expected_stderr_lines:
@ -503,9 +503,12 @@ kubectl logs --selector app=python-subscriber -c python-subscriber
<!-- STEP
name: Deploy Csharp App
expected_stdout_lines:
- "A: Message on A"
- "B: Message on B"
- "C: Message on C"
- "A: Message on A"
- "B: Message on B"
- "C: Message on C"
expected_stderr_lines:
output_match_mode: substring
sleep: 5
-->
```bash

View File

@ -10,17 +10,17 @@ app.UseCloudEvents();
app.MapSubscribeHandler();
app.MapPost("/A", [Topic("pubsub", "A")] (ILogger<Program> logger, MessageEvent item) => {
logger.LogInformation($"{item.MessageType}: {item.Message}");
Console.WriteLine($"{item.MessageType}: {item.Message}");
return Results.Ok();
});
app.MapPost("/B", [Topic("pubsub", "B")] (ILogger<Program> logger, MessageEvent item) => {
logger.LogInformation($"{item.MessageType}: {item.Message}");
Console.WriteLine($"{item.MessageType}: {item.Message}");
return Results.Ok();
});
app.MapPost("/C", [Topic("pubsub", "C")] (ILogger<Program> logger, Dictionary<string, string> item) => {
logger.LogInformation($"{item["messageType"]}: {item["message"]}");
Console.WriteLine($"{item["messageType"]}: {item["message"]}");
return Results.Ok();
});