Skip to content

Commit 5b6266a

Browse files
committed
Run tests against release rust build
1 parent 1324963 commit 5b6266a

File tree

5 files changed

+15
-30
lines changed

5 files changed

+15
-30
lines changed

.yamato/desktop-standalone-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{
9191
commands:
9292
# If ubuntu, run rust echo server (This is needed ONLY for NGOv2.X because relates to Distributed Authority)
9393
{% if platform.name != "win" %} # Issues with win and mac are tracked in MTT-11606
94-
- ./Tools/CI/rust.sh
94+
- ./Tools/CI/run_cmb_service.sh
9595
{% endif %}
9696

9797
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ cargo build --example ngo_echo_server
1212
# Run the echo server in the background - this will reuse the artifacts from the build
1313
cargo run --example ngo_echo_server -- --port $ECHO_SERVER_PORT &
1414

15-
# Build the standalone server
16-
cargo build
15+
# Build a release version of the standalone server
16+
cargo build --release --locked
1717

1818
# Run the standalone server on an infinite loop in the background
19-
while :; do cargo run -- --metrics-port 5000 standalone --port $COMB_SERVER_PORT -t 60m; done &
19+
while :; do ./target/release/comb-server --metrics-port 5000 standalone --port $COMB_SERVER_PORT -t 60m; done &

com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,14 @@ public static void DeregisterNetworkObject(ulong localClientId, ulong networkObj
9696
}
9797
}
9898

99-
protected int TotalClients => m_UseHost ? NumberOfClients + 1 : NumberOfClients;
99+
/// <summary>
100+
/// Total number of clients that should be connected at any point during a test
101+
/// </summary>
102+
protected int TotalClients => m_UseHost ? m_NumberOfClients + 1 : m_NumberOfClients;
100103

101104
protected const uint k_DefaultTickRate = 30;
105+
106+
private int m_NumberOfClients;
102107
protected abstract int NumberOfClients { get; }
103108

104109
/// <summary>
@@ -420,7 +425,7 @@ public IEnumerator SetUp()
420425

421426
if (m_SetupIsACoroutine)
422427
{
423-
yield return NetcodeIntegrationTestHelpers.WaitBetweenCmbServiceTests(m_UseCmbService);
428+
// yield return NetcodeIntegrationTestHelpers.WaitBetweenCmbServiceTests(m_UseCmbService);
424429
yield return OnSetup();
425430
}
426431
else

com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,26 +1015,6 @@ private static IEnumerator ExecuteWaitForHook(MessageHandleCheckWithResult check
10151015
result.Result = res;
10161016
}
10171017

1018-
1019-
private static bool s_PreviousWasCmbServiceTest;
1020-
1021-
/// <summary>
1022-
/// Waits for a second if the previous and current tests are using the hosted CMB Service.
1023-
/// This is necessary as the CMB Service does not restart fast enough when running multiple tests.
1024-
/// </summary>
1025-
/// <param name="isCmbServiceTest">Whether the currently running test is running against a hosted CMB service instance</param>
1026-
/// <returns>An <see cref="IEnumerator"/> that will wait for a second</returns>
1027-
public static IEnumerator WaitBetweenCmbServiceTests(bool isCmbServiceTest)
1028-
{
1029-
if (isCmbServiceTest && s_PreviousWasCmbServiceTest)
1030-
{
1031-
// TODO: [CmbServiceTests] investigate whether we can reduce this timeout
1032-
yield return new WaitForSeconds(1f);
1033-
}
1034-
1035-
s_PreviousWasCmbServiceTest = isCmbServiceTest;
1036-
}
1037-
10381018
#if UNITY_EDITOR
10391019
public static void SetRefreshAllPrefabsCallback(Action scenesProcessed)
10401020
{

com.unity.netcode.gameobjects/Tests/Runtime/PlayerObjectTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal class PlayerObjectTests : NetcodeIntegrationTest
2121
// TODO: [CmbServiceTests] Clients are disconnecting in a way that makes the cmb service slow to close and restart
2222
protected override bool UseCMBService()
2323
{
24-
return false;
24+
return true;
2525
}
2626
public PlayerObjectTests(HostOrServer hostOrServer) : base(hostOrServer) { }
2727

@@ -78,7 +78,7 @@ internal class PlayerSpawnNoObserversTest : NetcodeIntegrationTest
7878
// TODO: [CmbServiceTests] Clients are disconnecting in a way that makes the cmb service slow to close and restart
7979
protected override bool UseCMBService()
8080
{
81-
return false;
81+
return true;
8282
}
8383
public PlayerSpawnNoObserversTest(HostOrServer hostOrServer) : base(hostOrServer) { }
8484

@@ -144,7 +144,7 @@ internal class PlayerSpawnPositionTests : IntegrationTestWithApproximation
144144
// TODO: [CmbServiceTests] Clients are disconnecting in a way that makes the cmb service slow to close and restart
145145
protected override bool UseCMBService()
146146
{
147-
return false;
147+
return true;
148148
}
149149
public PlayerSpawnPositionTests(HostOrServer hostOrServer) : base(hostOrServer) { }
150150

@@ -218,7 +218,7 @@ internal class PlayerSpawnAndDespawnTests : NetcodeIntegrationTest
218218
// TODO: [CmbServiceTests] Clients are disconnecting in a way that makes the cmb service slow to close and restart
219219
protected override bool UseCMBService()
220220
{
221-
return false;
221+
return true;
222222
}
223223

224224
public PlayerSpawnAndDespawnTests(HostOrServer hostOrServer) : base(hostOrServer) { }

0 commit comments

Comments
 (0)