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 .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true
},
"ghcr.io/devcontainers/features/dotnet:2.4.1": {
"ghcr.io/devcontainers/features/dotnet:2.4.2": {
"version": "10.0",
"installUsingApt": false
}
Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.ActiveMq/ActiveMqConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.ActiveMq;

/// <summary>
/// Provides the ActiveMq connection string.
/// </summary>
internal sealed class ActiveMqConnectionStringProvider : ContainerConnectionStringProvider<ArtemisContainer, ActiveMqConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetBrokerAddress();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.ActiveMq/ArtemisBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ protected override ArtemisBuilder Init()
.WithPortBinding(ArtemisConsolePort, true)
.WithUsername(DefaultUsername)
.WithPassword(DefaultPassword)
.WithConnectionStringProvider(new ActiveMqConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("HTTP Server started"));
}

Expand Down
1 change: 1 addition & 0 deletions src/Testcontainers.ArangoDb/ArangoDbBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ protected override ArangoDbBuilder Init()
return base.Init()
.WithPortBinding(ArangoDbPort, true)
.WithPassword(DefaultPassword)
.WithConnectionStringProvider(new ArangoDbConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("Have fun!"));
}

Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.ArangoDb/ArangoDbConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.ArangoDb;

/// <summary>
/// Provides the ArangoDb connection string.
/// </summary>
internal sealed class ArangoDbConnectionStringProvider : ContainerConnectionStringProvider<ArangoDbContainer, ArangoDbConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetTransportAddress();
}
}
3 changes: 2 additions & 1 deletion src/Testcontainers.Azurite/AzuriteBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ protected override AzuriteBuilder Init()
.WithPortBinding(QueuePort, true)
.WithPortBinding(TablePort, true)
.WithEntrypoint("azurite")
.WithCommand("--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0");
.WithCommand("--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0")
.WithConnectionStringProvider(new AzuriteConnectionStringProvider());
}

/// <inheritdoc />
Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.Azurite/AzuriteConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.Azurite;

/// <summary>
/// Provides the Azurite connection string.
/// </summary>
internal sealed class AzuriteConnectionStringProvider : ContainerConnectionStringProvider<AzuriteContainer, AzuriteConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.BigQuery/BigQueryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ protected override BigQueryBuilder Init()
return base.Init()
.WithPortBinding(BigQueryPort, true)
.WithProject(DefaultProjectId)
.WithConnectionStringProvider(new BigQueryConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("(?s).*listening.*$"));
}

Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.BigQuery/BigQueryConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.BigQuery;

/// <summary>
/// Provides the BigQuery connection string.
/// </summary>
internal sealed class BigQueryConnectionStringProvider : ContainerConnectionStringProvider<BigQueryContainer, BigQueryConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetEmulatorEndpoint();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.Bigtable/BigtableBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ protected override BigtableBuilder Init()
.WithPortBinding(BigtablePort, true)
.WithEntrypoint("gcloud")
.WithCommand("beta", "emulators", "bigtable", "start", "--host-port", "0.0.0.0:" + BigtablePort)
.WithConnectionStringProvider(new BigtableConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("(?s).*running.*$"));
}

Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.Bigtable/BigtableConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.Bigtable;

/// <summary>
/// Provides the Bigtable connection string.
/// </summary>
internal sealed class BigtableConnectionStringProvider : ContainerConnectionStringProvider<BigtableContainer, BigtableConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetEmulatorEndpoint();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.Cassandra/CassandraBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ protected override CassandraBuilder Init()
.WithEnvironment("CASSANDRA_SNITCH", "GossipingPropertyFileSnitch")
.WithEnvironment("CASSANDRA_ENDPOINT_SNITCH", "GossipingPropertyFileSnitch")
.WithEnvironment("CASSANDRA_DC", DefaultDatacenterName)
.WithConnectionStringProvider(new CassandraConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("Startup complete"));
}

Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.Cassandra/CassandraConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.Cassandra;

/// <summary>
/// Provides the Cassandra connection string.
/// </summary>
internal sealed class CassandraConnectionStringProvider : ContainerConnectionStringProvider<CassandraContainer, CassandraConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.ClickHouse/ClickHouseBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ protected override ClickHouseBuilder Init()
.WithDatabase(DefaultDatabase)
.WithUsername(DefaultUsername)
.WithPassword(DefaultPassword)
.WithConnectionStringProvider(new ClickHouseConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
request.ForPort(HttpPort).ForResponseMessageMatching(IsNodeReadyAsync)));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.ClickHouse;

/// <summary>
/// Provides the ClickHouse connection string.
/// </summary>
internal sealed class ClickHouseConnectionStringProvider : ContainerConnectionStringProvider<ClickHouseContainer, ClickHouseConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.CockroachDb/CockroachDbBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ protected override CockroachDbBuilder Init()
.WithPassword(DefaultPassword)
.WithCommand("start-single-node")
.WithCommand("--insecure")
.WithConnectionStringProvider(new CockroachDbConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
request.ForPort(CockroachDbRestPort).ForPath("/health")));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.CockroachDb;

/// <summary>
/// Provides the CockroachDb connection string.
/// </summary>
internal sealed class CockroachDbConnectionStringProvider : ContainerConnectionStringProvider<CockroachDbContainer, CockroachDbConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.Consul/ConsulBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ protected override ConsulBuilder Init()
.WithPortBinding(ConsulGrpcPort, true)
.WithCommand("agent", "-dev", "-client", "0.0.0.0")
.WithCreateParameterModifier(cmd => cmd.HostConfig.CapAdd = new[] { "IPC_LOCK" })
.WithConnectionStringProvider(new ConsulConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
request.ForPath("/v1/status/leader").ForPort(ConsulHttpPort)));
}
Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.Consul/ConsulConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.Consul;

