Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a5b5652
Added a test project that references the tools package
becksebenius-unity Jul 29, 2021
1cbaa9d
Reverted project.metafile change to try to diagnose a yamato failure
becksebenius-unity Jul 29, 2021
58f014a
trying a different format for the project name
becksebenius-unity Jul 29, 2021
992ce10
updated yamato files to avoid duplicate keys
becksebenius-unity Jul 29, 2021
02e3fad
fixed triggers and 'run all' jobs not using new name or respecting va…
becksebenius-unity Jul 29, 2021
f5d8ae9
re-added "test_" prefix to avoid too many changes to the structure in…
becksebenius-unity Jul 29, 2021
acaf7e5
fixed incorrect pack dependency for non-first projects
becksebenius-unity Jul 29, 2021
93cbf06
Added utp to the integration project
becksebenius-unity Jul 29, 2021
1096a43
fixed package tests always using the first project
becksebenius-unity Jul 29, 2021
80a1e3a
Added a dummy asset to make sure that the test project assets folder …
becksebenius-unity Jul 29, 2021
b42dc58
Removed "packages" list from tools test project to simplify list
becksebenius-unity Aug 2, 2021
85b414d
fixed WaitForEndOfFrame issue
becksebenius-unity Aug 4, 2021
c6b36c4
Compiled out metrics tests when tools package isn't present
becksebenius-unity Aug 4, 2021
1c16e53
Made sure all projects are tested from pull request even if they cont…
becksebenius-unity Aug 4, 2021
c1ffd0b
changed test_editors to be project-specific
becksebenius-unity Aug 4, 2021
252a7d8
fix mistake in previous
becksebenius-unity Aug 4, 2021
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
10 changes: 5 additions & 5 deletions .yamato/_run-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ run_all_tests:
dependencies:
# Pull in package and validate jobs through the badges job
- .yamato/_triggers.yml#badges_test_trigger
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
{% for project in projects -%}
{% for editor in project.test_editors -%}
{% for package in project.packages -%}
- .yamato/package-tests.yml#test_{{ package.name }}_{{ editor }}_{{ platform.name }}
- .yamato/package-tests.yml#test_{{ project.name}}_{{ package.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
Expand All @@ -21,9 +21,9 @@ all_project_tests:
dependencies:
# Pull in package and validate jobs through the badges job
- .yamato/_triggers.yml#badges_test_trigger
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
{% for project in projects -%}
{% for editor in project.test_editors -%}
- .yamato/project-tests.yml#test_{{ projects.first.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
Expand All @@ -34,11 +34,11 @@ all_package_tests:
dependencies:
# Pull in package and validate jobs through the badges job
- .yamato/_triggers.yml#badges_test_trigger
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
{% for project in projects -%}
{% for editor in test_editors -%}
{% for package in project.packages -%}
- .yamato/package-tests.yml#test_{{ package.name }}_{{ editor }}_{{ platform.name }}
- .yamato/package-tests.yml#test_{{ project.name}}_{{ package.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
Expand Down
18 changes: 12 additions & 6 deletions .yamato/_triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ pull_request_trigger:
- .yamato/project-standards.yml#standards_{{ projects.first.name }}
{% for project in projects -%}
{% for package in project.packages -%}
- .yamato/project-tests.yml#validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
{% if project.validate == "true" -%}
- .yamato/project-tests.yml#validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}
{% endif -%}
{% endfor -%}
{% for platform in test_platforms -%}
- .yamato/package-tests.yml#test_{{ package.name }}_{{ test_editors.first }}_{{ platform.name }}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ test_editors.first }}_{{ platform.name }}
{% for package in project.packages -%}
- .yamato/package-tests.yml#test_{{ project.name }}_{{ package.name }}_{{ project.test_editors.first }}_{{ platform.name }}
{% endfor -%}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ project.test_editors.first }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
triggers:
Expand Down Expand Up @@ -59,10 +63,12 @@ badges_test_trigger:
dependencies:
{% for project in projects -%}
{% for package in project.packages -%}
- .yamato/project-tests.yml#validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
{% for editor in test_editors -%}
{% if project.validate == "true" -%}
- .yamato/project-tests.yml#validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}
{% endif -%}
{% for editor in project.test_editors -%}
{% for platform in test_platforms -%}
- .yamato/package-tests.yml#test_{{ package.name }}_{{ editor }}_{{ platform.name }}
- .yamato/package-tests.yml#test_{{ project.name }}_{{ package.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
Expand Down
14 changes: 8 additions & 6 deletions .yamato/package-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@
# to generate its independent package tests and validation tests.
# The idea is to only run validation once per package and not mix.
# the results with package tests
{% for package in projects.first.packages -%}
{% for editor in test_editors -%}
{% for project in projects -%}
{% for package in project.packages -%}
{% for editor in project.test_editors -%}
{% for platform in test_platforms -%}
test_{{ package.name }}_{{ editor }}_{{ platform.name }}:
name : {{ package.name }} package tests - {{ editor }} on {{ platform.name }}
test_{{project.name}}_{{ package.name }}_{{ editor }}_{{ platform.name }}:
name : {{ project.name }} - {{ package.name }} package tests - {{ editor }} on {{ platform.name }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ editor }} --type package-tests --project-path {{ projects.first.name }} --package-filter {{ package.name }}
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ editor }} --type package-tests --project-path {{ project.name }} --package-filter {{ package.name }}
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/project-pack.yml#pack_{{ projects.first.name }}
- .yamato/project-pack.yml#pack_{{ project.name }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
{% endfor -%}
10 changes: 5 additions & 5 deletions .yamato/project-promotion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{% for package in project.packages -%}
# Validation job for package {{ package.name }}, only using the first entry in the
# platform and editor meta data
promotion_validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}:
name : Validate Project {{ project.name }} - Package {{ package.name }} - {{ test_editors.first }} on {{ test_platforms.first.name }}
promotion_validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}:
name : Validate Project {{ project.name }} - Package {{ package.name }} - {{ validation_editor }} on {{ test_platforms.first.name }}
agent:
type: {{ test_platforms.first.type }}
image: {{ test_platforms.first.image }}
Expand All @@ -14,7 +14,7 @@ promotion_validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first
UPMCI_PROMOTION: 1
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project test -u {{ test_editors.first }} --project-path {{ project.path }} --type vetting-tests --project-path {{ project.path }} --package-filter {{ package.name }}
- upm-ci project test -u {{ validation_editor }} --project-path {{ project.path }} --type vetting-tests --project-path {{ project.path }} --package-filter {{ package.name }}
artifacts:
logs:
paths:
Expand All @@ -39,7 +39,7 @@ promote_{{ project.name }}_{{ package.name }}:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
- .yamato/project-promotion.yml#promotion_validate_{{ project.name }}_{{ project.packages.first.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
- .yamato/project-promotion.yml#promotion_validate_{{ project.name }}_{{ project.packages.first.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}

