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
2 changes: 1 addition & 1 deletion Shared.IntegrationTesting.Tests/GenericSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Reqnroll;

public class TestDockerHelper : DockerHelper{
public override async Task CreateSubscriptions(){

Check warning on line 11 in Shared.IntegrationTesting.Tests/GenericSteps.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Linux

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
// Nothing here
}
}
Expand All @@ -33,7 +33,7 @@
String scenarioName = this.ScenarioContext.ScenarioInfo.Title.Replace(" ", "");
NlogLogger logger = new();
logger.Initialise(LogManager.GetLogger(scenarioName), scenarioName);
LogManager.AddHiddenAssembly(typeof(NlogLogger).Assembly);

Check warning on line 36 in Shared.IntegrationTesting.Tests/GenericSteps.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Linux

'LogManager.AddHiddenAssembly(Assembly)' is obsolete: 'Replaced by LogManager.Setup().SetupLogFactory(setup => setup.AddCallSiteHiddenAssembly(assembly)). Marked obsolete on NLog 5.3'

this.TestingContext.DockerHelper = new TestDockerHelper();
this.TestingContext.DockerHelper.Logger = logger;
Expand All @@ -46,7 +46,7 @@
DockerServices services = DockerServices.EventStore | DockerServices.MessagingService | DockerServices.SecurityService |
DockerServices.CallbackHandler | DockerServices.FileProcessor |
DockerServices.TestHost | DockerServices.TransactionProcessor |
DockerServices.TransactionProcessorAcl | DockerServices.KeyCloak;
DockerServices.TransactionProcessorAcl;

this.TestingContext.Logger = logger;
this.TestingContext.Logger.LogInformation("About to Start Containers for Scenario Run");
Expand Down
28 changes: 1 addition & 27 deletions Shared.IntegrationTesting/BaseDockerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@

protected Int32 TransactionProcessorAclPort;

protected String KeyCloakContainerName;
protected Int32 KeyCloakPort;

protected String TransactionProcessorContainerName;

protected Int32 TransactionProcessorPort;
Expand Down Expand Up @@ -149,7 +146,6 @@
this.ImageDetails.Add(ContainerType.TransactionProcessor, ("stuartferguson/transactionprocessorwindows:master", true));
this.ImageDetails.Add(ContainerType.FileProcessor, ("stuartferguson/fileprocessorwindows:master", true));
this.ImageDetails.Add(ContainerType.TransactionProcessorAcl, ("stuartferguson/transactionprocessoraclwindows:master", true));
this.ImageDetails.Add(ContainerType.Keycloak, ("quay.io/keycloak/keycloak:26.4.1", true)); // Note: this may not work...
}
else{
if (FdOs.IsLinux()){
Expand All @@ -167,7 +163,6 @@
this.ImageDetails.Add(ContainerType.TransactionProcessor, ("stuartferguson/transactionprocessor:master", true));
this.ImageDetails.Add(ContainerType.FileProcessor, ("stuartferguson/fileprocessor:master", true));
this.ImageDetails.Add(ContainerType.TransactionProcessorAcl, ("stuartferguson/transactionprocessoracl:master", true));
this.ImageDetails.Add(ContainerType.Keycloak, ("quay.io/keycloak/keycloak:26.4.1", true));
}

this.HostPorts = new Dictionary<ContainerType, Int32>();
Expand Down Expand Up @@ -325,7 +320,6 @@
this.MessagingServiceContainerName = $"messaging{this.TestId:N}";
this.TransactionProcessorContainerName = $"transaction{this.TestId:N}";
this.TransactionProcessorAclContainerName = $"transactionacl{this.TestId:N}";
this.KeyCloakContainerName= $"keycloak{this.TestId:N}";
}

public virtual ContainerBuilder SetupEventStoreContainer(){
Expand Down Expand Up @@ -373,23 +367,7 @@

return eventStoreContainerBuilder;
}

public virtual ContainerBuilder SetupKeycloakContainer()
{
this.Trace("About to Start KeyCloak Container");

List<String> environmentVariables = new();
environmentVariables.Add("KC_BOOTSTRAP_ADMIN_USERNAME=admin");
environmentVariables.Add("KC_BOOTSTRAP_ADMIN_PASSWORD=admin");

ContainerBuilder keycloakContainer = new Builder().UseContainer()
.WithName(this.KeyCloakContainerName).WithEnvironment(environmentVariables.ToArray())
.UseImageDetails(this.GetImageDetails(ContainerType.Keycloak).Data).ExposePort(DockerPorts.KeyCloakDockerPort)
.Command("start-dev"); // 👈 equivalent to `docker run ... start-dev`

return keycloakContainer;
}


public virtual ContainerBuilder SetupFileProcessorContainer(){
this.Trace("About to Start File Processor Container");

Expand Down Expand Up @@ -877,7 +855,7 @@
try{
await projectionClient.CreateContinuousAsync(projectionName, projection, trackEmittedStreams:true).ConfigureAwait(false);
}
catch (Exception ex) {

Check warning on line 858 in Shared.IntegrationTesting/BaseDockerHelper.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Linux

The variable 'ex' is declared but never used
// ignored
}

Expand Down Expand Up @@ -956,7 +934,6 @@
DockerServices.TransactionProcessorAcl => ContainerType.TransactionProcessorAcl,
DockerServices.EventStore=> ContainerType.EventStore,
DockerServices.SqlServer => ContainerType.SqlServer,
DockerServices.KeyCloak => ContainerType.Keycloak,
_ => ContainerType.NotSet
};

Expand Down Expand Up @@ -1032,9 +1009,6 @@
case ContainerType.TransactionProcessorAcl:
TransactionProcessorAclPort = GetPort(DockerPorts.TransactionProcessorAclDockerPort);
break;
case ContainerType.Keycloak:
this.KeyCloakPort = GetPort(DockerPorts.KeyCloakDockerPort);
break;
}
}

Expand Down
1 change: 0 additions & 1 deletion Shared.IntegrationTesting/ContainerType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ public enum ContainerType
TransactionProcessor,
FileProcessor,
TransactionProcessorAcl,
Keycloak,
NotSet
}
4 changes: 1 addition & 3 deletions Shared.IntegrationTesting/DockerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
TestHost = 32,
TransactionProcessor = 64,
FileProcessor = 128,
TransactionProcessorAcl = 256,
KeyCloak = 512
TransactionProcessorAcl = 256
}

public abstract class DockerHelper : BaseDockerHelper
Expand Down Expand Up @@ -123,7 +122,6 @@
await StartContainer2(this.SetupTransactionProcessorContainer, networks, DockerServices.TransactionProcessor);
await StartContainer2(this.SetupFileProcessorContainer, networks, DockerServices.FileProcessor);
await StartContainer2(this.SetupTransactionProcessorAclContainer, networks, DockerServices.TransactionProcessorAcl);
await StartContainer2(this.SetupKeycloakContainer, networks, DockerServices.KeyCloak);

await this.LoadEventStoreProjections();

Expand All @@ -146,7 +144,7 @@
}
}

public override async Task StopContainersForScenarioRun(DockerServices sharedDockerServices) {

Check warning on line 147 in Shared.IntegrationTesting/DockerHelper.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Linux

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
if (this.Containers.Any()) {
this.Containers.Reverse();

Expand Down
2 changes: 0 additions & 2 deletions Shared.IntegrationTesting/DockerPorts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@ public static class DockerPorts
public static readonly Int32 TransactionProcessorAclDockerPort = 5003;

public static readonly Int32 TransactionProcessorDockerPort = 5002;

public static readonly Int32 KeyCloakDockerPort = 8080;
}
Loading