Skip to content

Commit

Permalink
Big bug fixing part 2 (new-frontiers-14#2209)
Browse files Browse the repository at this point in the history
* Update build-test-debug.yml

* Update PostMapInitTest.cs

* Update PostMapInitTest.cs

* Update AutoInternalsTests.cs

* My pain is real

* Exclude shipyard tests from build-test-debug job

* Only use Frontier game maps

* Update CargoTest.cs

* Comment out integration tests again

* GameMap init

---------

Co-authored-by: Whatstone <[email protected]>
Co-authored-by: Whatstone <[email protected]>
  • Loading branch information
3 people authored Oct 16, 2024
1 parent d58d13d commit 6095d41
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 35 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ jobs:
- name: Run Content.Tests
run: dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0

# - 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
# - name: Run Content.IntegrationTests
# shell: pwsh
# run: |
# $env:DOTNET_gcServer=1
# dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj --filter FullyQualifiedName!~ShipyardTest -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed
ci-success:
name: Build & Test Debug
needs:
Expand Down
2 changes: 1 addition & 1 deletion Content.IntegrationTests/Tests/CargoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Content.Server.Cargo.Systems;
using Content.Server.Nutrition.Components;
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Cargo.Components;
using Content.Shared.Cargo.Components; // Frontier
using Content.Shared.Cargo.Prototypes;
using Content.Shared.IdentityManagement;
using Content.Shared.Stacks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Content.IntegrationTests.Tests.Internals;
[TestOf(typeof(InternalsSystem))]
public sealed class AutoInternalsTests
{
[Test]
[Ignore("Not relevant for Frontier")] // Frontier
public async Task TestInternalsAutoActivateInSpaceForStationSpawn()
{
await using var pair = await PoolManager.GetServerClient();
Expand Down Expand Up @@ -39,7 +39,7 @@ await server.WaitAssertion(() =>
await pair.CleanReturnAsync();
}

[Test]
[Ignore("Not relevant for Frontier")] // Frontier
public async Task TestInternalsAutoActivateInSpaceForEntitySpawn()
{
await using var pair = await PoolManager.GetServerClient();
Expand Down Expand Up @@ -73,7 +73,6 @@ await server.WaitAssertion(() =>
equipment:
mask: ClothingMaskBreath
suitstorage: OxygenTankFilled
outerClothing: ClothingOuterVestTank # Frontier
- type: job
id: TestInternalsDummy
Expand Down
31 changes: 6 additions & 25 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
using Content.Shared.Station.Components;
using FastAccessors;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Content.IntegrationTests.Tests._NF;

namespace Content.IntegrationTests.Tests
{
Expand All @@ -38,32 +38,13 @@ public sealed class PostMapInitTest

private static readonly string[] Grids =
{
"/Maps/centcomm.yml",
"/Maps/Shuttles/cargo.yml",
"/Maps/Shuttles/emergency.yml",
"/Maps/Shuttles/infiltrator.yml",
// Admin
"/Maps/_NF/Shuttles/Admin/fishbowl.yml",
// Bus
"/Maps/_NF/Shuttles/Bus/publicts.yml",
};

private static readonly string[] GameMaps =
{
"Dev",
"TestTeg",
"Fland",
"Meta",
"Packed",
"Omega",
"Bagel",
"CentComm",
"Box",
"Core",
"Marathon",
"MeteorArena",
"Saltern",
"Reach",
"Train",
"Oasis",
"Cog"
};
private static readonly string[] GameMaps = FrontierConstants.GameMapPrototypes; // Frontier: not inline constants

/// <summary>
/// Asserts that specific files have been saved as grids and not maps.
Expand Down
10 changes: 9 additions & 1 deletion Content.IntegrationTests/Tests/Station/StationJobsTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Content.IntegrationTests.Tests._NF;
using Content.Server.Maps;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
Expand Down Expand Up @@ -227,8 +228,15 @@ await server.WaitAssertion(() =>

Assert.Multiple(() =>
{
foreach (var gameMap in prototypeManager.EnumeratePrototypes<GameMapPrototype>())
foreach (var mapProto in FrontierConstants.GameMapPrototypes) // Frontier: EnumeratePrototypes<GameMapPrototype> < FrontierConstants.GameMapPrototypes
{
// Frontier: get prototype from proto ID
if (!prototypeManager.TryIndex<GameMapPrototype>(mapProto, out var gameMap))
{
Assert.Fail($"Could not find GameMapPrototype with ID {mapProto}! Is FrontierConstants up to date?");
}
// End Frontier

foreach (var (stationId, station) in gameMap.Stations)
{
if (!station.StationComponentOverrides.TryGetComponent(name, out var comp))
Expand Down
10 changes: 10 additions & 0 deletions Content.IntegrationTests/Tests/_NF/FrontierConstants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Content.IntegrationTests.Tests._NF;

public sealed class FrontierConstants
{
public static readonly string[] GameMapPrototypes =
{
"Frontier",
"NFDev"
};
}

0 comments on commit 6095d41

Please sign in to comment.