Skip to content

Commit

Permalink
Merge branch 'feature/influxdb' of github.com:MelomanG/testcontainers…
Browse files Browse the repository at this point in the history
…-dotnet into feature/influxdb
  • Loading branch information
MelomanG committed Aug 16, 2023
2 parents 1d06f51 + 3700b69 commit dca7321
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 37 deletions.
28 changes: 14 additions & 14 deletions Testcontainers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearc
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventStoreDb", "src\Testcontainers.EventStoreDb\Testcontainers.EventStoreDb.csproj", "{84D707E0-C9FA-4327-85DC-0AFEBEA73572}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.InfluxDb", "src\Testcontainers.InfluxDb\Testcontainers.InfluxDb.csproj", "{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.K3s", "src\Testcontainers.K3s\Testcontainers.K3s.csproj", "{111B840F-9DB0-4166-83E6-0580FD418F07}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kafka", "src\Testcontainers.Kafka\Testcontainers.Kafka.csproj", "{E93E40CE-59AA-4561-9B4C-E7B0A686326E}"
Expand Down Expand Up @@ -87,6 +89,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearc
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventStoreDb.Tests", "tests\Testcontainers.EventStoreDb.Tests\Testcontainers.EventStoreDb.Tests.csproj", "{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.InfluxDb.Tests", "tests\Testcontainers.InfluxDb.Tests\Testcontainers.InfluxDb.Tests.csproj", "{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.K3s.Tests", "tests\Testcontainers.K3s.Tests\Testcontainers.K3s.Tests.csproj", "{F0F40AE2-70FF-4191-ADDA-26A19E0D1A0F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kafka.Tests", "tests\Testcontainers.Kafka.Tests\Testcontainers.Kafka.Tests.csproj", "{6F2AEE03-629A-4B49-BD5B-25CA3C61FFB7}"
Expand Down Expand Up @@ -133,10 +137,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Tests", "tes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.WebDriver.Tests", "tests\Testcontainers.WebDriver.Tests\Testcontainers.WebDriver.Tests.csproj", "{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.InfluxDb", "src\Testcontainers.InfluxDb\Testcontainers.InfluxDb.csproj", "{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.InfluxDb.Tests", "tests\Testcontainers.InfluxDb.Tests\Testcontainers.InfluxDb.Tests.csproj", "{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -178,6 +178,10 @@ Global
{84D707E0-C9FA-4327-85DC-0AFEBEA73572}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84D707E0-C9FA-4327-85DC-0AFEBEA73572}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84D707E0-C9FA-4327-85DC-0AFEBEA73572}.Release|Any CPU.Build.0 = Release|Any CPU
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Release|Any CPU.Build.0 = Release|Any CPU
{111B840F-9DB0-4166-83E6-0580FD418F07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{111B840F-9DB0-4166-83E6-0580FD418F07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{111B840F-9DB0-4166-83E6-0580FD418F07}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -294,6 +298,10 @@ Global
{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}.Release|Any CPU.Build.0 = Release|Any CPU
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}.Release|Any CPU.Build.0 = Release|Any CPU
{F0F40AE2-70FF-4191-ADDA-26A19E0D1A0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0F40AE2-70FF-4191-ADDA-26A19E0D1A0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0F40AE2-70FF-4191-ADDA-26A19E0D1A0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -386,14 +394,6 @@ Global
{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}.Release|Any CPU.Build.0 = Release|Any CPU
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Release|Any CPU.Build.0 = Release|Any CPU
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3F2E254F-C203-43FD-A078-DC3E2CBC0F9F} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
Expand All @@ -404,6 +404,7 @@ Global
{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{641DDEA5-B6E0-41E6-BA11-7A28C0913127} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{84D707E0-C9FA-4327-85DC-0AFEBEA73572} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{111B840F-9DB0-4166-83E6-0580FD418F07} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{E93E40CE-59AA-4561-9B4C-E7B0A686326E} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{AA8834A3-82A7-4E83-8E4C-88D37F74056A} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
Expand Down Expand Up @@ -433,6 +434,7 @@ Global
{101515E6-74C1-40F9-85C8-871F742A378D} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{DD5B3678-468F-4D73-AECE-705E3D66CD43} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{F0F40AE2-70FF-4191-ADDA-26A19E0D1A0F} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{6F2AEE03-629A-4B49-BD5B-25CA3C61FFB7} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{4827D606-89D5-4E00-8341-47A6E95817BA} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
Expand All @@ -456,7 +458,5 @@ Global
{1A1983E6-5297-435F-B467-E8E1F11277D6} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{27CDB869-A150-4593-958F-6F26E5391E7C} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{B45B0EF2-5852-4ED3-904A-8FC62A3253D7} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
EndGlobalSection
EndGlobal
14 changes: 6 additions & 8 deletions src/Testcontainers.InfluxDb/InfluxDbBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace Testcontainers.InfluxDb;
namespace Testcontainers.InfluxDb;

/// <inheritdoc cref="ContainerBuilder{TBuilderEntity, TContainerEntity, TConfigurationEntity}" />
[PublicAPI]
public sealed class InfluxDbBuilder : ContainerBuilder<InfluxDbBuilder, InfluxDbContainer, InfluxDbConfiguration>
{
public const string InfluxDbImage = "influxdb:2.7.1";
public const string InfluxDbImage = "influxdb:2.7";

public const ushort InfluxDbPort = 8086;

Expand Down Expand Up @@ -35,7 +37,7 @@ private InfluxDbBuilder(InfluxDbConfiguration resourceConfiguration)

/// <inheritdoc />
protected override InfluxDbConfiguration DockerResourceConfiguration { get; }

/// <summary>
/// Sets the InfluxDb username.
/// </summary>
Expand Down Expand Up @@ -109,7 +111,6 @@ public override InfluxDbContainer Build()
return new InfluxDbContainer(DockerResourceConfiguration, TestcontainersSettings.Logger);
}


/// <inheritdoc />
protected override InfluxDbBuilder Init()
{
Expand All @@ -122,10 +123,7 @@ protected override InfluxDbBuilder Init()
.WithOrganization(DefaultOrganization)
.WithBucket(DefaultBucket)
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
request
.ForPort(InfluxDbPort)
.ForPath("/ping")
.ForStatusCodeMatching(statusCode => statusCode == System.Net.HttpStatusCode.NoContent)));
request.ForPort(InfluxDbPort).ForPath("/ping").ForStatusCode(HttpStatusCode.NoContent)));
}

/// <inheritdoc />
Expand Down
4 changes: 2 additions & 2 deletions src/Testcontainers.InfluxDb/InfluxDbConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Testcontainers.InfluxDb;
namespace Testcontainers.InfluxDb;

/// <inheritdoc cref="DockerContainer" />
/// <inheritdoc cref="ContainerConfiguration" />
[PublicAPI]
public sealed class InfluxDbConfiguration : ContainerConfiguration
{
Expand Down
5 changes: 3 additions & 2 deletions src/Testcontainers.InfluxDb/InfluxDbContainer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Testcontainers.InfluxDb;
namespace Testcontainers.InfluxDb;

/// <inheritdoc cref="DockerContainer" />
[PublicAPI]
Expand All @@ -9,7 +9,8 @@ public sealed class InfluxDbContainer : DockerContainer
/// </summary>
/// <param name="configuration">The container configuration.</param>
/// <param name="logger">The logger.</param>
public InfluxDbContainer(InfluxDbConfiguration configuration, ILogger logger) : base(configuration, logger)
public InfluxDbContainer(InfluxDbConfiguration configuration, ILogger logger)
: base(configuration, logger)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Testcontainers.InfluxDb/Testcontainers.InfluxDb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
<ItemGroup>
<ProjectReference Include="$(SolutionDir)src/Testcontainers/Testcontainers.csproj"/>
</ItemGroup>
</Project>
</Project>
1 change: 1 addition & 0 deletions src/Testcontainers.InfluxDb/Usings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
global using System;
global using System.Net;
global using Docker.DotNet.Models;
global using DotNet.Testcontainers;
global using DotNet.Testcontainers.Builders;
Expand Down
5 changes: 3 additions & 2 deletions tests/Testcontainers.InfluxDb.Tests/InfluxDbContainerTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Testcontainers.InfluxDb.Tests;
namespace Testcontainers.InfluxDb;

public sealed class InfluxDbContainerTest : IAsyncLifetime
{
Expand Down Expand Up @@ -31,7 +31,8 @@ public async Task PingReturnsTrue()
using var client = new InfluxDBClient(_influxDbContainer.GetAddress(), Token);

// When
var result = await client.PingAsync();
var result = await client.PingAsync()
.ConfigureAwait(false);

// Then
Assert.True(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<IsPublishable>false</IsPublishable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="InfluxDB.Client" Version="4.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1"/>
<PackageReference Include="coverlet.collector" Version="3.2.0"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="InfluxDB.Client" Version="4.12.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)src/Testcontainers.InfluxDb/Testcontainers.InfluxDb.csproj" />
<ProjectReference Include="$(SolutionDir)tests/Testcontainers.Commons/Testcontainers.Commons.csproj" />
<ProjectReference Include="$(SolutionDir)src/Testcontainers.InfluxDb/Testcontainers.InfluxDb.csproj"/>
<ProjectReference Include="$(SolutionDir)tests/Testcontainers.Commons/Testcontainers.Commons.csproj"/>
</ItemGroup>
</Project>
</Project>

0 comments on commit dca7321

Please sign in to comment.