/// <summary>
/// Provides the Consul connection string.
/// </summary>
internal sealed class ConsulConnectionStringProvider : ContainerConnectionStringProvider<ConsulContainer, ConsulConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetBaseAddress();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.CosmosDb/CosmosDbBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ protected override CosmosDbBuilder Init()
{
return base.Init()
.WithPortBinding(CosmosDbPort, true)
.WithConnectionStringProvider(new CosmosDbConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().AddCustomWaitStrategy(new WaitUntil()));
}

Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.CosmosDb/CosmosDbConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.CosmosDb;

/// <summary>
/// Provides the CosmosDb connection string.
/// </summary>
internal sealed class CosmosDbConnectionStringProvider : ContainerConnectionStringProvider<CosmosDbContainer, CosmosDbConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.CouchDb/CouchDbBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ protected override CouchDbBuilder Init()
.WithPortBinding(CouchDbPort, true)
.WithUsername(DefaultUsername)
.WithPassword(DefaultPassword)
.WithConnectionStringProvider(new CouchDbConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
request.ForPath("/").ForPort(CouchDbPort)));
}
Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.CouchDb/CouchDbConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.CouchDb;

/// <summary>
/// Provides the CouchDb connection string.
/// </summary>
internal sealed class CouchDbConnectionStringProvider : ContainerConnectionStringProvider<CouchDbContainer, CouchDbConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.Couchbase/CouchbaseBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ protected override CouchbaseBuilder Init()
.WithPortBinding(KvPort, true)
.WithPortBinding(KvSslPort, true)
.WithBucket(CouchbaseBucket.Default)
.WithConnectionStringProvider(new CouchbaseConnectionStringProvider())
.WithStartupCallback(ConfigureCouchbaseAsync);
}

Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.Couchbase/CouchbaseConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.Couchbase;

/// <summary>
/// Provides the Couchbase connection string.
/// </summary>
internal sealed class CouchbaseConnectionStringProvider : ContainerConnectionStringProvider<CouchbaseContainer, CouchbaseConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.Db2/Db2Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ protected override Db2Builder Init() => base.Init()
.WithUsername(DefaultUsername)
.WithPassword(DefaultPassword)
.WithPrivileged(true)
.WithConnectionStringProvider(new Db2ConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("Setup has completed."));

/// <inheritdoc />
Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.Db2/Db2ConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.Db2;

/// <summary>
/// Provides the Db2 connection string.
/// </summary>
internal sealed class Db2ConnectionStringProvider : ContainerConnectionStringProvider<Db2Container, Db2Configuration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.DynamoDb/DynamoDbBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected override DynamoDbBuilder Init()
{
return base.Init()
.WithPortBinding(DynamoDbPort, true)
.WithConnectionStringProvider(new DynamoDbConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
request.ForPath("/").ForPort(DynamoDbPort).ForStatusCode(HttpStatusCode.BadRequest)));
}
Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.DynamoDb/DynamoDbConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.DynamoDb;

/// <summary>
/// Provides the DynamoDb connection string.
/// </summary>
internal sealed class DynamoDbConnectionStringProvider : ContainerConnectionStringProvider<DynamoDbContainer, DynamoDbConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
3 changes: 2 additions & 1 deletion src/Testcontainers.Elasticsearch/ElasticsearchBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ protected override ElasticsearchBuilder Init()
.WithPassword(DefaultPassword)
.WithEnvironment("discovery.type", "single-node")
.WithEnvironment("ingest.geoip.downloader.enabled", "false")
.WithResourceMapping(DefaultMemoryVmOption, ElasticsearchDefaultMemoryVmOptionFilePath);
.WithResourceMapping(DefaultMemoryVmOption, ElasticsearchDefaultMemoryVmOptionFilePath)
.WithConnectionStringProvider(new ElasticsearchConnectionStringProvider());
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.Elasticsearch;

/// <summary>
/// Provides the Elasticsearch connection string.
/// </summary>
internal sealed class ElasticsearchConnectionStringProvider : ContainerConnectionStringProvider<ElasticsearchContainer, ElasticsearchConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.EventHubs/EventHubsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ protected override EventHubsBuilder Init()
return base.Init()
.WithPortBinding(EventHubsPort, true)
.WithPortBinding(EventHubsHttpPort, true)
.WithConnectionStringProvider(new EventHubsConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer()
// https://github.com/Azure/azure-event-hubs-emulator-installer/issues/69#issuecomment-3762895979.
.UntilMessageIsLogged("Emulator Service is Successfully Up!")
Expand Down
13 changes: 13 additions & 0 deletions src/Testcontainers.EventHubs/EventHubsConnectionStringProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Testcontainers.EventHubs;

/// <summary>
/// Provides the Event Hubs connection string.
/// </summary>
internal sealed class EventHubsConnectionStringProvider : ContainerConnectionStringProvider<EventHubsContainer, EventHubsConfiguration>
{
/// <inheritdoc />
protected override string GetHostConnectionString()
{
return Container.GetConnectionString();
}
}
1 change: 1 addition & 0 deletions src/Testcontainers.FakeGcsServer/FakeGcsServerBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ protected override FakeGcsServerBuilder Init()
.WithPortBinding(FakeGcsServerPort, true)
.WithEntrypoint("/bin/sh", "-c")
.WithCommand("while [ ! -f " + StartupScriptFilePath + " ]; do sleep 0.1; done; " + StartupScriptFilePath)
.WithConnectionStringProvider(new FakeGcsServerConnectionStringProvider())
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("server started"))
.WithStartupCallback((container, ct) =>
{
Expand Down
Loading
Loading