Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/nightlybuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,38 @@ jobs:
- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "TransactionProcessorACL.Tests/TransactionProcessorACL.Tests.csproj" --logger "trx;LogFileName=TransactionProcessorACL.Tests.trx" --results-directory "./TestResults" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov1.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
dotnet test "TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACL.BusinessLogic.Tests.csproj" --logger "trx;LogFileName=TransactionProcessorACL.BusinessLogic.Tests.trx" --results-directory "./TestResults" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov2.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
dotnet test "TransactionProcessorACL.Tests/TransactionProcessorACL.Tests.csproj" --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov1.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov" -- --report-trx
dotnet test "TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACL.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov2.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov" -- --report-trx

- name: Build Docker Image
run: docker build . --file TransactionProcessorACL/Dockerfile --tag transactionprocessoracl:latest

- name: Run Integration Tests
run: dotnet test "TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj" --logger "trx;LogFileName=TransactionProcessorACL.IntegrationTests.trx" --results-directory "./TestResults"
run: dotnet test "TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal --results-directory "${{ github.workspace }}/TestResults" --settings "TransactionProcessorACL.IntegrationTests/Integration.runsettings"

- uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: tracelogs
path: /home/runner/trace/

- name: Publish test results
- name: Publish unit test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Unit Test Results
path: '**/TestResults/*.trx'
reporter: dotnet-trx
fail-on-error: false

- name: Publish integration test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Integration Test Results
path: 'TestResults/TransactionProcessorACL.IntegrationTests.xml'
reporter: dotnet-nunit
fail-on-error: false

- name: Upload test results
uses: actions/upload-artifact@v4
Expand All @@ -74,6 +83,14 @@ jobs:
path: '**/TestResults/*.trx'
retention-days: 30

- name: Upload integration test results
uses: actions/upload-artifact@v4
if: always()
with:
name: integration-test-results
path: 'TestResults/TransactionProcessorACL.IntegrationTests.xml'
retention-days: 30

- name: Notify on nightly failure
if: ${{ failure() }}
uses: TransactionProcessing/org-ci-workflows/.github/actions/nightly-failure-issue@main
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,38 @@ jobs:
- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "TransactionProcessorACL.Tests\TransactionProcessorACL.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=acl-test-results.trx"
dotnet test "TransactionProcessorACL.BusinessLogic.Tests\TransactionProcessorACL.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=bl-test-results.trx"
dotnet test "TransactionProcessorACL.Tests/TransactionProcessorACL.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-trx
dotnet test "TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACL.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-trx

- name: Build Docker Image
run: docker build . --file TransactionProcessorACL/Dockerfile --tag transactionprocessoracl:latest

- name: Run Integration Tests
run: dotnet test "TransactionProcessorACL.IntegrationTests\TransactionProcessorACL.IntegrationTests.csproj" --filter Category=PRTest --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=integration-test-results.trx"
run: dotnet test "TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj" --filter "TestCategory=PRTest" --configuration Release --no-build --verbosity normal --results-directory "${{ github.workspace }}/TestResults" --settings "TransactionProcessorACL.IntegrationTests/Integration.runsettings"

- uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: tracelogs
path: /home/runner/trace/

- name: Publish test results
- name: Publish unit test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Unit Test Results
path: '**/TestResults/*.trx'
reporter: dotnet-trx
fail-on-error: true

- name: Publish integration test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Integration Test Results
path: 'TestResults/TransactionProcessorACL.IntegrationTests.xml'
reporter: dotnet-nunit
fail-on-error: true

- name: Upload test results
uses: actions/upload-artifact@v4
Expand All @@ -56,3 +65,11 @@ jobs:
name: test-results
path: '**/TestResults/*.trx'
retention-days: 30

