-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GMR consumer for ASB that has no implementation so we can test co…
…nsumption in DEV
- Loading branch information
Showing
11 changed files
with
124 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
# Environment file for user defined variables in docker-compose.yml | ||
|
||
# 1. CONFIG_PATH: Path to Config.json file | ||
# Ex: CONFIG_PATH="C:\\Config\\Config.json" | ||
CONFIG_PATH="/home/runner/work/btms-backend/btms-backend/config.json" | ||
|
||
# 2. ACCEPT_EULA: Pass 'Y' to accept license terms for Azure SQL Edge and Azure Service Bus emulator. | ||
# ACCEPT_EULA: Pass 'Y' to accept license terms for Azure SQL Edge and Azure Service Bus emulator. | ||
# Service Bus emulator EULA : https://github.com/Azure/azure-service-bus-emulator-installer/blob/main/EMULATOR_EULA.txt | ||
# SQL Edge EULA : https://go.microsoft.com/fwlink/?linkid=2139274 | ||
ACCEPT_EULA="Y" | ||
|
||
# 3. MSSQL_SA_PASSWORD to be filled by user as per policy : https://learn.microsoft.com/sql/relational-databases/security/strong-passwords?view=sql-server-linux-ver16 | ||
# MSSQL_SA_PASSWORD to be filled by user as per policy : https://learn.microsoft.com/sql/relational-databases/security/strong-passwords?view=sql-server-linux-ver16 | ||
MSSQL_SA_PASSWORD="BTMS@L0c4l" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
- name: Run docker-compose | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: "compose.yml" | ||
compose-file: "compose.yml" | ||
|
||
- name: Start MongoDB | ||
uses: supercharge/[email protected] | ||
|
@@ -35,17 +35,15 @@ jobs: | |
mongodb-replica-set: test-rs | ||
mongodb-port: 29017 | ||
|
||
- name: Test | ||
- name: Test | ||
run: dotnet test --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
|
||
|
||
- name: install dotnet coverage | ||
- name: install dotnet coverage | ||
run: dotnet tool install --global dotnet-coverage | ||
|
||
- name: merge coverage reports | ||
- name: merge coverage reports | ||
run: dotnet-coverage merge *.cobertura.xml --recursive --output merged.cobertura.xml --output-format cobertura | ||
|
||
|
||
- name: Code Coverage Report | ||
uses: irongut/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Btms.Consumers.Extensions; | ||
using Btms.Types.Gvms; | ||
using Microsoft.Extensions.Logging; | ||
using SlimMessageBus; | ||
|
||
namespace Btms.Consumers; | ||
|
||
internal class GmrAsbConsumer(ILogger<GmrAsbConsumer> logger) : IConsumer<Gmr>, IConsumerWithContext | ||
{ | ||
public Task OnHandle(Gmr message, CancellationToken cancellationToken) | ||
{ | ||
try | ||
{ | ||
logger.LogInformation("Consumed {GmrId}, {MessageId}", message.GmrId, Context.GetMessageId()); | ||
} | ||
catch (Exception exception) | ||
{ | ||
logger.LogError(exception, "Errored"); | ||
} | ||
|
||
return Task.CompletedTask; | ||
} | ||
|
||
public IConsumerContext Context { get; set; } = null!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters