Skip to content

Commit

Permalink
Merge branch 'master' into 2024-10-13-UnusedShips
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 authored Oct 13, 2024
2 parents 9f717f8 + 583eca4 commit c70dcbd
Show file tree
Hide file tree
Showing 62 changed files with 709 additions and 1,245 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 -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed
ci-success:
name: Build & Test Debug
needs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nf-shipyard-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ jobs:
- name: Setup Submodule
run: |
git submodule update --init --recursive
- name: Pull engine updates
uses: space-wizards/submodule-dependency@v0.1.5

- name: Update Engine Submodules
run: |
cd RobustToolbox/
git submodule update --init --recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.2.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-credits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Credits
commit_author: FrontierATC <zuuswa@gmail.com>
commit_author: FrontierATC <zuuswa@gmail.com>
20 changes: 10 additions & 10 deletions Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.Execution;
Expand Down Expand Up @@ -95,7 +95,7 @@ await server.WaitAssertion(() =>
consoleHost.GetSessionShell(playerMan.Sessions.First()).ExecuteCommand("suicide");
Assert.Multiple(() =>
{
Assert.That(mobStateSystem.IsDead(player, mobStateComp));
//Assert.That(mobStateSystem.IsDead(player, mobStateComp)); // DeltaV - /suicide is the same as /ghost
Assert.That(entManager.TryGetComponent<GhostComponent>(mindComponent.CurrentEntity, out var ghostComp) &&
!ghostComp.CanReturnToBody);
});
Expand Down Expand Up @@ -158,17 +158,17 @@ await server.WaitAssertion(() =>
Assert.Multiple(() =>
{
Assert.That(mobStateSystem.IsDead(player, mobStateComp));
//Assert.That(mobStateSystem.IsDead(player, mobStateComp)); // DeltaV - /suicide is the same as /ghost
Assert.That(entManager.TryGetComponent<GhostComponent>(mindComponent.CurrentEntity, out var ghostComp) &&
!ghostComp.CanReturnToBody);
Assert.That(damageableComp.Damage.GetTotal(), Is.EqualTo(lethalDamageThreshold));
//Assert.That(damageableComp.Damage.GetTotal(), Is.EqualTo(lethalDamageThreshold)); // DeltaV - /suicide is the same as /ghost
});
});

await pair.CleanReturnAsync();
}

/// <summary>
/// <summary>
/// Run the suicide command in the console
/// Should only ghost the player but not kill them
/// </summary>
Expand Down Expand Up @@ -210,7 +210,7 @@ await server.WaitAssertion(() =>
consoleHost.GetSessionShell(playerMan.Sessions.First()).ExecuteCommand("suicide");
Assert.Multiple(() =>
{
Assert.That(mobStateSystem.IsAlive(player, mobStateComp));
//Assert.That(mobStateSystem.IsAlive(player, mobStateComp)); // DeltaV:
Assert.That(entManager.TryGetComponent<GhostComponent>(mindComponent.CurrentEntity, out var ghostComp) &&
!ghostComp.CanReturnToBody);
});
Expand Down Expand Up @@ -281,10 +281,10 @@ await server.WaitAssertion(() =>
Assert.Multiple(() =>
{
Assert.That(mobStateSystem.IsDead(player, mobStateComp));
//Assert.That(mobStateSystem.IsDead(player, mobStateComp)); // DeltaV
Assert.That(entManager.TryGetComponent<GhostComponent>(mindComponent.CurrentEntity, out var ghostComp) &&
!ghostComp.CanReturnToBody);
Assert.That(damageableComp.Damage.DamageDict["Slash"], Is.EqualTo(lethalDamageThreshold));
//Assert.That(damageableComp.Damage.DamageDict["Slash"], Is.EqualTo(lethalDamageThreshold)); // DeltaV
});
});

Expand Down Expand Up @@ -353,10 +353,10 @@ await server.WaitAssertion(() =>
Assert.Multiple(() =>
{
Assert.That(mobStateSystem.IsDead(player, mobStateComp));
//Assert.That(mobStateSystem.IsDead(player, mobStateComp)); // DeltaV
Assert.That(entManager.TryGetComponent<GhostComponent>(mindComponent.CurrentEntity, out var ghostComp) &&
!ghostComp.CanReturnToBody);
Assert.That(damageableComp.Damage.DamageDict["Slash"], Is.EqualTo(lethalDamageThreshold / 2));
//Assert.That(damageableComp.Damage.DamageDict["Slash"], Is.EqualTo(lethalDamageThreshold / 2)); // DeltaV
});
});

