mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-06-09 13:26:34 +02:00
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.
This commit is contained in:
@@ -45,13 +45,23 @@ jobs:
|
|||||||
run: dotnet build --configuration DebugOpt --no-restore /m
|
run: dotnet build --configuration DebugOpt --no-restore /m
|
||||||
|
|
||||||
- name: Run Content.Tests
|
- 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
|
- name: Run Content.IntegrationTests
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$env:DOTNET_gcServer=1
|
$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:
|
ci-success:
|
||||||
name: Build & Test Debug
|
name: Build & Test Debug
|
||||||
needs:
|
needs:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Content.IntegrationTests.Tests.Chemistry;
|
|||||||
|
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
[TestOf(typeof(ReagentData))]
|
[TestOf(typeof(ReagentData))]
|
||||||
public sealed class ReagentDataTest : InteractionTest
|
public sealed class ReagentDataTest
|
||||||
{
|
{
|
||||||
[Test]
|
[Test]
|
||||||
public async Task ReagentDataIsSerializable()
|
public async Task ReagentDataIsSerializable()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -11,11 +12,14 @@ using Robust.Shared.Serialization.Markdown.Validation;
|
|||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using Robust.UnitTesting;
|
using Robust.UnitTesting;
|
||||||
|
using Robust.UnitTesting.Pool;
|
||||||
|
|
||||||
namespace Content.YAMLLinter
|
namespace Content.YAMLLinter
|
||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
|
private static readonly ExternalTestContext TestContext = new("YAML Linter", StreamWriter.Null);
|
||||||
|
|
||||||
private static async Task<int> Main(string[] _)
|
private static async Task<int> Main(string[] _)
|
||||||
{
|
{
|
||||||
GameDataScrounger.NoScrounging = true; // Ugly hack for YAML Linter.
|
GameDataScrounger.NoScrounging = true; // Ugly hack for YAML Linter.
|
||||||
@@ -57,7 +61,7 @@ namespace Content.YAMLLinter
|
|||||||
private static async Task<(Dictionary<string, HashSet<ErrorNode>> YamlErrors, List<string> FieldErrors)>
|
private static async Task<(Dictionary<string, HashSet<ErrorNode>> YamlErrors, List<string> FieldErrors)>
|
||||||
ValidateClient()
|
ValidateClient()
|
||||||
{
|
{
|
||||||
await using var pair = await PoolManager.GetServerClient();
|
await using var pair = await PoolManager.GetServerClient(testContext: TestContext);
|
||||||
var client = pair.Client;
|
var client = pair.Client;
|
||||||
var result = await ValidateInstance(client);
|
var result = await ValidateInstance(client);
|
||||||
await pair.CleanReturnAsync();
|
await pair.CleanReturnAsync();
|
||||||
@@ -67,7 +71,7 @@ namespace Content.YAMLLinter
|
|||||||
private static async Task<(Dictionary<string, HashSet<ErrorNode>> YamlErrors, List<string> FieldErrors)>
|
private static async Task<(Dictionary<string, HashSet<ErrorNode>> YamlErrors, List<string> FieldErrors)>
|
||||||
ValidateServer()
|
ValidateServer()
|
||||||
{
|
{
|
||||||
await using var pair = await PoolManager.GetServerClient();
|
await using var pair = await PoolManager.GetServerClient(testContext: TestContext);
|
||||||
var server = pair.Server;
|
var server = pair.Server;
|
||||||
var result = await ValidateInstance(server);
|
var result = await ValidateInstance(server);
|
||||||
await pair.CleanReturnAsync();
|
await pair.CleanReturnAsync();
|
||||||
@@ -179,7 +183,7 @@ namespace Content.YAMLLinter
|
|||||||
private static async Task<(Assembly[] clientAssemblies, Assembly[] serverAssemblies)>
|
private static async Task<(Assembly[] clientAssemblies, Assembly[] serverAssemblies)>
|
||||||
GetClientServerAssemblies()
|
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));
|
var result = (GetAssemblies(pair.Client), GetAssemblies(pair.Server));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user