Skip to content

Commit 76a05f9

Browse files
committed
Added mobile-standalone comments
1 parent fed9f93 commit 76a05f9

File tree

1 file changed

+50
-41
lines changed

1 file changed

+50
-41
lines changed

.yamato/mobile-standalone-test.yml

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,52 @@
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
---
3-
4-
# Builds a player on mobile 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/Tests are made on each mobile platform (Android and iOS) as in project.metafile declaration
7-
# Builds/Tests are made on each supported editor as in project.metafile declaration
8-
9-
# For mobile devices it's necessary to split build and run phases
10-
# For iOS we need to use il2cpp. For android we could use both but il2cpp is recommended so for now we will only use il2cpp as scripting backend
11-
# iOS works only with ARM64 and Android is tested with both ARM64 and ARMv7
123

13-
# Builds are made with x64 architecture machines since those are compatible to run on ARM64 devices
4+
# DESCRIPTION--------------------------------------------------------------------------
5+
# This job is responsible for Mobile platform test validation.
6+
# Those tests cover both PlayMode and EditMode tests from package test assemblies.
7+
8+
# CONFIGURATION STRUCTURE--------------------------------------------------------------
9+
# Jobs are generated using nested loops through:
10+
# 1. For all mobile platform (Android, iOS)
11+
# 2. For all supported Unity Editor versions (for NGOv1.X this means 2021.3+ editors)
12+
# 3. For the default project.
13+
14+
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
15+
# For mobile devices a split is required into two phases:
16+
# 1. Build Phase: Creates standalone players for mobile platforms
17+
# 2. Run Phase: Executes runtime tests on actual mobile devices
18+
# The Run phase uses build job as dependency
19+
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
20+
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
21+
22+
# PLATFORM SPECIFICS--------------------------------------------------------------------
23+
# iOS Requirements:
24+
# Must use IL2CPP scripting backend
25+
# Only supports ARM64 architecture
26+
# Builds on macOS agents only
27+
28+
# Android Requirements:
29+
# Uses IL2CPP scripting backend (recommended over Mono)
30+
# Supports both ARM64 and ARMv7 architectures
31+
# Can be built on any desktop platform
32+
33+
# QUALITY CONSIDERATIONS--------------------------------------------------------------------
34+
# TODO: consider adding all projects that have tests
35+
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
36+
37+
38+
# BUILD PHASE CONFIGURATION------------------------------------------------------------------------------------
1439
{% for project in projects.default -%}
1540
{% for platform in test_platforms.mobile_build -%}
1641
{% for editor in validation_editors.all -%}
1742
mobile_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}:
18-
name: Build {{ project.name }} - [{{ platform.name }}, {{ editor }}, il2cpp]
43+
name: Build {{ project.name }} - [{{ platform.name }}, {{ editor }}, il2cpp]
1944
agent:
20-
type: {{ platform.type }}
21-
image: {{ platform.image }}
22-
flavor: {{ platform.flavor }}
45+
type: {{ platform.type }}
46+
image: {{ platform.image }}
47+
flavor: {{ platform.flavor }}
2348
commands:
24-
# Installing tools
25-
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
26-
27-
# Installing editor
28-
- unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %} --fast --wait
29-
30-
# Platform specific Build
49+
- unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %}
3150
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --testproject={{ project.path }} --architecture={{ platform.architecture }} --scripting-backend=il2cpp --editor-location=.Editor --artifacts-path=artifacts --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800
3251
artifacts:
3352
players:
@@ -36,16 +55,12 @@ mobile_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}:
3655
logs:
3756
paths:
3857
- "artifacts/**/*"
39-
40-
variables:
41-
CI: true
42-
ENABLE_BURST_COMPILATION: False
4358
{% endfor -%}
4459
{% endfor -%}
4560
{% endfor -%}
4661

4762

48-
# Executes RuntimeTests of the NGO package in the Standalone build for mobiles
63+
# RUN PHASE CONFIGURATION------------------------------------------------------------------------------------
4964
{% for project in projects.default -%}
5065
{% for platform in test_platforms.mobile_test -%}
5166
{% for editor in validation_editors.all -%}
@@ -58,32 +73,26 @@ mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }}:
5873
{% if platform.model %}
5974
model: {{ platform.model }}
6075
{% endif %}
61-
# Skip repository cloning
62-
skip_checkout: true
6376
commands:
64-
# Installing tools
65-
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
66-
67-
# Installing editor. We still need the editor to run tests on standalone build
68-
- unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %} --fast --wait
69-
77+
# Installing editor. We still need the editor to run tests on standalone build and for that the Editor is required
78+
- unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %}
79+
7080
{% if platform.standalone == "Android" %}
7181
# Download standalone UnityTestRunner and ADB setup
72-
- command: curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
7382
- command: wget http://artifactory-slo.bf.unity3d.com/artifactory/mobile-generic/android/ADBKeys.zip!/adbkey.pub -O %USERPROFILE%/.android/adbkey.pub
7483
- command: wget http://artifactory-slo.bf.unity3d.com/artifactory/mobile-generic/android/ADBKeys.zip!/adbkey -O %USERPROFILE%/.android/adbkey
7584
- command: gsudo NetSh Advfirewall set allprofiles state off
76-
85+
7786
# Connect to Android device
7887
- command: '"%ANDROID_SDK_ROOT%\platform-tools\adb.exe" connect %BOKKEN_DEVICE_IP%'
79-
80-
# Run tests
88+
89+
# Run tests for Android devices
8190
- |
8291
set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP%
8392
UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --editor-location=.Editor --player-connection-ip=%BOKKEN_HOST_IP% --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=3600
8493
{% else %}
85-
86-
# Run tests
94+
95+
# Run tests for non-Android devices
8796
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --editor-location=.Editor --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=3600
8897
{% endif %}
8998
artifacts:

0 commit comments

Comments
 (0)