Skip to content

Commit

Permalink
Fixup the broken tests and the deps mess
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari committed May 6, 2024
1 parent ae19982 commit d48ae09
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 131 deletions.
13 changes: 6 additions & 7 deletions src/NexusMods.MnemonicDB.Storage/DatomStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,14 @@ public async Task<StoreResult> Transact(IndexSegment datoms, HashSet<ITxFunction
if (!_txChannel.Writer.TryWrite(pending))
throw new InvalidOperationException("Failed to write to the transaction channel");

try
{
return await pending.CompletionSource.Task.WaitAsync(TransactionTimeout);
}
catch (TimeoutException ex)
var task = pending.CompletionSource.Task;
if (await Task.WhenAny(task, Task.Delay(TransactionTimeout)) == task)
{
_logger.LogError(ex, "After waiting for transaction to complete for {TimeoutSpan}", TransactionTimeout);
throw;
return await task;
}
_logger.LogError("Transaction didn't complete after {Timeout}", TransactionTimeout);
throw new TimeoutException($"Transaction didn't complete after {TransactionTimeout}");

}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LinqGen" Version="0.3.1"/>
<PackageReference Include="LinqGen.Generator" Version="0.3.1"/>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1"/>
<PackageReference Include="Reloaded.Memory" Version="9.4.1"/>
<PackageReference Include="RocksDB" Version="8.11.3.46984"/>
Expand Down
18 changes: 6 additions & 12 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Moq" Version="4.*"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.*"/>
<PackageReference Include="AutoFixture.AutoMoq" Version="4.*"/>
<PackageReference Include="AutoFixture.Xunit2" Version="4.*"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.*"/>
<PackageReference Include="FluentAssertions.OneOf" Version="0.0.5"/>
Expand All @@ -26,15 +16,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.4.*"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.*">
<PackageReference Include="xunit" Version="2.8.0"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Xunit.SkippableFact" Version="1.4.*"/>
<PackageReference Include="Xunit.DependencyInjection" Version="8.*"/>
<PackageReference Include="Xunit.DependencyInjection.Logging" Version="8.*"/>
<PackageReference Include="Xunit.DependencyInjection.SkippableFact" Version="8.*"/>
<PackageReference Include="NexusMods.Hashing.xxHash64"/>
<PackageReference Include="Argon" Version="0.17.0"/>
<PackageReference Include="Verify" Version="24.1.0"/>
<PackageReference Include="Verify.Xunit" Version="24.1.0"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,6 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Update="JetBrains.Annotations" Version="2023.3.0"/>
<PackageReference Update="Moq" Version="4.20.70"/>
<PackageReference Update="AutoFixture" Version="4.18.1"/>
<PackageReference Update="AutoFixture.AutoMoq" Version="4.18.1"/>
<PackageReference Update="AutoFixture.Xunit2" Version="4.18.1"/>
<PackageReference Update="FluentAssertions" Version="6.12.0"/>
<PackageReference Update="FluentAssertions.Analyzers" Version="0.31.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="xunit" Version="2.8.0" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Xunit.SkippableFact" Version="1.4.13"/>
<PackageReference Update="Xunit.DependencyInjection" Version="9.2.1" />
<PackageReference Update="Xunit.DependencyInjection.Logging" Version="9.0.0"/>
<PackageReference Update="Xunit.DependencyInjection.SkippableFact" Version="9.0.0"/>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.9.0"/>
<PackageReference Update="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="GitHubActionsTestLogger" Version="2.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NexusMods.MnemonicDB.Storage\NexusMods.MnemonicDB.Storage.csproj"/>
<ProjectReference Include="..\NexusMods.MnemonicDB.TestModel\NexusMods.MnemonicDB.TestModel.csproj"/>
Expand All @@ -67,4 +26,8 @@
<None Remove="InMemoryTests.CanStoreDataInBlobs.verified.txt" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Verify" Version="24.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,4 @@
<ProjectReference Include="..\..\src\NexusMods.MnemonicDB.Abstractions\NexusMods.MnemonicDB.Abstractions.csproj"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="NexusMods.Hashing.xxHash64" Version="2.0.1" />
<PackageReference Include="NexusMods.Paths" Version="0.9.4" />
<PackageReference Update="JetBrains.Annotations" Version="2023.3.0"/>
<PackageReference Update="Moq" Version="4.20.70"/>
<PackageReference Update="AutoFixture" Version="4.18.1"/>
<PackageReference Update="AutoFixture.AutoMoq" Version="4.18.1"/>
<PackageReference Update="AutoFixture.Xunit2" Version="4.18.1"/>
<PackageReference Update="FluentAssertions" Version="6.12.0"/>
<PackageReference Update="FluentAssertions.Analyzers" Version="0.31.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="xunit" Version="2.8.0" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Xunit.SkippableFact" Version="1.4.13"/>
<PackageReference Update="Xunit.DependencyInjection" Version="9.2.1" />
<PackageReference Update="Xunit.DependencyInjection.Logging" Version="9.0.0"/>
<PackageReference Update="Xunit.DependencyInjection.SkippableFact" Version="9.0.0"/>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.9.0"/>
<PackageReference Update="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="GitHubActionsTestLogger" Version="2.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Verify.Xunit" Version="24.1.0" />
</ItemGroup>

</Project>
33 changes: 0 additions & 33 deletions tests/NexusMods.MnemonicDB.Tests/NexusMods.MnemonicDB.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,6 @@
<RootNamespace>NexusMods.MnemonicDB.Tests</RootNamespace>
</PropertyGroup>


<ItemGroup>
<PackageReference Update="FluentAssertions" Version="6.12.0"/>
<PackageReference Update="FluentAssertions.Analyzers" Version="0.31.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="xunit" Version="2.8.0" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="JetBrains.Annotations" Version="2023.3.0"/>
<PackageReference Update="Moq" Version="4.20.70"/>
<PackageReference Update="AutoFixture" Version="4.18.1"/>
<PackageReference Update="AutoFixture.AutoMoq" Version="4.18.1"/>
<PackageReference Update="AutoFixture.Xunit2" Version="4.18.1"/>
<PackageReference Update="Xunit.SkippableFact" Version="1.4.13"/>
<PackageReference Update="Xunit.DependencyInjection" Version="9.2.1" />
<PackageReference Update="Xunit.DependencyInjection.Logging" Version="9.0.0"/>
<PackageReference Update="Xunit.DependencyInjection.SkippableFact" Version="9.0.0"/>
<PackageReference Update="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="GitHubActionsTestLogger" Version="2.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Verify.Xunit" Version="24.1.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.9.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NexusMods.MnemonicDB\NexusMods.MnemonicDB.csproj"/>
<ProjectReference Include="..\NexusMods.MnemonicDB.TestModel\NexusMods.MnemonicDB.TestModel.csproj"/>
Expand Down
2 changes: 0 additions & 2 deletions tests/SharedUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

global using Xunit;
global using FluentAssertions;
global using AutoFixture;
global using AutoFixture.Xunit2;
using System.Runtime.CompilerServices;
using NexusMods.MnemonicDB.TestModel.Helpers;

Expand Down

0 comments on commit d48ae09

Please sign in to comment.