diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml
index 68b73fb..a3bc8a8 100644
--- a/.github/workflows/codecoverage.yml
+++ b/.github/workflows/codecoverage.yml
@@ -2,46 +2,52 @@ name: Code Coverage
on:
push:
- # branches to consider in the event; optional, defaults to all
branches:
- main
workflow_dispatch:
-jobs:
+permissions:
+ contents: read
+
+jobs:
build:
- name: "Code Coverage"
+ name: Code Coverage
env:
- ASPNETCORE_ENVIRONMENT: "Production"
+ ASPNETCORE_ENVIRONMENT: Production
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2.3.4
-
- - name: Restore Nuget Packages
- run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
-
- - name: Build Code
- run: dotnet build FileProcessor.sln --configuration Release
-
- - name: Run Unit Tests
- run: |
- echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
- dotnet test "FileProcessor.BusinessLogic.Tests\FileProcessor.BusinessLogic.Tests.csproj" /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 "FileProcessor.FileAggregate.Tests\FileProcessor.FileAggregate.Tests.csproj" /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 "FileProcessor.FileImportLogAggregate.Tests\FileProcessor.FileImportLogAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov3.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
-
- - name: Install LCOV merger
- run: npm install -g lcov-result-merger
-
- - name: Merge LCOV reports
- run: |
- mkdir -p coverage
- lcov-result-merger "*.info" > lcov.info
-
- - name: Upload merged coverage to Codacy
- uses: codacy/codacy-coverage-reporter-action@v1
- with:
- project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
- coverage-reports: ./lcov.info
+ - uses: actions/checkout@v6
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 10.0.x
+
+ - name: Restore Nuget Packages
+ run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
+
+ - name: Build Code
+ run: dotnet build FileProcessor.sln --configuration Release --no-restore
+
+ - name: Run Unit Tests
+ run: |
+ echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
+ dotnet run --project "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory "./coverage/businesslogic"
+ dotnet run --project "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory "./coverage/fileaggregate"
+ dotnet run --project "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory "./coverage/fileimportlogaggregate"
+
+ - name: Merge Coverage Reports
+ uses: danielpalme/ReportGenerator-GitHub-Action@v5
+ with:
+ reports: ./coverage/**/*.cobertura.xml
+ targetdir: ./coverage-report
+ reporttypes: Cobertura
+
+ - name: Upload coverage to Codacy
+ uses: codacy/codacy-coverage-reporter-action@v1
+ with:
+ project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
+ coverage-reports: ./coverage-report/Cobertura.xml
diff --git a/.github/workflows/nightlybuild.yml b/.github/workflows/nightlybuild.yml
index 4dad0b9..029c05d 100644
--- a/.github/workflows/nightlybuild.yml
+++ b/.github/workflows/nightlybuild.yml
@@ -12,54 +12,59 @@ permissions:
jobs:
build:
- name: "Nightly Build"
+ name: Nightly Build
env:
- ASPNETCORE_ENVIRONMENT: "Production"
+ ASPNETCORE_ENVIRONMENT: Production
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2.3.4
+ - uses: actions/checkout@v6
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 10.0.x
- - name: Set Up Variables
- run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
+ - name: Set Up Variables
+ run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- - name: Restore Nuget Packages
- run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
+ - name: Restore Nuget Packages
+ run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
- - name: Build Code
- run: dotnet build FileProcessor.sln --configuration Release
+ - name: Build Code
+ run: dotnet build FileProcessor.sln --configuration Release --no-restore
- - name: Run Unit Tests
- run: |
- echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
- dotnet test "FileProcessor.BusinessLogic.Tests\FileProcessor.BusinessLogic.Tests.csproj" /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 "FileProcessor.FileAggregate.Tests\FileProcessor.FileAggregate.Tests.csproj" /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 "FileProcessor.FileImportLogAggregate.Tests\FileProcessor.FileImportLogAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov3.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
+ - name: Run Unit Tests
+ run: |
+ echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
+ dotnet test "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build
+ dotnet test "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build
+ dotnet test "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build
- - name: Build Docker Image
- run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest
-
- - name: Run Integration Tests
- run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj"
+ - name: Build Docker Image
+ run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest
+
+ - name: Run Integration Tests
+ run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build
- - uses: actions/upload-artifact@v4.4.0
- with:
- name: tracelogs
- path: /home/runner/trace/
+ - uses: actions/upload-artifact@v4.4.0
+ with:
+ name: tracelogs
+ path: /home/runner/trace/
- - name: Notify on nightly failure
- if: ${{ failure() }}
- uses: TransactionProcessing/org-ci-workflows/.github/actions/nightly-failure-issue@main
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- title: Investigate Nightly Build Failure
- labels: nightlybuild
- dedupe_key: nightlybuild
- body: |
- Repo: ${{ github.repository }}
- Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- Commit: ${{ github.sha }}
- Workflow: ${{ github.workflow }}
- Job: ${{ github.job }}
+ - name: Notify on nightly failure
+ if: ${{ failure() }}
+ uses: TransactionProcessing/org-ci-workflows/.github/actions/nightly-failure-issue@main
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ title: Investigate Nightly Build Failure
+ labels: nightlybuild
+ dedupe_key: nightlybuild
+ body: |
+ Repo: ${{ github.repository }}
+ Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+ Commit: ${{ github.sha }}
+ Workflow: ${{ github.workflow }}
+ Job: ${{ github.job }}
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index b0713f4..9ac31a4 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -7,57 +7,62 @@ on:
jobs:
build:
- name: "Build and Test Pull Requests"
+ name: Build and Test Pull Requests
env:
- ASPNETCORE_ENVIRONMENT: "Production"
+ ASPNETCORE_ENVIRONMENT: Production
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2.3.4
-
- - name: Echo vars
- run: |
- echo "CI is > ${CI}"
- echo "HOME is > ${HOME}"
-
- - name: Restore Nuget Packages
- run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
-
- - name: Build Code
- run: dotnet build FileProcessor.sln --configuration Release
-
- - name: Run Unit Tests
- run: |
- echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
- dotnet test "FileProcessor.BusinessLogic.Tests\FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=businesslogic-test-results.trx"
- dotnet test "FileProcessor.FileAggregate.Tests\FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=fileaggregate-test-results.trx"
- dotnet test "FileProcessor.FileImportLogAggregate.Tests\FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=fileimportlogaggregate-test-results.trx"
-
- - name: Build Docker Image
- run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest
-
- - name: Run Integration Tests
- run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" --filter Category=PRTest --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=integration-test-results.trx"
-
- - uses: actions/upload-artifact@v4.4.0
- with:
- name: tracelogs
- path: /home/runner/trace/
-
- - name: Publish test results
- uses: dorny/test-reporter@v1
- if: always()
- with:
+ - uses: actions/checkout@v6
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 10.0.x
+
+ - name: Echo vars
+ run: |
+ echo "CI is > ${CI}"
+ echo "HOME is > ${HOME}"
+
+ - name: Restore Nuget Packages
+ run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
+
+ - name: Build Code
+ run: dotnet build FileProcessor.sln --configuration Release --no-restore
+
+ - name: Run Unit Tests
+ run: |
+ echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
+ dotnet test "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename businesslogic-test-results.trx
+ dotnet test "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename fileaggregate-test-results.trx
+ dotnet test "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename fileimportlogaggregate-test-results.trx
+
+ - name: Build Docker Image
+ run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest
+
+ - name: Run Integration Tests
+ run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal -- --filter "Category=PRTest"
+
+ - uses: actions/upload-artifact@v4.4.0
+ with:
+ name: tracelogs
+ path: /home/runner/trace/
+
+ - name: Publish 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: Upload test results
- uses: actions/upload-artifact@v4
- if: always()
- with:
+
+ - name: Upload test results
+ uses: actions/upload-artifact@v4
+ if: always()
+ with:
name: test-results
- path: '**/TestResults/*.trx'
- retention-days: 30
\ No newline at end of file
+ path: '**/TestResults/*'
+ retention-days: 30
diff --git a/Directory.Packages.props b/Directory.Packages.props
index ec31b57..8987715 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -4,59 +4,60 @@
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj b/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj
index 1a14965..87a427c 100644
--- a/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj
+++ b/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj
@@ -2,6 +2,9 @@
net10.0
+ Exe
+ true
+ true
None
false
@@ -11,6 +14,7 @@
+
diff --git a/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj b/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj
index 8319203..9476828 100644
--- a/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj
+++ b/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj
@@ -2,12 +2,16 @@
net10.0
+ Exe
+ true
+ true
None
false
+
diff --git a/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj b/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj
index 78fe438..0deda4c 100644
--- a/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj
+++ b/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj
@@ -2,12 +2,16 @@
net10.0
+ Exe
+ true
+ true
None
false
+
diff --git a/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj b/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj
index c27c911..1429d19 100644
--- a/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj
+++ b/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj
@@ -2,12 +2,16 @@
net10.0
+ Exe
+ true
+ true
Full
false
+
diff --git a/FileProcessor.IntegrationTests/Common/DockerHelper.cs b/FileProcessor.IntegrationTests/Common/DockerHelper.cs
index f6c3637..8896398 100644
--- a/FileProcessor.IntegrationTests/Common/DockerHelper.cs
+++ b/FileProcessor.IntegrationTests/Common/DockerHelper.cs
@@ -1,7 +1,7 @@
-using System;
+using DotNet.Testcontainers.Builders;
+using System;
using System.Collections.Generic;
using System.Threading.Tasks;
-using DotNet.Testcontainers.Builders;
namespace FileProcessor.IntegrationTests.Common
{
@@ -11,6 +11,7 @@ namespace FileProcessor.IntegrationTests.Common
using Shared.IntegrationTesting;
using Shared.Serialisation;
using System.Net.Http;
+ using TestHosts.Clients;
using TransactionProcessor.Client;
public class DockerHelper : global::Shared.IntegrationTesting.TestContainers.DockerHelper{
@@ -34,6 +35,8 @@ public class DockerHelper : global::Shared.IntegrationTesting.TestContainers.Doc
public EventStoreProjectionManagementClient ProjectionManagementClient;
+ public IAgencyBankingClient AgencyBankingClient;
+
#endregion
#region Constructors
@@ -73,7 +76,7 @@ public override ContainerBuilder SetupFileProcessorContainer() {
{ "AppSettings:FileProfilePollingWindowInSeconds", "5" }
};
- this.AdditionalVariables.Add(ContainerType.FileProcessor, variables);
+ this.AdditionalVariables[ContainerType.FileProcessor] = variables;
return base.SetupFileProcessorContainer();
}
@@ -85,7 +88,8 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do
String SecurityServiceBaseAddressResolver(String api) => $"https://127.0.0.1:{this.SecurityServicePort}";
String FileProcessorBaseAddressResolver(String api) => $"http://127.0.0.1:{this.FileProcessorPort}";
String TransactionProcessorBaseAddressResolver(String api) => $"http://127.0.0.1:{this.TransactionProcessorPort}";
-
+ String TestHostServiceBaseAddressResolver(String api) => $"http://127.0.0.1:{this.TestHostServicePort}";
+
HttpClientHandler clientHandler = new HttpClientHandler{
ServerCertificateCustomValidationCallback = (message,
certificate2,
@@ -109,7 +113,8 @@ 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.ProjectionManagementClient = new EventStoreProjectionManagementClient(ConfigureEventStoreSettings());
}
@@ -123,6 +128,16 @@ Object Deserialise(String arg, Type type)
return StringSerialiser.DeserializeObject