Skip to content

Commit dca06fd

Browse files
fix: refactor integration test infra, re-enable testproject-tools-integration, fix flaky tests on desktop & console platforms (#1687)
Co-authored-by: Fatih Mar <[email protected]>
1 parent 61af2b3 commit dca06fd

File tree

138 files changed

+2682
-1926
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+2682
-1926
lines changed

.yamato/project.metafile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ projects:
4545
- 2021.2
4646
- 2020.3
4747
- trunk
48-
# - name: testproject-tools-integration
49-
# path: testproject-tools-integration
50-
# validate: false
51-
# test_editors:
52-
# - 2021.2
53-
# - trunk
48+
- name: testproject-tools-integration
49+
path: testproject-tools-integration
50+
validate: false
51+
test_editors:
52+
- 2021.2
53+
- trunk
Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
{
2-
"name": "Unity.Netcode.Adapter.UTP.Editor",
3-
"rootNamespace": "",
4-
"references": [
5-
"Unity.Collections",
6-
"Unity.Jobs",
7-
"Unity.Burst",
8-
"Unity.Netcode.Runtime",
9-
"Unity.Networking.Transport"
10-
],
11-
"includePlatforms": [
12-
"Editor"
13-
],
14-
"excludePlatforms": [],
15-
"allowUnsafeCode": true,
16-
"overrideReferences": true,
17-
"precompiledReferences": [],
18-
"autoReferenced": true,
19-
"defineConstraints": [],
20-
"versionDefines": [],
21-
"noEngineReferences": false
2+
"name": "Unity.Netcode.Adapter.UTP.Editor",
3+
"rootNamespace": "Unity.Netcode.Adapter.UTP.Editor",
4+
"references": [
5+
"Unity.Collections",
6+
"Unity.Jobs",
7+
"Unity.Burst",
8+
"Unity.Netcode.Runtime",
9+
"Unity.Networking.Transport"
10+
],
11+
"includePlatforms": [
12+
"Editor"
13+
]
2214
}
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
{
22
"name": "Unity.Netcode.Adapter.UTP",
3-
"rootNamespace": "Unity.Netcode.UTP",
3+
"rootNamespace": "Unity.Netcode.Adapter.UTP",
44
"references": [
55
"Unity.Collections",
66
"Unity.Jobs",
77
"Unity.Burst",
88
"Unity.Netcode.Runtime",
99
"Unity.Networking.Transport"
1010
],
11-
"includePlatforms": [],
12-
"excludePlatforms": [],
1311
"allowUnsafeCode": true,
14-
"overrideReferences": false,
15-
"precompiledReferences": [],
16-
"autoReferenced": true,
17-
"defineConstraints": [],
1812
"versionDefines": [
1913
{
2014
"name": "com.unity.multiplayer.tools",
@@ -26,6 +20,5 @@
2620
"expression": "1.0.0-pre.4",
2721
"define": "MULTIPLAYER_TOOLS_1_0_0_PRE_4"
2822
}
29-
],
30-
"noEngineReferences": false
23+
]
3124
}

com.unity.netcode.adapter.utp/Tests/Runtime/com.unity.netcode.adapter.utp.runtimetests.asmdef

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,9 @@
44
"references": [
55
"Unity.Netcode.Runtime",
66
"Unity.Networking.Transport",
7-
"UnityEngine.TestRunner",
8-
"UnityEditor.TestRunner",
97
"Unity.Netcode.Adapter.UTP"
108
],
11-
"includePlatforms": [],
12-
"excludePlatforms": [],
13-
"allowUnsafeCode": false,
14-
"overrideReferences": true,
15-
"precompiledReferences": [
16-
"nunit.framework.dll"
17-
],
18-
"autoReferenced": false,
19-
"defineConstraints": [
20-
"UNITY_INCLUDE_TESTS",
21-
"UNITY_INCLUDE_TESTS"
22-
],
23-
"versionDefines": [],
24-
"noEngineReferences": false
9+
"optionalUnityReferences": [
10+
"TestAssemblies"
11+
]
2512
}