{% endfor -%}

Expand All @@ -60,5 +60,5 @@ promote_{{ project.name }}:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
- .yamato/project-promotion.yml#promotion_validate_{{ project.packages.first.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
- .yamato/project-promotion.yml#promotion_validate_{{ project.packages.first.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}
{% endfor -%}
4 changes: 2 additions & 2 deletions .yamato/project-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ publish_{{ project.name }}_{{ package.name }}:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
- .yamato/project-tests.yml#validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
{% for editor in test_editors -%}
- .yamato/project-tests.yml#validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}
{% for editor in project.test_editors -%}
{% for platform in test_platforms -%}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
Expand Down
2 changes: 1 addition & 1 deletion .yamato/project-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ standards_{{ projects.first.name }}:
- $HOME/.dotnet/tools/dotnet-format --version
- python3 --version
- pip install unity-downloader-cli --upgrade --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
- unity-downloader-cli -u {{ test_editors.first }} -c editor --wait --fast
- unity-downloader-cli -u {{ projects.first.test_editors.first }} -c editor --wait --fast
- .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ projects.first.path }} -quit
- ./standards.py --tool-path $HOME/.dotnet/tools/dotnet-format --project-path {{ projects.first.path }} --yamato
10 changes: 6 additions & 4 deletions .yamato/project-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,32 @@
# Validation only occurs in editmode.

