From ec8f1d7ea417b4517e5f6575635ef22f9243c69f Mon Sep 17 00:00:00 2001 From: Moony Date: Tue, 17 Mar 2026 18:17:22 +0100 Subject: [PATCH] Add test result archiving to our test actions + Test fixes (#43175) * Add test result archiving to our test actions. * heck. * Don't waste tremendous amounts of storage. * Fix ReagentDataTest. * Reduce retention and increase compression on integration output. * Back to 7 days, depend on RT instead. * Poke. * Fix linter. * til. * Actually send YAMLLinter's pair messages into the void. --- .github/workflows/build-test-debug.yml | 14 ++++++++++++-- .../Tests/Chemistry/ReagentDataTest.cs | 2 +- Content.YAMLLinter/Program.cs | 10 +++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-debug.yml b/.github/workflows/build-test-debug.yml index ad1fbf29ac..cfd39c3fff 100644 --- a/.github/workflows/build-test-debug.yml +++ b/.github/workflows/build-test-debug.yml @@ -45,13 +45,23 @@ jobs: run: dotnet build --configuration DebugOpt --no-restore /m - name: Run Content.Tests - run: dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0 + shell: pwsh + run: dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0 NUnit.TestOutputXml="logs" NUnit.WorkDirectory="$(pwd)/test_results" - name: Run Content.IntegrationTests shell: pwsh run: | $env:DOTNET_gcServer=1 - dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed + dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed NUnit.TestOutputXml="logs" NUnit.WorkDirectory="$(pwd)/test_results" + + - name: Archive NUnit3 test results. + if: always() + uses: actions/upload-artifact@v4 + with: + name: nunit3-results-${{ matrix.os }} + path: test_results/* + retention-days: 7 + compression-level: 9 ci-success: name: Build & Test Debug needs: diff --git a/Content.IntegrationTests/Tests/Chemistry/ReagentDataTest.cs b/Content.IntegrationTests/Tests/Chemistry/ReagentDataTest.cs index f488734655..59948c8b17 100644 --- a/Content.IntegrationTests/Tests/Chemistry/ReagentDataTest.cs +++ b/Content.IntegrationTests/Tests/Chemistry/ReagentDataTest.cs @@ -8,7 +8,7 @@ namespace Content.IntegrationTests.Tests.Chemistry; [TestFixture] [TestOf(typeof(ReagentData))] -public sealed class ReagentDataTest : InteractionTest +public sealed class ReagentDataTest { [Test] public async Task ReagentDataIsSerializable() diff --git a/Content.YAMLLinter/Program.cs b/Content.YAMLLinter/Program.cs index 8351c22667..ee4c5788e5 100644 --- a/Content.YAMLLinter/Program.cs +++ b/Content.YAMLLinter/Program.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Reflection; using System.Threading.Tasks; @@ -11,11 +12,14 @@ using Robust.Shared.Serialization.Markdown.Validation; using Robust.Shared.Timing; using Robust.Shared.Utility; using Robust.UnitTesting; +using Robust.UnitTesting.Pool; namespace Content.YAMLLinter { internal static class Program { + private static readonly ExternalTestContext TestContext = new("YAML Linter", StreamWriter.Null); + private static async Task Main(string[] _) { GameDataScrounger.NoScrounging = true; // Ugly hack for YAML Linter. @@ -57,7 +61,7 @@ namespace Content.YAMLLinter private static async Task<(Dictionary> YamlErrors, List FieldErrors)> ValidateClient() { - await using var pair = await PoolManager.GetServerClient(); + await using var pair = await PoolManager.GetServerClient(testContext: TestContext); var client = pair.Client; var result = await ValidateInstance(client); await pair.CleanReturnAsync(); @@ -67,7 +71,7 @@ namespace Content.YAMLLinter private static async Task<(Dictionary> YamlErrors, List FieldErrors)> ValidateServer() { - await using var pair = await PoolManager.GetServerClient(); + await using var pair = await PoolManager.GetServerClient(testContext: TestContext); var server = pair.Server; var result = await ValidateInstance(server); await pair.CleanReturnAsync(); @@ -179,7 +183,7 @@ namespace Content.YAMLLinter private static async Task<(Assembly[] clientAssemblies, Assembly[] serverAssemblies)> GetClientServerAssemblies() { - await using var pair = await PoolManager.GetServerClient(); + await using var pair = await PoolManager.GetServerClient(testContext: TestContext); var result = (GetAssemblies(pair.Client), GetAssemblies(pair.Server));