com.unity.netcode.gameobjects/Components/com.unity.netcode.components.asmdef

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,5 @@
55
"Unity.Netcode.Runtime",
66
"Unity.Collections"
77
],
8-
"includePlatforms": [],
9-
"excludePlatforms": [],
10-
"allowUnsafeCode": true,
11-
"overrideReferences": false,
12-
"precompiledReferences": [],
13-
"autoReferenced": true,
14-
"defineConstraints": [],
15-
"versionDefines": [],
16-
"noEngineReferences": false
8+
"allowUnsafeCode": true
179
}

com.unity.netcode.gameobjects/Editor/NetworkManagerHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class NetworkManagerHelper : NetworkManager.INetworkManagerHelper
1212
{
1313
internal static NetworkManagerHelper Singleton;
1414

15-
// This is primarily to handle multiInstance scenarios where more than 1 NetworkManager could exist
15+
// This is primarily to handle IntegrationTest scenarios where more than 1 NetworkManager could exist
1616
private static Dictionary<NetworkManager, Transform> s_LastKnownNetworkManagerParents = new Dictionary<NetworkManager, Transform>();
1717

1818
/// <summary>

com.unity.netcode.gameobjects/Editor/com.unity.netcode.editor.asmdef

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,11 @@
88
"includePlatforms": [
99
"Editor"
1010
],
11-
"excludePlatforms": [],
12-
"allowUnsafeCode": false,
13-
"overrideReferences": false,
14-
"precompiledReferences": [],
15-
"autoReferenced": true,
16-
"defineConstraints": [],
1711
"versionDefines": [
1812
{
1913
"name": "com.unity.multiplayer.tools",
2014
"expression": "",
2115
"define": "MULTIPLAYER_TOOLS"
2216
}
23-
],
24-
"noEngineReferences": false
17+
]
2518
}

com.unity.netcode.gameobjects/Runtime/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
[assembly: InternalsVisibleTo("Unity.Netcode.Editor.CodeGen")]
66
[assembly: InternalsVisibleTo("Unity.Netcode.Editor")]
77
[assembly: InternalsVisibleTo("TestProject.EditorTests")]
8-
[assembly: InternalsVisibleTo("TestProject.ToolsIntegration.RuntimeTests")]
98
#endif
9+
[assembly: InternalsVisibleTo("TestProject.ToolsIntegration.RuntimeTests")]
1010
[assembly: InternalsVisibleTo("TestProject.RuntimeTests")]
1111
[assembly: InternalsVisibleTo("Unity.Netcode.RuntimeTests")]
12+
[assembly: InternalsVisibleTo("Unity.Netcode.TestHelpers.Runtime")]
1213
[assembly: InternalsVisibleTo("Unity.Netcode.Adapter.UTP")]
1314

com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,7 @@ private void PopulateScenePlacedObjects(Scene sceneToFilterBy, bool clearScenePl
18451845
// at the end of scene loading we use this list to soft synchronize all in-scene placed NetworkObjects
18461846
foreach (var networkObjectInstance in networkObjects)
18471847
{
1848-
// We check to make sure the NetworkManager instance is the same one to be "MultiInstanceHelpers" compatible and filter the list on a per scene basis (additive scenes)
1848+
// We check to make sure the NetworkManager instance is the same one to be "NetcodeIntegrationTestHelpers" compatible and filter the list on a per scene basis (additive scenes)
18491849
if (networkObjectInstance.IsSceneObject == null && networkObjectInstance.NetworkManager == m_NetworkManager && networkObjectInstance.gameObject.scene == sceneToFilterBy &&
18501850
networkObjectInstance.gameObject.scene.handle == sceneToFilterBy.handle)
18511851
{

com.unity.netcode.gameobjects/Runtime/com.unity.netcode.runtime.asmdef

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@
1212
"Unity.Multiplayer.Tools.NetworkSolutionInterface",
1313
"Unity.Collections"
1414
],
15-
"includePlatforms": [],
16-
"excludePlatforms": [],
1715
"allowUnsafeCode": true,
18-
"overrideReferences": false,
19-
"precompiledReferences": [],
20-
"autoReferenced": true,
21-
"defineConstraints": [],
2216
"versionDefines": [
2317
{
2418
"name": "com.unity.multiplayer.tools",
@@ -35,6 +29,5 @@
3529
"expression": "1.0.0-pre.4",
3630
"define": "MULTIPLAYER_TOOLS_1_0_0_PRE_4"
3731
}
38-
],
39-
"noEngineReferences": false
32+
]
4033
}

0 commit comments

Comments
 (0)