Skip to content

Commit

Permalink
Parallel Tests (#1931)
Browse files Browse the repository at this point in the history
* Delete all xunit.runner.json files

* Delete view tests that were constantly hanging

* Tests all pass

* Update verified files

* Try and speed up the slow job

* Try and fix the test again
  • Loading branch information
halgari authored Aug 23, 2024
1 parent 1daae19 commit ec5b644
Show file tree
Hide file tree
Showing 62 changed files with 105 additions and 1,307 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public void Dispose()
/// <inheritdoc />
public void SetupInstaller(string name)
{
throw new NotImplementedException();
throw new NotSupportedException("Cannot setup the installer, this is a null implementation");
}

/// <inheritdoc />
public void CleanupInstaller()
{
throw new NotImplementedException();
throw new NotSupportedException("Cannot cleanup the installer, this is a null implementation");
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\Abstractions\NexusMods.Abstractions.Games\NexusMods.Abstractions.Games.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\Abstractions\NexusMods.Abstractions.GuidedInstallers\NexusMods.Abstractions.GuidedInstallers.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\Abstractions\NexusMods.Abstractions.Installers\NexusMods.Abstractions.Installers.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\Abstractions\NexusMods.Abstractions.Installers\NexusMods.Abstractions.Installers.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\Extensions\NexusMods.Extensions.BCL\NexusMods.Extensions.BCL.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 16 additions & 2 deletions tests/Games/NexusMods.Games.FOMOD.Tests/FomodXmlInstallerTests.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
using FluentAssertions;
using FomodInstaller.Interface;
using Microsoft.Extensions.DependencyInjection;
using NexusMods.Abstractions.GameLocators;
using NexusMods.Abstractions.Loadouts;
using NexusMods.Games.RedEngine;
using NexusMods.Games.RedEngine.Cyberpunk2077;
using NexusMods.Games.TestFramework;
using NexusMods.Paths;
using NexusMods.StandardGameLocators.TestHelpers;
using Xunit.Abstractions;
using Xunit.Sdk;

namespace NexusMods.Games.FOMOD.Tests;

public class FomodXmlInstallerTests : ALibraryArchiveInstallerTests<Cyberpunk2077Game>
public class FomodXmlInstallerTests(ITestOutputHelper outputHelper) : ALibraryArchiveInstallerTests<FomodXmlInstallerTests, Cyberpunk2077Game>(outputHelper)
{
public FomodXmlInstallerTests(IServiceProvider serviceProvider) : base(serviceProvider) { }

protected override IServiceCollection AddServices(IServiceCollection services)
{
ConfigOptions.RegisterNullGuidedInstaller = false;
return base.AddServices(services)
.AddSingleton<ICoreDelegates, MockDelegates>()
.AddRedEngineGames()
.AddUniversalGameLocator<Cyberpunk2077Game>(new Version("1.6.1"));
}


private async Task<LoadoutItemGroup.ReadOnly> GetResultsFromDirectory(string testCase)
{
Expand Down
4 changes: 0 additions & 4 deletions tests/Games/NexusMods.Games.FOMOD.Tests/xunit.runner.json

This file was deleted.

4 changes: 0 additions & 4 deletions tests/Games/NexusMods.Games.Generic.Tests/xunit.runner.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
using NexusMods.Hashing.xxHash64;
using NexusMods.MnemonicDB.Abstractions.ElementComparers;
using NexusMods.Paths;
using Xunit.Abstractions;

namespace NexusMods.Games.RedEngine.Tests;

public class Cyberpunk2077DiagnosticTests(IServiceProvider serviceProvider) : AGameTest<Cyberpunk2077.Cyberpunk2077Game>(serviceProvider)
public class Cyberpunk2077DiagnosticTests(ITestOutputHelper outputHelper) : ACyberpunkIsolatedGameTest<Cyberpunk2077DiagnosticTests>(outputHelper)
{
public static string TemplateData(string diagnosticType) =>
diagnosticType switch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
using System.Runtime.CompilerServices;
using Microsoft.Extensions.DependencyInjection;
using NexusMods.Abstractions.GameLocators;
using NexusMods.Games.RedEngine.Cyberpunk2077;
using NexusMods.Games.RedEngine.ModInstallers;
using NexusMods.Games.TestFramework;
using NexusMods.Hashing.xxHash64;
using NexusMods.Paths;
using NexusMods.StandardGameLocators.TestHelpers;
using Xunit.Abstractions;
using Xunit.DependencyInjection;

namespace NexusMods.Games.RedEngine.Tests.LibraryArchiveInstallerTests;

public class PathBasedInstallerTests : ALibraryArchiveInstallerTests<Cyberpunk2077Game>
public class PathBasedInstallerTests(ITestOutputHelper outputHelper) : ALibraryArchiveInstallerTests<PathBasedInstallerTests, Cyberpunk2077Game>(outputHelper)
{
public PathBasedInstallerTests(IServiceProvider serviceProvider) : base(serviceProvider)
protected override IServiceCollection AddServices(IServiceCollection services)
{
return base.AddServices(services)
.AddRedEngineGames()
.AddUniversalGameLocator<Cyberpunk2077Game>(new Version("1.6.1"));
}

/// <summary>
/// Test cases, key is the name, the values are the archive file paths.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
+ | 0200000000000001 | Name | one_mod.7z | 0200000000000000
+ | 0200000000000001 | Loadout | 0200000000000002 | 0200000000000000
+ | 0200000000000001 | Group | Null | 0200000000000000
+ | 0200000000000003 | RedModInfoFile | 0200000000000004 | 0200000000000000
+ | 0200000000000003 | Name | Driver_Shotgun | 0200000000000000
+ | 0200000000000003 | Loadout | 0200000000000002 | 0200000000000000
+ | 0200000000000003 | Parent | 0200000000000001 | 0200000000000000
+ | 0200000000000003 | Group | Null | 0200000000000000
+ | 0200000000000004 | Name | Driver_Shotgun | 0200000000000000
+ | 0200000000000004 | Version | 1.0.0 | 0200000000000000
+ | 0200000000000003 | RedModInfoFile | 0200000000000004 | 0200000000000000
+ | 0200000000000004 | Name | info.json | 0200000000000000
+ | 0200000000000004 | Loadout | 0200000000000002 | 0200000000000000
+ | 0200000000000004 | Parent | 0200000000000003 | 0200000000000000
+ | 0200000000000004 | TargetPath | (0200000000000002, Game, mods/Driver_Shotguns/info.json) | 0200000000000000
+ | 0200000000000004 | Hash | 0x55FE2BFA19917AAF | 0200000000000000
+ | 0200000000000004 | Size | 80 B | 0200000000000000
+ | 0200000000000004 | Name | Driver_Shotgun | 0200000000000000
+ | 0200000000000004 | Version | 1.0.0 | 0200000000000000
+ | 0200000000000005 | Name | base_crusher.tweak | 0200000000000000
+ | 0200000000000005 | Loadout | 0200000000000002 | 0200000000000000
+ | 0200000000000005 | Parent | 0200000000000003 | 0200000000000000
Expand Down
Loading

0 comments on commit ec5b644

Please sign in to comment.