-
Notifications
You must be signed in to change notification settings - Fork 459
Expand file tree
/
Copy pathdesktop-standalone-tests.yml
More file actions
129 lines (111 loc) · 6.06 KB
/
desktop-standalone-tests.yml
File metadata and controls
129 lines (111 loc) · 6.06 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{% metadata_file .yamato/project.metafile %}
---
# Builds a player on desktop standalone platform and executes RuntimeTests (equivalent to PlayMode tests) of the NGO package in the Standalone build.
# Default project (testptoject) in this case is used as a context.
# Builds are made on each desktop platform as in project.metafile declaration
# Builds are made on each supported editor as in project.metafile declaration
# Builds are made with different scripting backends as in project.metafile declaration
# 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
# Build phase
{% 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 }}
commands:
# Installing tools
{% if platform.name == "ubuntu" %}
- sudo apt-get update -q
- sudo apt install -qy imagemagick
{% endif %}
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
# 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 %}
# Installing editor
- unity-downloader-cli -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} --fast --wait
# Build Player
- |
{% if platform.name == "win" %}
utr.bat --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
{% else %}
./utr --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
{% endif %}
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
{% 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 }}
# Set additional variables for running the echo server
{% if platform.name != "win" %}
variables:
ECHO_SERVER_PORT: "7788"
# Set this to ensure the DA codec tests 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"
{% endif %}
commands:
# 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 %}
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
- unity-downloader-cli -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} --fast --wait
# If ubuntu, run rust echo server
{% if platform.name != "win" %}
- git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git
# Install rust
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Build the echo server
- cd ./mps-common-multiplayer-backend/runtime && $HOME/.cargo/bin/cargo build --example ngo_echo_server
# Run the echo server in the background - this will reuse the artifacts from the build
- cd ./mps-common-multiplayer-backend/runtime && $HOME/.cargo/bin/cargo run --example ngo_echo_server -- --port $ECHO_SERVER_PORT &
{% endif %}
# Run Standalone tests
- |
{% if platform.name == "win" %}
utr.bat --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
{% else %}
./utr --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
{% endif %}
artifacts:
logs:
paths:
- "test-results/**/*"
dependencies:
- .yamato/desktop-standalone-tests.yml#desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
{% endfor -%}