- name: Upload integration test results
uses: actions/upload-artifact@v4
if: always()
with:
name: integration-test-results
path: 'TestResults/TransactionProcessorACL.IntegrationTests.xml'
retention-days: 30
61 changes: 31 additions & 30 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,54 @@
<ItemGroup>
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.Uris" Version="9.0.0" />
<PackageVersion Include="ClientProxyBase" Version="2026.6.1" />
<PackageVersion Include="ClientProxyBase" Version="2026.8.2" />
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
<PackageVersion Include="coverlet.msbuild" Version="10.0.1" />
<PackageVersion Include="Ductus.FluentDocker" Version="2.85.0" />
<PackageVersion Include="EventStoreProjections" Version="2023.12.3" />
<PackageVersion Include="KurrentDB.Client" Version="1.4.0" />
<PackageVersion Include="Lamar" Version="16.0.0" />
<PackageVersion Include="Lamar.Microsoft.DependencyInjection" Version="16.0.0" />
<PackageVersion Include="MediatR" Version="14.1.0" />
<PackageVersion Include="MediatR" Version="14.2.0" />
<PackageVersion Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
<PackageVersion Include="MessagingService.IntegrationTesting.Helpers" Version="2026.4.3-build126" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.9" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.9" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.9" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.9" />
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.9" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.9" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="10.0.9" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageVersion Include="MessagingService.IntegrationTesting.Helpers" Version="2026.7.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.11" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.11" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.11" />
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.11" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.11" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="10.0.11" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="2.3.3" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
<PackageVersion Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="10.0.2" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="NLog.Extensions.Logging" Version="6.1.3" />
<PackageVersion Include="NLog.Extensions.Logging" Version="6.2.0" />
<PackageVersion Include="NUnit" Version="4.6.1" />
<PackageVersion Include="NUnit3TestAdapter" Version="6.2.0" />
<PackageVersion Include="OpenIddict.Validation.AspNetCore" Version="7.5.0" />
<PackageVersion Include="OpenIddict.Validation.SystemNetHttp" Version="7.5.0" />
<PackageVersion Include="OpenIddict.Validation.AspNetCore" Version="7.6.0" />
<PackageVersion Include="OpenIddict.Validation.SystemNetHttp" Version="7.6.0" />
<PackageVersion Include="Reqnroll" Version="3.3.4" />
<PackageVersion Include="Reqnroll.NUnit" Version="3.3.4" />
<PackageVersion Include="Reqnroll.Tools.MsBuild.Generation" Version="3.3.4" />
<PackageVersion Include="SecurityService.Client" Version="2026.4.3-build157" />
<PackageVersion Include="SecurityService.IntegrationTesting.Helpers" Version="2026.4.3-build157" />
<PackageVersion Include="Shared" Version="2026.5.6" />
<PackageVersion Include="Shared.IntegrationTesting" Version="2026.6.1" />
<PackageVersion Include="Shared.Results.Web" Version="2026.5.6" />
<PackageVersion Include="SecurityService.Client" Version="2026.7.2" />
<PackageVersion Include="SecurityService.IntegrationTesting.Helpers" Version="2026.7.2" />
<PackageVersion Include="Shared" Version="2026.8.2" />
<PackageVersion Include="Shared.IntegrationTesting" Version="2026.8.2" />
<PackageVersion Include="Shared.Results.Web" Version="2026.8.2" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="10.2.1" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="10.2.1" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="10.2.3" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="10.2.3" />
<PackageVersion Include="Swashbuckle.AspNetCore.Filters" Version="10.0.1" />
<PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="10.2.1" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="10.2.1" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.2.1" />
<PackageVersion Include="TransactionProcessor.Client" Version="2026.4.3-build354" />
<PackageVersion Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2026.4.3-build354" />
<PackageVersion Include="Sentry.AspNetCore" Version="6.6.0" />
<PackageVersion Include="xunit.v3" Version="3.2.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="10.2.3" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="10.2.3" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.2.3" />
<PackageVersion Include="TransactionProcessor.Client" Version="2026.7.2" />
<PackageVersion Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2026.7.2" />
<PackageVersion Include="Sentry.AspNetCore" Version="6.9.0" />
<PackageVersion Include="xunit.v3" Version="4.0.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="4.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net10.0</TargetFramework>
<DebugType>None</DebugType>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,6 +16,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="Shouldly" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
<PackageReference Include="TransactionProcessor.Client" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" />
<PackageReference Include="xunit.v3" />
Expand Down
5 changes: 5 additions & 0 deletions TransactionProcessorACL.BusinessLogic.Tests/testconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"xUnit": {
"parallelizeTestCollections": false
}
}
17 changes: 16 additions & 1 deletion TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace TransactionProcessor.IntegrationTests.Common
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using TestHosts.Clients;

/// <summary>
///
Expand Down Expand Up @@ -44,6 +45,8 @@ public class DockerHelper : global::Shared.IntegrationTesting.TestContainers.Doc

public EventStoreProjectionManagementClient ProjectionManagementClient;

public IAgencyBankingClient AgencyBankingClient;

#endregion

