Skip to content

Commit fed9f93

Browse files
committed
Added desktop-standalone comments
1 parent 7f25818 commit fed9f93

File tree

1 file changed

+52
-24
lines changed

1 file changed

+52
-24
lines changed

.yamato/desktop-standalone-tests.yml

Lines changed: 52 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
1-
{% metadata_file .yamato/project.metafile %}
1+
{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file.
22
---
33

4-
# Builds a player on desktop standalone platform and executes RuntimeTests (equivalent to PlayMode tests) of the NGO package in the Standalone build.
5-
# Default project (testptoject) in this case is used as a context.
6-
# Builds are made on each desktop platform as in project.metafile declaration
7-
# Builds are made on each supported editor as in project.metafile declaration
8-
# Builds are made with different scripting backends as in project.metafile declaration
9-
# ARM64 architectures are for now not considered since Windows_arm64 is recommended to use only after builds (would require separation here) and when it comes to macOS_arm64 there is problem with OpenCL not being available
4+
# DESCRIPTION--------------------------------------------------------------------------
5+
# This job is responsible for Desktop platform test validation.
6+
# Those tests cover both PlayMode and EditMode tests from package test assemblies.
107

11-
# Build phase
8+
# CONFIGURATION STRUCTURE--------------------------------------------------------------
9+
# Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency:
10+
# 1. For all desktop platform (Windows, macOS, Ubuntu)
11+
# 2. For all supported Unity Editor versions (for NGOv1.X this means 2021.3+ editors)
12+
# 3. For the default project.
13+
# 4. For all scripting backends (mono, il2cpp)
14+
15+
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
16+
# For desktop devices a split is into two phases is not required but we use it for consistency with setup of others standalone platforms:
17+
# 1. Build Phase: Creates standalone players for desktop platforms
18+
# 2. Run Phase: Executes runtime tests on actual desktop devices
19+
# The Run phase uses build job as dependency
20+
21+
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
22+
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
23+
24+
# QUALITY THOUGHTS--------------------------------------------------------------------
25+
# TODO: consider adding all projects that have tests
26+
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
27+
28+
#-----------------------------------------------------------------------------------
29+
30+
31+
# BUILD PHASE CONFIGURATION------------------------------------------------------------------------------------
1232
{% for project in projects.default -%}
1333
{% for platform in test_platforms.desktop -%}
1434
{% for editor in validation_editors.all -%}
@@ -19,23 +39,16 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{
1939
type: {% if platform.name == "mac" %} {{ platform.type }} {% else %} {{ platform.type }}::GPU {% endif %}
2040
image: {{ platform.image }}
2141
flavor: {{ platform.flavor }}
22-
commands:
23-
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
24-
25-
# Installing editor
26-
- unity-downloader-cli -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} --fast --wait
27-
28-
# Build Player
42+
commands:
43+
- unity-downloader-cli -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %}
2944
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --testproject={{ project.path }} --scripting-backend={{ backend }} --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --artifacts-path=artifacts --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800
30-
3145
artifacts:
3246
players:
3347
paths:
3448
- "build/players/**/*"
3549
logs:
3650
paths:
3751
- "artifacts/**/*"
38-
3952
dependencies:
4053
- .yamato/project-pack.yml#project_pack_-_{{ project.name }}_{{ platform.name }}
4154
{% endfor -%}
@@ -46,7 +59,7 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{
4659

4760

4861

49-
# Run phase
62+
# RUN PHASE CONFIGURATION------------------------------------------------------------------------------------
5063
{% for project in projects.default -%}
5164
{% for platform in test_platforms.desktop -%}
5265
{% for editor in validation_editors.all -%}
@@ -57,15 +70,30 @@ desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{
5770
type: {% if platform.name == "mac" %} {{ platform.type }} {% else %} {{ platform.type }}::GPU {% endif %}
5871
image: {{ platform.image }}
5972
flavor: {{ platform.flavor }}
60-
commands:
61-
{% if editor == "2021.3" and platform.name == "ubuntu" %}
62-
- sudo apt-get install -y libssl1.1 # For this specific configuration there is a difference in what libssl version is installed on the image and what editor uses. This should be removed when 2021 editor is out of support
73+
74+
# Set additional variables for running the echo server
75+
{% if platform.name != "win" %}
76+
variables:
77+
ECHO_SERVER_PORT: "7788"
78+
# Set this to ensure the DA codec tests will fail if they cannot connect to the echo-server
79+
# The default is to ignore the codec tests if the echo-server fails to connect
80+
ENSURE_CODEC_TESTS: "true"
6381
{% endif %}
64-
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple # Installing unity downloader
65-
- unity-downloader-cli -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} --fast --wait # Installing appropriate Unity version for the test case. Important to note is the fact that even though we have a build we still need the editor to run tests
6682

67-
# Running Standalone desktop tests
83+
commands:
84+
- unity-downloader-cli -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %}
6885
- UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=1800
86+
87+
# If ubuntu, run rust echo server
88+
{% if platform.name != "win" %}
89+
- git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git
90+
# Install rust
91+
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
92+
# Build the echo server
93+
- cd ./mps-common-multiplayer-backend/runtime && $HOME/.cargo/bin/cargo build --example ngo_echo_server
94+
# Run the echo server in the background - this will reuse the artifacts from the build
95+
- cd ./mps-common-multiplayer-backend/runtime && $HOME/.cargo/bin/cargo run --example ngo_echo_server -- --port $ECHO_SERVER_PORT &
96+
{% endif %}
6997

7098
artifacts:
7199
logs:

0 commit comments

Comments
 (0)