Skip to content

Commit ba1b2a8

Browse files
Public testing libraries (#239)
* Bump the actions-deps group with 2 updates Bumps the actions-deps group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/upload-artifact` from 5 to 6 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v5...v6) Updates `actions/download-artifact` from 6 to 7 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v6...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps - dependency-name: actions/download-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps ... Signed-off-by: dependabot[bot] <support@github.com> * start creating a public testing framework * allow all FS * reorganize solution * disable on linux atm * try make test more stable * to netstandard * remove empty struct * start extracting to shared proj * try use shared proj * explicit usings * move private project ref * to own project * own version * no own version * to new namespace * start generalize tests * containue refactor test bases * using test bases * use testing bases * Refactor Steam HTML downloader to return non-nullable doc Removed nullable return from GetSteamWorkshopsPageHtmlAsync and shifted error handling to the caller. Now, exceptions are handled and logged in OnlineModGameTypeResolver, making error management more explicit and centralized. * start implementing new testing game installation api * testing classes for game and registry * start mod impl * new gameinstallation api * mod testing wrappers * enable tests again * move code * simplify further * move more code * rename methods * move more code * move namespace * remove method * remove modinstallation * base classes * remove modinstallation * move langauge installtion * some corrections * start documenting code * clean warnings * try test xuint 3 * test * test * test * remove * enable test * try enable logging * re-add tests * ignore no tests on linux * try fix linux * code documentation * document code * resolve some warnings * remove warning * do not use async write line * rename method * test base with filesystem * rename method * add opposite extension method * support vs testting * update logging * prepare package * nullable * add copyright * update deps * update to new CommonUtilities * update deps * fix doc * update deps * update version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent d330d54 commit ba1b2a8

162 files changed

Lines changed: 3841 additions & 2630 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Create packages
2828
run: dotnet pack --configuration Release --output ./packages
2929
- name: Upload a Build Artifact
30-
uses: actions/upload-artifact@v5
30+
uses: actions/upload-artifact@v6
3131
with:
3232
name: NuGet packages
3333
path: packages/*.*
@@ -45,7 +45,7 @@ jobs:
4545
fetch-depth: 0
4646
- name: Setup .NET
4747
uses: actions/setup-dotnet@v5
48-
- uses: actions/download-artifact@v6
48+
- uses: actions/download-artifact@v7
4949
with:
5050
name: NuGet packages
5151
path: packages

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ jobs:
2626
dotnet-version: '10.0.x'
2727

2828
- name: Build & Test in Release Mode
29-
run: dotnet test --configuration Release --logger "GitHubActions"
29+
run: dotnet test --configuration Release --report-github
30+
# Ignore exit code 8 on Linux (zero tests are now allowed)
31+
# TODO: Remove this when linux is supported
32+
env:
33+
TESTINGPLATFORM_EXITCODE_IGNORE: ${{ matrix.os == 'ubuntu-latest' && '8' || '' }}

Directory.Build.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99
<PropertyGroup>
1010
<Authors>Alamo Engine Tools and Contributors</Authors>
11-
<Copyright>Copyright © 2025 Alamo Engine Tools and contributors. All rights reserved.</Copyright>
11+
<Copyright>Copyright © 2026 Alamo Engine Tools and contributors. All rights reserved.</Copyright>
1212
<Company>Alamo Engine Tools</Company>
1313
<PackageTags>petroglyph, alamo, glyphx, foc, eaw</PackageTags>
1414
<PackageProjectUrl>https://github.com/AlamoEngine-Tools/PetroglyphGameInfrastructure</PackageProjectUrl>
@@ -32,8 +32,7 @@
3232
<Version>3.9.50</Version>
3333
</PackageReference>
3434
<PackageReference Include="SauceControl.InheritDoc" Version="2.0.2" PrivateAssets="all" />
35-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
36-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
35+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.102">
3736
<PrivateAssets>all</PrivateAssets>
3837
</PackageReference>
3938
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="" />

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Alamo Engine Tools
3+
Copyright (c) 2026 Alamo Engine Tools
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

PetroGlyphGameInfrastructure.slnx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
</Folder>
77
<Folder Name="/test/">
88
<Project Path="test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj" />
9-
<Project Path="test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj" />
109
<Project Path="test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj" />
1110
<Project Path="test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj" />
11+
</Folder>
12+
<Folder Name="/testing/">
13+
<Project Path="test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj" />
1214
<Project Path="test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj" />
13-
<Project Path="test/PG.TestingUtilities/PG.TestingUtilities.csproj" />
1415
</Folder>
1516
<Project Path="sampleApp/SampleApplication.csproj" />
1617
</Solution>

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test": {
3+
"runner": "Microsoft.Testing.Platform"
4+
}
5+
}

sampleApp/SampleApplication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.2" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/AET.SteamAbstraction/AET.SteamAbstraction.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
3+
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
44
<AssemblyName>AET.SteamAbstraction</AssemblyName>
55
</PropertyGroup>
66
<PropertyGroup>
@@ -21,16 +21,16 @@
2121
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2222
</PropertyGroup>
2323
<ItemGroup>
24-
<PackageReference Include="AnakinRaW.CommonUtilities.Registry" Version="12.3.9" />
25-
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
26-
<PackageReference Include="AnakinRaW.CommonUtilities" Version="12.3.9" />
27-
<PackageReference Include="AnakinRaW.CommonUtilities.FileSystem" Version="12.3.9" />
28-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
29-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.1" />
30-
<PackageReference Include="Nullable" Version="1.3.1">
24+
<PackageReference Include="AnakinRaW.CommonUtilities.Registry" Version="13.0.1" />
25+
<PackageReference Include="AnakinRaW.CommonUtilities" Version="13.0.1" />
26+
<PackageReference Include="AnakinRaW.CommonUtilities.FileSystem" Version="13.0.1" />
27+
<PackageReference Include="System.Text.Json" Version="10.0.2" />
28+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.2" />
29+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.2" />
30+
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" Condition="$(TargetFramework) == 'netstandard2.0'" />
31+
<PackageReference Include="Nullable" Version="1.3.1" Condition="$(TargetFramework) == 'netstandard2.0'">
3132
<PrivateAssets>all</PrivateAssets>
3233
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3334
</PackageReference>
34-
<PackageReference Include="System.Text.Json" Version="10.0.1" />
3535
</ItemGroup>
3636
</Project>

src/AET.SteamAbstraction/Library/SteamLibrary.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ internal class SteamLibrary : ISteamLibrary
1919
TrailingDirectorySeparatorBehavior = TrailingDirectorySeparatorBehavior.Trim
2020
};
2121

22+
private readonly string _normalizedLocation;
2223
private readonly ILogger? _logger;
2324
private readonly ConcurrentDictionary<KnownLibraryLocations, IDirectoryInfo> _locations = new();
2425

26+
private protected readonly IFileSystem FileSystem;
27+
2528
private readonly Dictionary<KnownLibraryLocations, string[]> _locationsNames = new()
2629
{
2730
{ KnownLibraryLocations.SteamApps, ["steamapps"] },
2831
{ KnownLibraryLocations.Common, ["steamapps", "common"] },
2932
{ KnownLibraryLocations.Workshops, ["steamapps", "workshop"] }
3033
};
3134

32-
private readonly string _normalizedLocation;
33-
private readonly IFileSystem _fileSystem;
34-
3535
public IDirectoryInfo LibraryLocation { get; }
3636

3737
public IDirectoryInfo SteamAppsLocation => GetKnownLibraryLocation(KnownLibraryLocations.SteamApps);
@@ -46,9 +46,9 @@ public SteamLibrary(IDirectoryInfo libraryLocation, IServiceProvider serviceProv
4646
throw new ArgumentNullException(nameof(libraryLocation));
4747
if (serviceProvider == null)
4848
throw new ArgumentNullException(nameof(serviceProvider));
49-
_fileSystem = serviceProvider.GetRequiredService<IFileSystem>();
49+
FileSystem = serviceProvider.GetRequiredService<IFileSystem>();
5050
_logger = serviceProvider.GetService<ILoggerFactory>()?.CreateLogger(GetType());
51-
_normalizedLocation = PathNormalizer.Normalize(_fileSystem.Path.GetFullPath(libraryLocation.FullName), SteamLibraryPathNormalizeOptions);
51+
_normalizedLocation = PathNormalizer.Normalize(FileSystem.Path.GetFullPath(libraryLocation.FullName), SteamLibraryPathNormalizeOptions);
5252
LibraryLocation = libraryLocation;
5353
}
5454

@@ -91,7 +91,7 @@ public bool Equals(ISteamLibrary? other)
9191
if (ReferenceEquals(this, other))
9292
return true;
9393

94-
var normalizedOtherPath = PathNormalizer.Normalize(_fileSystem.Path.GetFullPath(other.LibraryLocation.FullName), SteamLibraryPathNormalizeOptions);
94+
var normalizedOtherPath = PathNormalizer.Normalize(FileSystem.Path.GetFullPath(other.LibraryLocation.FullName), SteamLibraryPathNormalizeOptions);
9595
return _normalizedLocation.Equals(normalizedOtherPath);
9696
}
9797

src/AET.SteamAbstraction/Linux/LinuxSteamRegistry.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO.Abstractions;
44
using AET.SteamAbstraction.Registry;
55
using AnakinRaW.CommonUtilities;
6+
using AnakinRaW.CommonUtilities.Registry;
67

78
namespace AET.SteamAbstraction;
89

@@ -16,4 +17,9 @@ internal class LinuxSteamRegistry(IServiceProvider serviceProvider) : Disposable
1617
public IDirectoryInfo? InstallationDirectory { get; }
1718

1819
public int? ProcessId { get; }
20+
21+
public IRegistryKey? OpenSteamRegistryKey()
22+
{
23+
throw new NotImplementedException();
24+
}
1925
}

0 commit comments

Comments
 (0)