#region Constructors
Expand Down Expand Up @@ -96,7 +99,8 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do
String SecurityServiceBaseAddressResolver(String api) => $"https://127.0.0.1:{this.SecurityServicePort}";
String TransactionProcessorBaseAddressResolver(String api) => $"http://127.0.0.1:{this.TransactionProcessorPort}";
String TransactionProcessorAclBaseAddressResolver(String api) => $"http://127.0.0.1:{this.TransactionProcessorAclPort}";

String TestHostServiceBaseAddressResolver(String api) => $"http://127.0.0.1:{this.TestHostServicePort}";

HttpClientHandler clientHandler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (message,
Expand All @@ -113,6 +117,7 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do
this.TransactionProcessorClient = new TransactionProcessorClient(TransactionProcessorBaseAddressResolver, httpClient, Serialise, Deserialise);
this.TestHostHttpClient = new HttpClient(clientHandler);
this.TestHostHttpClient.BaseAddress = new Uri($"http://127.0.0.1:{this.TestHostServicePort}");
this.AgencyBankingClient = new AgencyBankingClient(TestHostServiceBaseAddressResolver, httpClient, Serialise_CamelCase, this.Deserialise_CamelCase);

this.HttpClient = new HttpClient();
this.HttpClient.BaseAddress = new Uri(TransactionProcessorAclBaseAddressResolver(string.Empty));
Expand All @@ -131,6 +136,16 @@ Object Deserialise(String arg, Type type)
return StringSerialiser.DeserializeObject<Object>(arg, type, new SerialiserOptions(SerialiserPropertyFormat.SnakeCase));
}

String Serialise_CamelCase(Object arg)
{
return StringSerialiser.Serialise<Object>(arg, new SerialiserOptions(SerialiserPropertyFormat.CamelCase));
}

Object Deserialise_CamelCase(String arg, Type type)
{
return StringSerialiser.DeserializeObject<Object>(arg, type, new SerialiserOptions(SerialiserPropertyFormat.CamelCase));
}

public override Dictionary<String, String> GetAdditionalVariables(ContainerType containerType)
{
Dictionary<String, String> additionalVariables = base.GetAdditionalVariables(containerType);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<RunSettings>
<NUnit>
<TestOutputXml>TransactionProcessorACL.IntegrationTests</TestOutputXml>
<OutputXmlFolderMode>UseResultDirectory</OutputXmlFolderMode>
</NUnit>
</RunSettings>
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public SharedSteps(ScenarioContext scenarioContext,
this.ScenarioContext = scenarioContext;
this.TestingContext = testingContext;
this.SecurityServiceSteps = new SecurityServiceSteps(testingContext.DockerHelper.SecurityServiceClient);
this.TransactionProcessorSteps = new TransactionProcessorSteps(testingContext.DockerHelper.TransactionProcessorClient, testingContext.DockerHelper.TestHostHttpClient, testingContext.DockerHelper.ProjectionManagementClient);
this.TransactionProcessorSteps = new TransactionProcessorSteps(testingContext.DockerHelper.TransactionProcessorClient, testingContext.DockerHelper.TestHostHttpClient, testingContext.DockerHelper.ProjectionManagementClient,
testingContext.DockerHelper.AgencyBankingClient);
this.AclSteps = new ACLSteps(testingContext.DockerHelper.HttpClient, this.TestingContext.DockerHelper.TransactionProcessorClient);
}

Expand Down Expand Up @@ -322,7 +323,7 @@ public async Task WhenICreateTheFollowingEstates(DataTable table){
[When(@"I create the following merchants")]
public async Task WhenICreateTheFollowingMerchants(DataTable table){
List<EstateDetails> estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList();
List<(EstateDetails estate, CreateMerchantRequest)> requests = table.Rows.ToCreateMerchantRequests(estates);
List<(EstateDetails estate, CreateMerchantRequest, Boolean EnableAgencyBanking)> requests = table.Rows.ToCreateMerchantRequests(estates);

List<TransactionProcessor.DataTransferObjects.Responses.Merchant.MerchantResponse> verifiedMerchants = await this.TransactionProcessorSteps.WhenICreateTheFollowingMerchants(this.TestingContext.AccessToken, requests);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net10.0</TargetFramework>
<DebugType>Full</DebugType>
<IsPackable>false</IsPackable>
<EnableNUnitRunner>true</EnableNUnitRunner>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net10.0</TargetFramework>
<DebugType>None</DebugType>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,6 +15,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="Shouldly" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
<PackageReference Include="TransactionProcessor.Client" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" />
<PackageReference Include="xunit.v3" />
Expand Down
Loading
Loading