From 9255e7f5324735fdd3481a27c66559bba1633581 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 22 Oct 2022 14:47:36 +0100 Subject: [PATCH 1/3] Fix nigtly builds --- .../Shared/SharedSteps.cs | 5 +++-- .../TransactionProcessorACL.IntegrationTests.csproj | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs index 766dea7..d4853c4 100644 --- a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Threading.Tasks; using Common; + using DataTransferObjects; using EstateManagement.DataTransferObjects; using EstateManagement.DataTransferObjects.Requests; using EstateManagement.DataTransferObjects.Responses; @@ -235,7 +236,7 @@ public async Task GivenIMakeTheFollowingManualMerchantDeposits(Table table) // Get current balance MerchantBalanceResponse previousMerchantBalance = - await this.TestingContext.DockerHelper.EstateClient.GetMerchantBalance(token, estateDetails.EstateId, merchantId, CancellationToken.None); + await this.TestingContext.DockerHelper.TransactionProcessorClient.GetMerchantBalance(token, estateDetails.EstateId, merchantId, CancellationToken.None); MakeMerchantDepositRequest makeMerchantDepositRequest = new MakeMerchantDepositRequest { @@ -264,7 +265,7 @@ public async Task GivenIMakeTheFollowingManualMerchantDeposits(Table table) await Retry.For(async () => { MerchantBalanceResponse currentMerchantBalance = - await this.TestingContext.DockerHelper.EstateClient.GetMerchantBalance(token, + await this.TestingContext.DockerHelper.TransactionProcessorClient.GetMerchantBalance(token, estateDetails.EstateId, merchantId, CancellationToken.None); diff --git a/TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj b/TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj index f1394bf..c899162 100644 --- a/TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj +++ b/TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj @@ -7,20 +7,21 @@ - + - + + - - + + - + all From c9178e90b3c8a09e3b17d6f2c1cd0ab68519606d Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 22 Oct 2022 15:00:21 +0100 Subject: [PATCH 2/3] :| --- .../Common/DockerHelper.cs | 17 ++++++++++++----- .../Shared/SharedSteps.cs | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs index 4c4756c..72eec91 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs @@ -313,16 +313,23 @@ public override async Task StartContainersForScenarioRun(String scenarioName) this.HttpClient.BaseAddress = new Uri(TransactionProcessorAclBaseAddressResolver(string.Empty)); await this.LoadEventStoreProjections(this.EventStoreHttpPort, this.IsSecureEventStore).ConfigureAwait(false); + await this.PopulateSubscriptionServiceConfigurationGeneric(this.IsSecureEventStore).ConfigureAwait(false); } - - public async Task PopulateSubscriptionServiceConfiguration(String estateName, Boolean isSecureEventStore) + + public async Task PopulateSubscriptionServiceConfigurationForEstate(String estateName, Boolean isSecureEventStore) { List<(String streamName, String groupName, Int32 maxRetries)> subscriptions = new List<(String streamName, String groupName, Int32 maxRetries)>(); - subscriptions.Add((estateName.Replace(" ", ""), "Reporting", 5)); + subscriptions.Add((estateName.Replace(" ", ""), "Reporting", 2)); subscriptions.Add(($"EstateManagementSubscriptionStream_{estateName.Replace(" ", "")}", "Estate Management", 0)); subscriptions.Add(($"TransactionProcessorSubscriptionStream_{estateName.Replace(" ", "")}", "Transaction Processor", 0)); - await this.PopulateSubscriptionServiceConfiguration(this.EventStoreHttpPort, subscriptions, - isSecureEventStore); + await this.PopulateSubscriptionServiceConfiguration(this.EventStoreHttpPort, subscriptions, isSecureEventStore); + } + public async Task PopulateSubscriptionServiceConfigurationGeneric(Boolean isSecureEventStore) + { + List<(String streamName, String groupName, Int32 maxRetries)> subscriptions = new List<(String streamName, String groupName, Int32 maxRetries)>(); + subscriptions.Add(($"$ce-MerchantBalanceArchive", "Transaction Processor - Ordered", 0)); + subscriptions.Add(($"$et-EstateCreatedEvent", "Transaction Processor - Ordered", 2)); + await this.PopulateSubscriptionServiceConfiguration(this.EventStoreHttpPort, subscriptions, isSecureEventStore); } private async Task RemoveEstateReadModel() diff --git a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs index d4853c4..083b778 100644 --- a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs @@ -575,7 +575,7 @@ public async Task WhenICreateTheFollowingEstates(Table table) // Setup the subscriptions for the estate await Retry.For(async () => { - await this.TestingContext.DockerHelper.PopulateSubscriptionServiceConfiguration(estateName,this.TestingContext.DockerHelper.IsSecureEventStore).ConfigureAwait(false); + await this.TestingContext.DockerHelper.PopulateSubscriptionServiceConfigurationForEstate(estateName,this.TestingContext.DockerHelper.IsSecureEventStore).ConfigureAwait(false); }, retryFor: TimeSpan.FromMinutes(2), retryInterval: TimeSpan.FromSeconds(30)); EstateResponse estate = null; From d87f3ea62aa5084cf6fa33a3d83e271da846031e Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 22 Oct 2022 15:17:25 +0100 Subject: [PATCH 3/3] some more fixes --- .../Common/DockerHelper.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs index 72eec91..e5d10ca 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs @@ -222,15 +222,18 @@ public override async Task StartContainersForScenarioRun(String scenarioName) String pataPawaUrlEnvironmentVariable = "OperatorConfiguration:PataPawaPostPay:Url=http://" + this.TestHostContainerName + ":9000/PataPawaPostPayService/basichttp"; String pataPawaApiLogonRequiredEnvironmentVariable = "OperatorConfiguration:PataPawaPostPay:ApiLogonRequired=false"; + String transactionProcessorReadModelConnectionString = $"ConnectionStrings:TransactionProcessorReadModel=\"server={this.SqlServerDetails.sqlServerContainerName};user id=sa;password={this.SqlServerDetails.sqlServerPassword};database=TransactionProcessorReadModel\""; IContainerService transactionProcessorContainer = this.SetupTransactionProcessorContainer("stuartferguson/transactionprocessor", new List { - testNetwork + testNetwork, + Setup.DatabaseServerNetwork }, true, additionalEnvironmentVariables:new List { + transactionProcessorReadModelConnectionString, pataPawaUrlEnvironmentVariable, pataPawaApiLogonRequiredEnvironmentVariable, insecureEventStoreEnvironmentVariable,