Skip to content

Commit

Permalink
v24 release
Browse files Browse the repository at this point in the history
  • Loading branch information
dj-nitehawk committed Nov 21, 2024
1 parent 65dddf0 commit e58eb70
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup .Net SDK
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.x
dotnet-version: 9.x

- name: Make Nuget Packages
run: dotnet pack MongoDB.Entities/MongoDB.Entities.csproj -c Release
Expand Down
2 changes: 1 addition & 1 deletion Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion MongoDB.Entities/MongoDB.Entities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>

<Version>23.2.0.1-beta</Version>
<Version>24.0.0</Version>

<TargetFramework>netstandard2.1</TargetFramework>
<RootNamespace>MongoDB.Entities</RootNamespace>
Expand Down
8 changes: 4 additions & 4 deletions Tests/Init.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ namespace MongoDB.Entities.Tests;
public static class InitTest
{
static MongoClientSettings ClientSettings { get; set; }
static bool UseTestContainers;
static bool _useTestContainers;

[AssemblyInitialize]
public static async Task Init(TestContext _)
{
BsonSerializer.RegisterSerializer(new GuidSerializer(GuidRepresentation.Standard));

UseTestContainers = System.Environment.GetEnvironmentVariable("MONGODB_ENTITIES_TESTCONTAINERS") != null;
_useTestContainers = System.Environment.GetEnvironmentVariable("MONGODB_ENTITIES_TESTCONTAINERS") != null;

if (UseTestContainers)
if (_useTestContainers)
{
var testContainer = await TestDatabase.CreateDatabase();
ClientSettings = MongoClientSettings.FromConnectionString(testContainer.GetConnectionString());
Expand All @@ -31,7 +31,7 @@ public static async Task Init(TestContext _)

public static async Task InitTestDatabase(string databaseName)
{
if (UseTestContainers)
if (_useTestContainers)
await DB.InitAsync(databaseName, ClientSettings);
else
await DB.InitAsync(databaseName);
Expand Down
8 changes: 4 additions & 4 deletions Tests/TestDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

public static class TestDatabase
{
private static SemaphoreSlim _semaphore = new(1, 1);
private static readonly SemaphoreSlim _semaphore = new(1, 1);
private static MongoDbContainer? _testContainer;

public static async Task<MongoDbContainer> CreateDatabase()
{
await _semaphore.WaitAsync();

try
{
var database = await CreateTestDatabase();
Expand All @@ -25,9 +26,8 @@ public static async Task<MongoDbContainer> CreateDatabase()
private static async Task<MongoDbContainer> CreateTestDatabase()
{
if (_testContainer != null)
{
return _testContainer;
}

_testContainer = new MongoDbBuilder()
.WithPortBinding(27017)
.WithPassword("username")
Expand All @@ -36,7 +36,7 @@ private static async Task<MongoDbContainer> CreateTestDatabase()
.Build();

await _testContainer.StartAsync();

return _testContainer;
}
}
12 changes: 6 additions & 6 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>MongoDB.Entities.Tests</AssemblyName>
<RootNamespace>MongoDB.Entities.Tests</RootNamespace>
Expand All @@ -10,11 +10,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Medo.Uuid7" Version="2.0.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
<PackageReference Include="MSTest.TestAdapter" Version="3.6.1"/>
<PackageReference Include="MSTest.TestFramework" Version="3.6.1"/>
<PackageReference Include="Testcontainers.MongoDb" Version="3.10.0"/>
<PackageReference Include="Medo.Uuid7" Version="2.1.1"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3"/>
<PackageReference Include="MSTest.TestFramework" Version="3.6.3"/>
<PackageReference Include="Testcontainers.MongoDb" Version="4.0.0"/>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
7 changes: 6 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

- upgrade to mongodb driver v3.0

[//]: # (### IMPROVEMENTS)
> should be a pretty straightforward upgrade unless you're affected by any of the points mentioned in the driver [v3 upgrade guide](https://www.mongodb.com/docs/drivers/csharp/v3.0/upgrade/v3/).
### IMPROVEMENTS

- upgrade build pipeline to .net 9.0
- upgrade project dependencies to latest

[//]: # (### BREAKING CHANGES)

0 comments on commit e58eb70

Please sign in to comment.