Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .yamato/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@ code_coverage_{{ platform.name }}_{{ editor }}:
image: {{ platform.image }}
flavor: {{ platform.flavor }}
commands:
- npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- unity-downloader-cli -u {{ editor }} -c Editor --fast --wait
- {% if platform.name == "ubuntu" %}DISPLAY=:0 {% endif %} upm-ci package test -u {{ editor }} --package-path com.unity.netcode.gameobjects --enable-code-coverage --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun"
# Platform specific UTR setup
- |
{% if platform.name == "win" %}
curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
{% else %}
curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr
{% endif %}

- upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor
- {% if platform.name == "ubuntu" %}DISPLAY=:0 {% endif %} {% if platform.name == "win" %} utr.bat {% else %} ./utr {% endif %} --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage --coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --artifacts-path=test-results --coverage-results-path=test-results/CoverageResults --extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
- "test-results/**/*"
dependencies:
- .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }}
{% endfor -%}
Expand Down
5 changes: 2 additions & 3 deletions com.unity.netcode.gameobjects/Editor/HiddenScriptEditor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Unity.Netcode.Components;
#if UNITY_UNET_PRESENT
using Unity.Netcode.Transports.UNET;
#endif
using Unity.Netcode.Transports.UTP;
using UnityEditor;
using UnityEngine;
Expand All @@ -28,6 +25,8 @@ public override void OnInspectorGUI()
}
}
#if UNITY_UNET_PRESENT
using Unity.Netcode.Transports.UNET;

/// <summary>
/// Internal use. Hides the script field for UNetTransport.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ private bool CheckForStateChange(ref NetworkTransformState networkState, ref Tra
#else
var position = InLocalSpace ? transformToUse.localPosition : transformToUse.position;
var rotation = InLocalSpace ? transformToUse.localRotation : transformToUse.rotation;
var positionThreshold = Vector3.one * PositionThreshold;
var positionThreshold = Vector3.one * PositionThreshold;
var rotationThreshold = Vector3.one * RotAngleThreshold;
#endif
var rotAngles = rotation.eulerAngles;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public WaitForMetricValues(IMetricDispatcher dispatcher, DirectionalMetricInfo d
dispatcher.RegisterObserver(this);
}

abstract public void Observe(MetricCollection collection);
public abstract void Observe(MetricCollection collection);

public void AssertMetricValuesHaveNotBeenFound()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#if MULTIPLAYER_TOOLS
using System;
// System namespaces
using System.Collections;
using System;

// Test framework
using NUnit.Framework;
using Unity.Multiplayer.Tools.NetStats;
using UnityEngine.TestTools;

// Unity namespaces
using Unity.Multiplayer.Tools.NetStats;
using Unity.Netcode.TestHelpers.Runtime;

namespace Unity.Netcode.RuntimeTests.Metrics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#if MULTIPLAYER_TOOLS
// System namespaces
using System.Collections;
using System.Collections.Generic;
using System.Linq;

// Test framework
using NUnit.Framework;
using Unity.Multiplayer.Tools.MetricTypes;
using UnityEngine;
using UnityEngine.TestTools;

// Unity core
using UnityEngine;

// Unity multiplayer specific
using Unity.Multiplayer.Tools.MetricTypes;
using Unity.Netcode.TestHelpers.Runtime.Metrics;

namespace Unity.Netcode.RuntimeTests.Metrics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#if MULTIPLAYER_TOOLS
// System namespaces
using System.Collections;
using System.Linq;

// Test framework
using NUnit.Framework;
using Unity.Multiplayer.Tools.MetricTypes;
using UnityEngine.TestTools;

// Unity namespaces
using Unity.Multiplayer.Tools.MetricTypes;
using Unity.Netcode.TestHelpers.Runtime.Metrics;

namespace Unity.Netcode.RuntimeTests.Metrics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#if MULTIPLAYER_TOOLS
// System namespaces
using System.Collections;
using System.Linq;

// Test framework
using NUnit.Framework;
using UnityEngine.TestTools;

// Unity core
using Unity.Collections;
using Unity.Multiplayer.Tools.MetricTypes;
using UnityEngine;
using UnityEngine.TestTools;

// Unity netcode and multiplayer specific
using Unity.Multiplayer.Tools.MetricTypes;
using Unity.Netcode.TestHelpers.Runtime;
using Unity.Netcode.TestHelpers.Runtime.Metrics;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#if MULTIPLAYER_TOOLS
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
// System namespaces
using System.Collections;

// Test framework
using NUnit.Framework;
using UnityEngine.TestTools;

// Unity core
using Unity.Collections;

// Unity multiplayer specific
using Unity.Multiplayer.Tools.MetricTypes;
using UnityEngine.TestTools;
using Unity.Netcode.TestHelpers.Runtime.Metrics;

namespace Unity.Netcode.RuntimeTests.Metrics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
#if MULTIPLAYER_TOOLS
using System.Collections;
using System.Linq;
// System namespaces first
using System.Collections;
using System.Linq;

// Test framework namespaces second
using NUnit.Framework;
using Unity.Collections;
using Unity.Multiplayer.Tools.MetricTypes;
using UnityEngine.TestTools;

// Unity core namespaces third
using Unity.Collections;

// Unity specific packages last
using Unity.Netcode.TestHelpers.Runtime.Metrics;

#if MULTIPLAYER_TOOLS
using Unity.Multiplayer.Tools.MetricTypes;

namespace Unity.Netcode.RuntimeTests.Metrics
{
internal class RpcMetricsTests : DualClientMetricTestBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
#if MULTIPLAYER_TOOLS
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7

// System namespaces
using System.Collections;
using System.Collections.Generic;
using System.Linq;

// Test framework
using NUnit.Framework;
using UnityEngine.TestTools;

// Unity core
using Unity.Collections;

// Unity netcode and multiplayer specific
using Unity.Multiplayer.Tools.MetricTypes;
using UnityEngine.TestTools;
using Unity.Netcode.TestHelpers.Runtime;
using Unity.Netcode.TestHelpers.Runtime.Metrics;

Expand Down
3 changes: 2 additions & 1 deletion minimalproject/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"dependencies": {
"com.unity.netcode.gameobjects": "file:../../com.unity.netcode.gameobjects"
"com.unity.netcode.gameobjects": "file:../../com.unity.netcode.gameobjects",
"com.unity.ide.rider": "3.0.31"
},
"testables": [
"com.unity.netcode.gameobjects"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;

using NUnit.Framework;
using UnityEngine.TestTools;

using Unity.Collections;
using UnityEngine.SceneManagement;

using Unity.Multiplayer.Tools.MetricTypes;
using Unity.Netcode;
using Unity.Netcode.TestHelpers.Runtime.Metrics;
using UnityEngine.SceneManagement;
using UnityEngine.TestTools;
using Unity.Netcode.TestHelpers.Runtime;
using Unity.Netcode.TestHelpers.Runtime.Metrics;

using SceneEventType = Unity.Netcode.SceneEventType;

namespace TestProject.ToolsIntegration.RuntimeTests
Expand Down