Skip to content

Commit

Permalink
Migrate ArangoDb and MariaDb tests to xunit.v3
Browse files Browse the repository at this point in the history
  • Loading branch information
0xced committed Nov 23, 2024
1 parent 3fe8dc1 commit f000789
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
<PackageVersion Include="Dapper" Version="2.1.35"/>
<PackageVersion Include="ReflectionMagic" Version="5.0.1"/>
<PackageVersion Include="xunit.extensibility.execution" Version="2.9.0"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2"/>
<PackageVersion Include="xunit.v3.extensibility.core" Version="0.2.0-pre.69"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0-pre.49"/>
<PackageVersion Include="xunit" Version="2.9.2"/>
<PackageVersion Include="xunit.v3" Version="0.6.0-pre.7"/>
<PackageVersion Include="xunit.v3.extensibility.core" Version="0.6.0-pre.7"/>
<!-- Third-party client dependencies to connect and interact with the containers: -->
<PackageVersion Include="Apache.NMS.ActiveMQ" Version="2.1.0"/>
<PackageVersion Include="ArangoDBNetStandard" Version="2.0.1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public async Task RetrievesDatabases()
using var client = new ArangoDBClient(transport);

// When
var response = await client.Database.GetDatabasesAsync()
var response = await client.Database.GetDatabasesAsync(TestContext.Current.CancellationToken)
.ConfigureAwait(true);

// Then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="coverlet.collector"/>
<PackageReference Include="xunit.runner.visualstudio"/>
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.v3"/>
<PackageReference Include="ArangoDBNetStandard"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../src/Testcontainers.ArangoDb/Testcontainers.ArangoDb.csproj"/>
<ProjectReference Include="../../src/Testcontainers.Xunit/Testcontainers.Xunit.csproj" />
<ProjectReference Include="../../src/Testcontainers.XunitV3/Testcontainers.XunitV3.csproj" />
<ProjectReference Include="../Testcontainers.Commons/Testcontainers.Commons.csproj"/>
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions tests/Testcontainers.ArangoDb.Tests/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
global using ArangoDBNetStandard.Transport.Http;
global using DotNet.Testcontainers.Commons;
global using Testcontainers.Xunit;
global using Xunit;
global using Xunit.Abstractions;
global using Xunit;
1 change: 0 additions & 1 deletion tests/Testcontainers.Commons/Testcontainers.Commons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" VersionOverride="2023.3.0"/>
<PackageReference Include="xunit"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../src/Testcontainers/Testcontainers.csproj"/>
Expand Down
1 change: 0 additions & 1 deletion tests/Testcontainers.Commons/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
global using DotNet.Testcontainers.Containers;
global using DotNet.Testcontainers.Images;
global using JetBrains.Annotations;
global using Xunit;
2 changes: 1 addition & 1 deletion tests/Testcontainers.MariaDb.Tests/MariaDbContainerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public async Task ExecScriptReturnsSuccessful()
const string scriptContent = "SELECT 1;";

// When
var execResult = await mariaDbFixture.Container.ExecScriptAsync(scriptContent)
var execResult = await mariaDbFixture.Container.ExecScriptAsync(scriptContent, TestContext.Current.CancellationToken)
.ConfigureAwait(true);

// Then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="coverlet.collector"/>
<PackageReference Include="xunit.runner.visualstudio"/>
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.v3"/>
<PackageReference Include="MySqlConnector"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../src/Testcontainers.MariaDb/Testcontainers.MariaDb.csproj"/>
<ProjectReference Include="../../src/Testcontainers.Xunit/Testcontainers.Xunit.csproj" />
<ProjectReference Include="../../src/Testcontainers.XunitV3/Testcontainers.XunitV3.csproj" />
<ProjectReference Include="../Testcontainers.Commons/Testcontainers.Commons.csproj"/>
</ItemGroup>
<ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion tests/Testcontainers.MariaDb.Tests/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
global using MySqlConnector;
global using Testcontainers.Xunit;
global using Xunit;
global using Xunit.Abstractions;
global using Xunit.Sdk;
4 changes: 4 additions & 0 deletions tests/Testcontainers.MariaDb.Tests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"diagnosticMessages": true
}

0 comments on commit f000789

Please sign in to comment.