{% for project in projects -%}
{% if project.validate == "true" %}
{% for package in project.packages -%}
validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}:
name : Validate Package {{ package.name }} - {{ test_editors.first }} on {{ test_platforms.first.name }}
validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}:
name : Validate Package {{ package.name }} - {{ validation_editor }} on {{ test_platforms.first.name }}
agent:
type: {{ test_platforms.first.type }}
image: {{ test_platforms.first.image }}
flavor: {{ test_platforms.first.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ test_editors.first }} --type vetting-tests --project-path {{ project.path }} --package-filter {{ package.name }} --platform editmode
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ validation_editor }} --type vetting-tests --project-path {{ project.path }} --package-filter {{ package.name }} --platform editmode
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
{% endfor -%}
{% endif -%}
{% endfor -%}

# For every platform and editor version, run its project tests without
# running package tests too since they are handled on their respective
# jobs
{% for project in projects -%}
{% for editor in test_editors -%}
{% for editor in project.test_editors -%}
{% for platform in test_platforms -%}
test_{{ project.name }}_{{ editor }}_{{ platform.name }}:
name : {{ project.name }} project tests - {{ editor }} on {{ platform.name }}
Expand Down
4 changes: 2 additions & 2 deletions .yamato/project-updated-dependencies-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# The idea is to only run validation once per package and not mix.
# the results with package tests
{% for package in projects.first.packages -%}
{% for editor in test_editors -%}
{% for editor in projects.first.test_editors -%}
{% for platform in test_platforms -%}
dependency_{{ projects.first.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}:
name : Dependency Test of Project {{ projects.first.name }} - Package {{ package.name }} - {{ editor }} on {{ platform.name }}
Expand Down Expand Up @@ -51,7 +51,7 @@ dependency_test_trigger_{{ projects.first.name }}:
frequency: 22 * * ?
dependencies:
{% for package in projects.first.packages -%}
{% for editor in test_editors -%}
{% for editor in projects.first.test_editors -%}
{% for platform in test_platforms -%}
- .yamato/project-updated-dependencies-test.yml#dependency_{{ projects.first.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
Expand Down
23 changes: 13 additions & 10 deletions .yamato/project.metafile
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
# Editors where tests will happen. The first entry of this array is also used
# for validation.
#
# Therefore, **do not** put an older V1-lifecycle ver.
# like 2020.x or 2019.x on top of 'test_editors'
test_editors:
- 2021.1
- 2021.2
- 2020.3
- trunk
validation_editor: 2021.1

# Platforms that will be tested. The first entry in this array will also
# be used for validation
Expand All @@ -30,9 +21,21 @@ test_platforms:
projects:
- name: testproject
path: testproject
validate: true
# Packages within a project that will be tested
packages:
- name: com.unity.multiplayer.mlapi
path: com.unity.multiplayer.mlapi
- name: com.unity.multiplayer.transport.utp
path: com.unity.multiplayer.transport.utp
test_editors:
- 2021.1
- 2021.2
- 2020.3
- trunk
- name: testproject-tools-integration
path: testproject-tools-integration
validate: false
test_editors:
- 2021.2
- trunk
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if MULTIPLAYER_TOOLS
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down Expand Up @@ -156,3 +157,4 @@ public IEnumerator TrackUnnamedMessageReceivedMetric()
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if MULTIPLAYER_TOOLS
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down Expand Up @@ -99,9 +100,9 @@ public IEnumerator TrackNetworkObjectDestroyReceivedMetric()
yield return new WaitForSeconds(0.2f);

var waitForMetricEvent = new WaitForMetricValues<ObjectDestroyedEvent>(ClientMetrics.Dispatcher, MetricNames.ObjectDestroyedReceived);

Server.SpawnManager.OnDespawnObject(m_NewNetworkObject, true);

yield return waitForMetricEvent.WaitForMetricsReceived();

var objectDestroyedReceivedMetricValues = waitForMetricEvent.AssertMetricValuesHaveBeenFound();
Expand Down Expand Up @@ -195,3 +196,4 @@ public IEnumerator TrackMultipleNetworkObjectDestroySentMetric()
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if MULTIPLAYER_TOOLS
using System;
using System.Collections;
using System.Linq;
Expand Down Expand Up @@ -48,3 +49,4 @@ public IEnumerator TrackNetworkVariableDeltaReceivedMetric()
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if MULTIPLAYER_TOOLS
using System;
using System.Collections;
using System.Linq;
using MLAPI.Metrics;
Expand Down Expand Up @@ -60,4 +61,5 @@ public IEnumerator TrackOwnershipChangeReceivedMetric()
Assert.AreEqual(2, ownershipChangeReceived.BytesCount);
}
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if MULTIPLAYER_TOOLS
using System;
using System.Collections;
using System.Linq;
Expand All @@ -18,7 +19,7 @@ public IEnumerator TrackRpcSentMetricOnServer()
{
var clientPlayer = new MultiInstanceHelpers.CoroutineResultWrapper<NetworkObject>();
yield return MultiInstanceHelpers.Run(MultiInstanceHelpers.GetNetworkObjectByRepresentation(x => x.IsPlayerObject && x.OwnerClientId == Client.LocalClientId, Server, clientPlayer));

var waitForMetricValues = new WaitForMetricValues<RpcEvent>(ServerMetrics.Dispatcher, MetricNames.RpcSent);

clientPlayer.Result.GetComponent<RpcTestComponent>().MyClientRpc();
Expand All @@ -27,7 +28,7 @@ public IEnumerator TrackRpcSentMetricOnServer()

var serverRpcSentValues = waitForMetricValues.AssertMetricValuesHaveBeenFound();
Assert.AreEqual(2, serverRpcSentValues.Count); // Server will receive this, since it's host

Assert.That(serverRpcSentValues, Has.All.Matches<RpcEvent>(x => x.Name == nameof(RpcTestComponent.MyClientRpc)));
Assert.That(serverRpcSentValues, Has.All.Matches<RpcEvent>(x => x.BytesCount != 0));
Assert.Contains(Server.LocalClientId, serverRpcSentValues.Select(x => x.Connection.Id).ToArray());
Expand All @@ -39,7 +40,7 @@ public IEnumerator TrackRpcSentMetricOnClient()
{
var clientPlayer = new MultiInstanceHelpers.CoroutineResultWrapper<NetworkObject>();
yield return MultiInstanceHelpers.Run(MultiInstanceHelpers.GetNetworkObjectByRepresentation(x => x.IsPlayerObject && x.OwnerClientId == Client.LocalClientId, Client, clientPlayer));

var waitForClientMetricsValues = new WaitForMetricValues<RpcEvent>(ClientMetrics.Dispatcher, MetricNames.RpcSent);

clientPlayer.Result.GetComponent<RpcTestComponent>().MyServerRpc();
Expand Down Expand Up @@ -81,7 +82,7 @@ public IEnumerator TrackRpcReceivedMetricOnClient()
{
var clientPlayer = new MultiInstanceHelpers.CoroutineResultWrapper<NetworkObject>();
yield return MultiInstanceHelpers.Run(MultiInstanceHelpers.GetNetworkObjectByRepresentation(x => x.IsPlayerObject && x.OwnerClientId == Client.LocalClientId, Server, clientPlayer));

var waitForServerMetricsValues = new WaitForMetricValues<RpcEvent>(ServerMetrics.Dispatcher, MetricNames.RpcReceived);

clientPlayer.Result.GetComponent<RpcTestComponent>().MyClientRpc();
Expand All @@ -98,3 +99,4 @@ public IEnumerator TrackRpcReceivedMetricOnClient()
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if MULTIPLAYER_TOOLS
using System;
using System.Collections;
using System.Linq;
Expand Down Expand Up @@ -51,3 +52,4 @@ public IEnumerator TrackServerLogReceivedMetric()
}
}
}
#endif
Loading