-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathdesktop-standalone-tests.yml
More file actions
115 lines (99 loc) · 6.52 KB
/
desktop-standalone-tests.yml
File metadata and controls
115 lines (99 loc) · 6.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file.
---
# DESCRIPTION--------------------------------------------------------------------------
# This job is responsible for Desktop platform test validation.
# Those tests cover both PlayMode and EditMode tests from package test assemblies.
# CONFIGURATION STRUCTURE--------------------------------------------------------------
# Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency:
# 1. For all desktop platform (Windows, macOS, Ubuntu)
# 2. For all supported Unity Editor versions (for NGOv2.X this means 6000.0+ editors)
# 3. For the default project.
# 4. For all scripting backends (mono, il2cpp)
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
# For desktop devices a split is into two phases is not required but we use it for consistency with setup of others standalone platforms:
# 1. Build Phase: Creates standalone players for desktop platforms
# 2. Run Phase: Executes runtime tests on actual desktop devices
# The Run phase uses build job as dependency
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
# QUALITY THOUGHTS--------------------------------------------------------------------
# TODO: consider adding all projects that have tests
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
#-----------------------------------------------------------------------------------
# BUILD PHASE CONFIGURATION------------------------------------------------------------------------------------
{% for project in projects.default -%}
{% for platform in test_platforms.desktop -%}
{% for editor in validation_editors.all -%}
{% for backend in scripting_backends -%}
desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}:
name : Standalone Build - NGO {{ project.name }} - [{{ platform.name }}, {{ editor }}, {{ backend }}]
agent:
type: {% if platform.name == "mac" %} {{ platform.type }} {% else %} {{ platform.type }}::GPU {% endif %}
image: {{ platform.image }}
flavor: {{ platform.flavor }}
{% if platform.name == "mac" %}
model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile)
{% endif %}
commands:
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %}
- 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
artifacts:
players:
paths:
- "build/players/**/*"
logs:
paths:
- "artifacts/**/*"
dependencies:
- .yamato/project-pack.yml#project_pack_-_{{ project.name }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
{% endfor -%}
# RUN PHASE CONFIGURATION------------------------------------------------------------------------------------
{% for project in projects.default -%}
{% for platform in test_platforms.desktop -%}
{% for editor in validation_editors.all -%}
{% for backend in scripting_backends -%}
desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}:
name : Standalone Test - NGO {{ project.name }} - [{{ platform.name }}, {{ editor }}, {{ backend }}]
agent:
type: {% if platform.name == "mac" %} {{ platform.type }} {% else %} {{ platform.type }}::GPU {% endif %}
image: {{ platform.image }}
flavor: {{ platform.flavor }}
{% if platform.name == "mac" %}
model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile). In this case it's specifically for macOS (if used for win/ubuntu then it will cause rust server to fail connecting)
{% endif %}
# Set additional variables for running the echo server (This is needed ONLY for NGOv2.X because relates to Distributed Authority)
{% if platform.name != "win" %} # Issues with win and mac are tracked in MTT-11606
variables:
# The echo server is a "mock" server that is only used to test encoding/decoding of messages.
# It is used by the DistributedAuthorityCodecTests. These are tests that are built and maintained by the CMB service team.
ECHO_SERVER_PORT: "7788"
# Set this to ensure the DistributedAuthorityCodecTests will fail if they cannot connect to the echo server.
# The default is to ignore the codec tests if the echo server fails to connect
ENSURE_CODEC_TESTS: "true"
# When USE_CMB_SERVICE is set to true, any C# tests configured to use the DA host will instead use the CMB service.
USE_CMB_SERVICE: "true"
# This is the port on which to run the full standalone CMB service.
# The port needs to be different from the echo server port as two processes cannot bind to same port.
CMB_SERVICE_PORT: "7799"
{% endif %}
commands:
# If ubuntu, run rust echo server (This is needed ONLY for NGOv2.X because relates to Distributed Authority)
{% if platform.name != "win" %} # Issues with win and mac are tracked in MTT-11606
# run_cmb_service.sh builds and starts a release version of the full CMB service (along with the limited echo server)
- ./Tools/CI/run_cmb_service.sh -e $ECHO_SERVER_PORT -s $CMB_SERVICE_PORT
{% endif %}
- 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
- 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
artifacts:
logs:
paths:
- "test-results/**/*"
dependencies:
- .yamato/desktop-standalone-tests.yml#desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
{% endfor -%}