Skip to content

Commit 059f638

Browse files
Projections not copied locally
1 parent 0a7d03f commit 059f638

5 files changed

Lines changed: 133 additions & 26 deletions

File tree

FileProcessor.IntegrationTests/Common/Setup.cs

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
namespace FileProcessor.IntegrationTests.Common
22
{
33
using System;
4+
using System.Data;
5+
using System.Data.SqlClient;
6+
using System.Net;
7+
using System.Threading;
8+
using Ductus.FluentDocker.Builders;
49
using Ductus.FluentDocker.Services;
510
using Ductus.FluentDocker.Services.Extensions;
11+
using Microsoft.Extensions.Logging;
612
using NLog;
713
using Shared.Logger;
814
using Shouldly;
915
using TechTalk.SpecFlow;
16+
using ILogger = Microsoft.Extensions.Logging.ILogger;
1017

1118
[Binding]
1219
public class Setup
@@ -20,6 +27,78 @@ public class Setup
2027
public const String SqlUserName = "sa";
2128

2229
public const String SqlPassword = "thisisalongpassword123!";
30+
31+
//public static IContainerService StartSqlContainerWithOpenConnection(String containerName,
32+
// ILogger logger,
33+
// String imageName,
34+
// INetworkService networkService,
35+
// String hostFolder,
36+
// (String URL, String UserName, String Password)? dockerCredentials,
37+
// String sqlUserName = "sa",
38+
// String sqlPassword = "thisisalongpassword123!")
39+
//{
40+
// //logger.LogInformation("About to start SQL Server Container");
41+
// IContainerService databaseServerContainer = new Builder().UseContainer().WithName(containerName).UseImage(imageName)
42+
// .WithEnvironment("ACCEPT_EULA=Y", $"SA_PASSWORD={sqlPassword}").ExposePort(1433)
43+
// .UseNetwork(networkService).KeepContainer().KeepRunning().ReuseIfExists().Build().Start()
44+
// .WaitForPort("1433/tcp", 30000);
45+
46+
// //logger.LogInformation("SQL Server Container Started");
47+
48+
// //logger.LogInformation("About to SQL Server Container is running");
49+
// IPEndPoint sqlServerEndpoint = databaseServerContainer.ToHostExposedEndpoint("1433/tcp");
50+
51+
// // Try opening a connection
52+
// Int32 maxRetries = 10;
53+
// Int32 counter = 1;
54+
55+
// String server = "127.0.0.1";
56+
// String database = "master";
57+
// String user = sqlUserName;
58+
// String password = sqlPassword;
59+
// String port = sqlServerEndpoint.Port.ToString();
60+
61+
// String connectionString = $"server={server},{port};user id={user}; password={password}; database={database};";
62+
// //logger.LogInformation($"Connection String {connectionString}");
63+
// SqlConnection connection = new SqlConnection(connectionString);
64+
65+
// while (counter <= maxRetries)
66+
// {
67+
// try
68+
// {
69+
// //logger.LogInformation($"Database Connection Attempt {counter}");
70+
71+
// connection.Open();
72+
73+
// SqlCommand command = connection.CreateCommand();
74+
// command.CommandText = "SELECT * FROM sys.databases";
75+
// command.ExecuteNonQuery();
76+
77+
// //logger.LogInformation("Connection Opened");
78+
79+
// connection.Close();
80+
// //logger.LogInformation("SQL Server Container Running");
81+
// break;
82+
// }
83+
// catch (SqlException ex)
84+
// {
85+
// if (connection.State == ConnectionState.Open)
86+
// {
87+
// connection.Close();
88+
// }
89+
90+
// //logger.LogError(ex);
91+
// Thread.Sleep(20000);
92+
// }
93+
// finally
94+
// {
95+
// counter++;
96+
// }
97+
// }
98+
99+
// return databaseServerContainer;
100+
//}
101+
23102
[BeforeTestRun]
24103
protected static void GlobalSetup()
25104
{
@@ -35,7 +114,7 @@ protected static void GlobalSetup()
35114
LogManager.AddHiddenAssembly(typeof(NlogLogger).Assembly);
36115

37116
// Start the Database Server here
38-
Setup.DatabaseServerContainer = global::Shared.IntegrationTesting.DockerHelper.StartSqlContainerWithOpenConnection(Setup.SqlServerContainerName,
117+
Setup.DatabaseServerContainer = Shared.IntegrationTesting.DockerHelper.StartSqlContainerWithOpenConnection(Setup.SqlServerContainerName,
39118
logger,
40119
"mcr.microsoft.com/mssql/server:2019-latest",
41120
Setup.DatabaseServerNetwork,

FileProcessor.IntegrationTests/Features/GetFileImportDetails.feature.cs

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FileProcessor.IntegrationTests/Features/ProcessTopupCSV.feature.cs

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FileProcessor.IntegrationTests/Features/ProcessVoucherCSV.feature.cs

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="EstateReporting.Client" Version="1.0.18.2" />
10+
<PackageReference Include="EstateReporting.Client" Version="1.0.19.2" />
1111
<PackageReference Include="Grpc.Net.Client" Version="2.35.0" />
1212
<PackageReference Include="Ductus.FluentDocker" Version="2.10.7" />
1313
<PackageReference Include="EstateReporting.Database" Version="1.0.18.2" />
1414
<PackageReference Include="EstateManagement.Client" Version="1.0.16.2" />
1515
<PackageReference Include="EventStore.Client.Grpc.PersistentSubscriptions" Version="21.2.0" />
1616
<PackageReference Include="EventStore.Client.Grpc.ProjectionManagement" Version="21.2.0" />
1717
<PackageReference Include="EventStore.Client.Grpc.Streams" Version="20.10.0" />
18+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.12" />
1819
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
1920
<PackageReference Include="SecurityService.Client" Version="1.0.8" />
21+
<PackageReference Include="Shared" Version="1.1.5" />
2022
<PackageReference Include="Shared.IntegrationTesting" Version="1.1.5" />
2123
<PackageReference Include="Shouldly" Version="4.0.3" />
22-
<PackageReference Include="SpecFlow.xUnit" Version="3.7.38" />
24+
<PackageReference Include="SpecFlow" Version="3.5.14" />
25+
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.5.14" />
26+
<PackageReference Include="SpecFlow.xUnit" Version="3.5.14" />
2327
<PackageReference Include="xunit" Version="2.4.1" />
2428
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
2529
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -60,4 +64,28 @@
6064
<ProjectReference Include="..\FileProcessor.DataTransferObjects\FileProcessor.DataTransferObjects.csproj" />
6165
</ItemGroup>
6266

67+
<ItemGroup>
68+
<None Update="projections\continuous\CallbackHandlerEnricher.js">
69+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
70+
</None>
71+
<None Update="projections\continuous\EstateAggregator.js">
72+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
73+
</None>
74+
<None Update="projections\continuous\FileProcessorSubscriptionStreamBuilder.js">
75+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
76+
</None>
77+
<None Update="projections\continuous\MerchantAggregator.js">
78+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
79+
</None>
80+
<None Update="projections\continuous\MerchantBalanceCalculator.js">
81+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
82+
</None>
83+
<None Update="projections\continuous\TransactionEnricher.js">
84+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
85+
</None>
86+
<None Update="projections\continuous\TransactionProcessorSubscriptionStreamBuilder.js">
87+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
88+
</None>
89+
</ItemGroup>
90+
6391
</Project>

0 commit comments

Comments
 (0)