Expand Down
5 changes: 4 additions & 1 deletion Content.IntegrationTests/Tests/EntityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ await server.WaitPost(() =>
// Check that the number of entities has gone back to the original value.
if (server.EntMan.EntityCount != count)
{
Assert.Fail($"Server prototype {protoId} failed on deletion count didn't reset properly");
// Frontier: add expected vs. actual
Assert.Fail($"Server prototype {protoId} failed on deletion count didn't reset properly:\n" +
$"Expected {count} and found {server.EntMan.EntityCount}.\n");
// End Frontier
}

if (client.EntMan.EntityCount != clientCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Content.IntegrationTests.Tests.GameRules;
public sealed class AntagPreferenceTest
{
[Test]
[Ignore("Antag role selection isn't used on Frontier.")] // Frontier
public async Task TestLobbyPlayersValid()
{
await using var pair = await PoolManager.GetServerClient(new PoolSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public async Task FailAndStartTest()

Assert.That(server.CfgMan.GetCVar(CCVars.GridFill), Is.False);
Assert.That(server.CfgMan.GetCVar(CCVars.GameLobbyFallbackEnabled), Is.True);
Assert.That(server.CfgMan.GetCVar(CCVars.GameLobbyDefaultPreset), Is.EqualTo("secret"));
Assert.That(server.CfgMan.GetCVar(CCVars.GameLobbyDefaultPreset), Is.EqualTo("adventure")); // Frontier: secret<adventure - we use adventure gamemode by default
server.CfgMan.SetCVar(CCVars.GridFill, true);
server.CfgMan.SetCVar(CCVars.GameLobbyFallbackEnabled, false);
server.CfgMan.SetCVar(CCVars.GameLobbyDefaultPreset, "TestPreset");
Expand Down Expand Up @@ -113,7 +113,7 @@ public async Task FailAndStartTest()
ticker.SetGamePreset((GamePresetPrototype?) null);
server.CfgMan.SetCVar(CCVars.GridFill, false);
server.CfgMan.SetCVar(CCVars.GameLobbyFallbackEnabled, true);
server.CfgMan.SetCVar(CCVars.GameLobbyDefaultPreset, "secret");
server.CfgMan.SetCVar(CCVars.GameLobbyDefaultPreset, "adventure"); // Frontier: secret<adventure - we use adventure gamemode by default
server.System<TestRuleSystem>().Run = false;
await pair.CleanReturnAsync();
}
Expand Down
1 change: 1 addition & 0 deletions Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public sealed class NukeOpsTest
/// Check that a nuke ops game mode can start without issue. I.e., that the nuke station and such all get loaded.
/// </summary>
[Test]
[Ignore("Not relevant for Frontier, no nuke ops gameplay.")] // Frontier
public async Task TryStopNukeOpsFromConstantlyFailing()
{
await using var pair = await PoolManager.GetServerClient(new PoolSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public sealed class TraitorRuleTest
private const string TraitorAntagRoleName = "Traitor";

[Test]
[Ignore("Traitor role selection isn't used on Frontier.")] // Frontier
public async Task TestTraitorObjectives()
{
await using var pair = await PoolManager.GetServerClient(new PoolSettings()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ await server.WaitAssertion(() =>
equipment:
mask: ClothingMaskBreath
suitstorage: OxygenTankFilled
outerClothing: ClothingOuterVestTank # Frontier
- type: job
id: TestInternalsDummy
Expand Down
7 changes: 6 additions & 1 deletion Content.IntegrationTests/Tests/MachineBoardTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@ await server.WaitAssertion(() =>
continue;
var mId = mbc.Prototype;
// Frontier: we accept null as board prototypes, but this will fail the assertions.
if (mId == "Null")
continue;
// End Frontier
Assert.Multiple(() =>
{
Assert.That(protoMan.TryIndex<EntityPrototype>(mId, out var mProto),
$"Machine board {p.ID}'s corresponding machine has an invalid prototype.");
$"Machine board {p.ID}'s corresponding machine has an invalid prototype."); // Frontier
Assert.That(mProto.TryGetComponent<MachineComponent>(out var mComp, compFact),
$"Machine board {p.ID}'s corresponding machine {mId} does not have MachineComponent");
Assert.That(mComp.Board, Is.EqualTo(p.ID),
Expand Down
15 changes: 12 additions & 3 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ namespace Content.IntegrationTests.Tests
public sealed class PostMapInitTest
{
private const bool SkipTestMaps = true;
private const string TestMapsPath = "/Maps/Test/";
private const string TestMapsPath = "/Maps/_NF/Test/"; // Frontier: _NF

// Frontier: TODO - define this to our set of maps of interest
private static readonly string[] NoSpawnMaps =
{
"CentComm",
Expand Down Expand Up @@ -116,7 +117,7 @@ public async Task NoSavedPostMapInitTest()
var server = pair.Server;

var resourceManager = server.ResolveDependency<IResourceManager>();
var mapFolder = new ResPath("/Maps");
var mapFolder = new ResPath("/Maps/_NF"); // Frontier: add _NF
var maps = resourceManager
.ContentFindFiles(mapFolder)
.Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith(".", StringComparison.Ordinal))
Expand Down Expand Up @@ -311,6 +312,14 @@ public async Task AllMapsTested()

var gameMaps = protoMan.EnumeratePrototypes<GameMapPrototype>()
.Where(x => !pair.IsTestPrototype(x))
// Frontier: FIXME - hacky test fix
.Where(x =>
x.ID == PoolManager.TestMap || // Frontier: check test map
(x.MapPath.ToString().StartsWith("/Maps/_NF") && // Frontier: check frontier maps only
!x.MapPath.ToString().StartsWith("/Maps/_NF/Shuttles") && // Frontier: skip shuttles (not loaded as maps)
!x.MapPath.ToString().StartsWith("/Maps/_NF/POI")) // Frontier: skip POIs (not loaded as maps)
)
// End Frontier
.Select(x => x.ID)
.ToHashSet();

Expand All @@ -337,7 +346,7 @@ public async Task NonGameMapsLoadableTest()

var gameMaps = protoManager.EnumeratePrototypes<GameMapPrototype>().Select(o => o.MapPath).ToHashSet();

var mapFolder = new ResPath("/Maps");
var mapFolder = new ResPath("/Maps/_NF"); // Frontier
var maps = resourceManager
.ContentFindFiles(mapFolder)
.Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith(".", StringComparison.Ordinal))
Expand Down
6 changes: 3 additions & 3 deletions Content.IntegrationTests/Tests/Round/JobTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace Content.IntegrationTests.Tests.Round;
[TestFixture]
public sealed class JobTest
{
private static readonly ProtoId<JobPrototype> Passenger = "Passenger";
private static readonly ProtoId<JobPrototype> Engineer = "StationEngineer";
private static readonly ProtoId<JobPrototype> Captain = "Captain";
private static readonly ProtoId<JobPrototype> Passenger = "Contractor"; // Frontier: use job prototypes that exist
private static readonly ProtoId<JobPrototype> Engineer = "Pilot"; // Frontier
private static readonly ProtoId<JobPrototype> Captain = "StationRepresentative"; // Frontier

private static string _map = "JobTestMap";

Expand Down
3 changes: 2 additions & 1 deletion Content.IntegrationTests/Tests/SalvageTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using Content.Shared.CCVar;
using Content.Shared.Salvage;
using Robust.Server.GameObjects;
Expand All @@ -17,6 +17,7 @@ public sealed class SalvageTest
/// Asserts that all salvage maps have been saved as grids and are loadable.
/// </summary>
[Test]
[Ignore("Not currently used by Frontier.")] // Frontier
public async Task AllSalvageMapsLoadableTest()
{
await using var pair = await PoolManager.GetServerClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public sealed class VendingMachineRestockTest : EntitySystem
";

[Test]
[Ignore("Frontier: restocks for vendors are intentionally unpurchaseable.")] // Frontier
public async Task TestAllRestocksAreAvailableToBuy()
{
await using var pair = await PoolManager.GetServerClient();
Expand Down
Loading

0 comments on commit c70dcbd

Please sign in to comment.