Skip to content

Commit

Permalink
feat: Azure CosmosDB package
Browse files Browse the repository at this point in the history
Closes: #35
  • Loading branch information
samtrion committed Dec 17, 2024
1 parent 7058ec6 commit 8d980a3
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="Dapr.Client" Version="1.14.0" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.46.0" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.9.0" />
Expand All @@ -42,6 +43,7 @@
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="Testcontainers.Azurite" Version="4.1.0" />
<PackageVersion Include="Testcontainers.ClickHouse" Version="4.1.0" />
<PackageVersion Include="Testcontainers.CosmosDb" Version="4.1.0" />
<PackageVersion Include="Testcontainers.Kafka" Version="4.1.0" />
<PackageVersion Include="Testcontainers.MsSql" Version="4.1.0" />
<PackageVersion Include="Testcontainers.MySql" Version="4.1.0" />
Expand All @@ -60,4 +62,4 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.10" />
</ItemGroup>
</Project>
</Project>
15 changes: 15 additions & 0 deletions HealthChecks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.HealthChecks.Test
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.HealthChecks.Tests.Architecture", "tests\NetEvolve.HealthChecks.Tests.Architecture\NetEvolve.HealthChecks.Tests.Architecture.csproj", "{17BCA132-1FBB-46C1-B6A1-60F64969383D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.HealthChecks.Azure.Cosmos", "src\NetEvolve.HealthChecks.Azure.Cosmos\NetEvolve.HealthChecks.Azure.Cosmos.csproj", "{0014110E-EC85-4D97-BFC4-D1485511B4C1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -315,6 +317,18 @@ Global
{17BCA132-1FBB-46C1-B6A1-60F64969383D}.Release|x64.Build.0 = Release|Any CPU
{17BCA132-1FBB-46C1-B6A1-60F64969383D}.Release|x86.ActiveCfg = Release|Any CPU
{17BCA132-1FBB-46C1-B6A1-60F64969383D}.Release|x86.Build.0 = Release|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Debug|x64.ActiveCfg = Debug|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Debug|x64.Build.0 = Debug|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Debug|x86.ActiveCfg = Debug|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Debug|x86.Build.0 = Debug|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Release|Any CPU.Build.0 = Release|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Release|x64.ActiveCfg = Release|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Release|x64.Build.0 = Release|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Release|x86.ActiveCfg = Release|Any CPU
{0014110E-EC85-4D97-BFC4-D1485511B4C1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -340,6 +354,7 @@ Global
{66406BE8-0281-4C95-B90B-20CAE4516A16} = {E412EC77-2022-4A1D-AAC1-FDF1A4A45827}
{2B089420-E791-44E7-B471-F6F527B33E1C} = {E412EC77-2022-4A1D-AAC1-FDF1A4A45827}
{17BCA132-1FBB-46C1-B6A1-60F64969383D} = {E412EC77-2022-4A1D-AAC1-FDF1A4A45827}
{0014110E-EC85-4D97-BFC4-D1485511B4C1} = {EF615D18-42E2-48A4-8EBA-E652DC574C56}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28B4CC2B-39E8-49C0-9687-78121BD83A53}
Expand Down
3 changes: 3 additions & 0 deletions src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace NetEvolve.HealthChecks.Azure.Cosmos;

public class Class1 { }

Check warning on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / CodeQL / Run CodeQL

Missing XML comment for publicly visible type or member 'Class1'

Check warning on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / CodeQL / Run CodeQL

Missing XML comment for publicly visible type or member 'Class1'

Check warning on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / CodeQL / Run CodeQL

Missing XML comment for publicly visible type or member 'Class1'

Check warning on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / CodeQL / Run CodeQL

Missing XML comment for publicly visible type or member 'Class1'

Check failure on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

Missing XML comment for publicly visible type or member 'Class1'

Check failure on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

Remove this empty class, write its code or make it an "interface". (https://rules.sonarsource.com/csharp/RSPEC-2094)

Check failure on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

Missing XML comment for publicly visible type or member 'Class1'

Check failure on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

Remove this empty class, write its code or make it an "interface". (https://rules.sonarsource.com/csharp/RSPEC-2094)

Check failure on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

Missing XML comment for publicly visible type or member 'Class1'

Check failure on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

Remove this empty class, write its code or make it an "interface". (https://rules.sonarsource.com/csharp/RSPEC-2094)

Check failure on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

Missing XML comment for publicly visible type or member 'Class1'

Check failure on line 3 in src/NetEvolve.HealthChecks.Azure.Cosmos/Class1.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

Remove this empty class, write its code or make it an "interface". (https://rules.sonarsource.com/csharp/RSPEC-2094)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(_ProjectTargetFrameworks)</TargetFrameworks>

<Description>Contains HealthChecks for Azure CosmosDB.</Description>
<PackageTags>$(PackageTags);azure;cosmos;cosmosdb;</PackageTags>

<AzureCosmosDisableNewtonsoftJsonCheck>true</AzureCosmosDisableNewtonsoftJsonCheck>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Cosmos" />
<PackageReference Include="NetEvolve.Arguments" />
<PackageReference Include="NetEvolve.Extensions.Tasks" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NetEvolve.HealthChecks.Abstractions\NetEvolve.HealthChecks.Abstractions.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace NetEvolve.HealthChecks.Tests.Integration.Azure.Cosmos;

using System;
using System.Threading.Tasks;
using Testcontainers.CosmosDb;
using TestContainer = Testcontainers.CosmosDb.CosmosDbContainer;

public sealed class CosmosDbContainer : IAsyncLifetime, IAsyncDisposable
{
private readonly TestContainer _container = new CosmosDbBuilder().Build();

public async Task DisposeAsync() => await _container.DisposeAsync().ConfigureAwait(false);

public async Task InitializeAsync() => await _container.StartAsync().ConfigureAwait(false);

async ValueTask IAsyncDisposable.DisposeAsync() =>
await _container.DisposeAsync().ConfigureAwait(false);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<PackageReference Include="NetEvolve.Extensions.XUnit" />
<PackageReference Include="Testcontainers.Azurite" />
<PackageReference Include="Testcontainers.ClickHouse" />
<PackageReference Include="Testcontainers.CosmosDb" />
<PackageReference Include="Testcontainers.Kafka" />
<PackageReference Include="Testcontainers.MsSql" />
<PackageReference Include="Testcontainers.MySql" />
Expand Down

0 comments on commit 8d980a3

Please sign in to comment.