Skip to content

Commit b42ea68

Browse files
authored
chore: Add Standalone Tests for IL2CPP backend (#1923)
1 parent d949e99 commit b42ea68

File tree

5 files changed

+46
-20
lines changed

5 files changed

+46
-20
lines changed

.yamato/_run-all.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ run_all_tests:
77
- .yamato/_triggers.yml#badges_test_trigger
88
- .yamato/mobile-build-and-test.yml#2021.2_Run_iOS_Player_With_Tests
99
- .yamato/mobile-build-and-test.yml#2021.2_Run_Android_Player_With_Tests
10+
# - .yamato/_run-all.yml#all_project_tests_standalone
1011
{% for platform in test_platforms -%}
1112
{% for project in projects -%}
1213
{% for editor in project.test_editors -%}
@@ -39,7 +40,6 @@ run_all_tests_trunk:
3940
all_project_tests:
4041
name: Run All Project Tests
4142
dependencies:
42-
# Pull in package and validate jobs through the badges job
4343
- .yamato/_triggers.yml#badges_test_trigger
4444
{% for platform in test_platforms -%}
4545
{% for project in projects -%}
@@ -52,7 +52,6 @@ all_project_tests:
5252
all_package_tests:
5353
name: Run All Package Tests
5454
dependencies:
55-
# Pull in package and validate jobs through the badges job
5655
- .yamato/_triggers.yml#badges_test_trigger
5756
{% for platform in test_platforms -%}
5857
{% for project in projects -%}
@@ -67,7 +66,6 @@ all_package_tests:
6766
all_singlenode_multiprocess_tests:
6867
name: Run All Multiprocess Tests - Single Node
6968
dependencies:
70-
# Pull in package and validate jobs through the badges job
7169
{% for platform in test_platforms -%}
7270
{% for project in projects -%}
7371
{% for editor in project.test_editors -%}
@@ -77,3 +75,18 @@ all_singlenode_multiprocess_tests:
7775
{% endfor -%}
7876
{% endfor -%}
7977
{% endfor -%}
78+
79+
all_project_tests_standalone:
80+
name: Run All Project Tests - Standalone
81+
dependencies:
82+
{% for platform in test_platforms -%}
83+
{% for project in projects -%}
84+
{% if project.has_tests == "true" -%}
85+
{% for editor in project.test_editors -%}
86+
{% for backend in scripting_backends -%}
87+
- .yamato/standalone-project-tests.yml#standalone_tests_{{ project.name }}_{{ backend }}_{{ editor }}_{{ platform.name }}
88+
{% endfor -%}
89+
{% endfor -%}
90+
{% endif -%}
91+
{% endfor -%}
92+
{% endfor -%}

.yamato/_triggers.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% metadata_file .yamato/project.metafile %}
22
---
33
develop_nightly:
4-
name: "[Nightly] Run All Tests"
4+
name: "\U0001F319 [Nightly] Run All Tests"
55
triggers:
66
recurring:
77
- branch: develop
@@ -14,7 +14,7 @@ develop_nightly:
1414
{% endfor -%}
1515

1616
develop_weekly_trunk:
17-
name: "[Weekly] Run All Tests [Trunk]"
17+
name: "\U0001F319 [Weekly] Run All Tests [Trunk]"
1818
triggers:
1919
recurring:
2020
- branch: develop
@@ -24,7 +24,7 @@ develop_weekly_trunk:
2424
- .yamato/_run-all.yml#run_all_tests_trunk
2525

2626
multiprocess_nightly:
27-
name: "[Nightly] Run Multiprocess Tests"
27+
name: "\U0001F319 [Nightly] Run Multiprocess Tests"
2828
triggers:
2929
recurring:
3030
- branch: develop
@@ -65,7 +65,7 @@ pull_request_trigger:
6565
# Currently, we need to have a trigger to updated badges
6666
# Only package badges currently exist
6767
badges_test_trigger:
68-
name: Badges Tests Trigger
68+
name: Badges Tests Trigger
6969
agent:
7070
type: Unity::VM
7171
image: package-ci/ubuntu:stable

.yamato/code-coverage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% metadata_file .yamato/project.metafile %}
22
---
33
{% for project in projects -%}
4+
{% if project.has_tests == "true" -%}
45
code_coverage_win_{{ project.name }}_{{ validation_editor }}:
56
name: Code Coverage Report - Windows - {{ project.name }} - {{ validation_editor }}
67
agent:
@@ -18,4 +19,5 @@ code_coverage_win_{{ project.name }}_{{ validation_editor }}:
1819
- "upm-ci~/test-results/**/*"
1920
dependencies:
2021
- .yamato/project-pack.yml#pack_{{ project.name }}
22+
{% endif -%}
2123
{% endfor -%}

.yamato/project.metafile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ projects:
3535
path: testproject
3636
validate: true
3737
publish: true
38+
has_tests: true
3839
# Packages within a project that will be tested
3940
packages:
4041
- name: com.unity.netcode.gameobjects
@@ -47,6 +48,7 @@ projects:
4748
path: minimalproject
4849
validate: false
4950
publish: false
51+
has_tests: false
5052
packages:
5153
- name: com.unity.netcode.gameobjects
5254
path: com.unity.netcode.gameobjects
@@ -56,6 +58,15 @@ projects:
5658
path: testproject-tools-integration
5759
validate: false
5860
publish: false
61+
has_tests: true
5962
test_editors:
6063
- 2021.3
6164
- trunk
65+
66+
# Scripting backends used by Standalone Playmode Tests
67+
scripting_backends:
68+
- mono
69+
- il2cpp
70+
71+
# Images with build-tools installed required for Standalone Tests - IL2CPP
72+
win_il2cpp_test_image: dots-player/windows10:latest

.yamato/standalone-project-tests.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{% metadata_file .yamato/project.metafile %}
22
---
33

4-
# For every platform and editor version, run its project tests without
5-
# running package tests too since they are handled on their respective
6-
# jobs
74
{% for project in projects -%}
5+
{% if project.has_tests == "true" -%}
86
{% for editor in project.test_editors -%}
97
{% for platform in test_platforms -%}
10-
standalone_test_{{ project.name }}_{{ editor }}_{{ platform.name }}:
11-
name : standalone {{ project.name }} tests - {{ editor }} on {{ platform.name }}
8+
{% for backend in scripting_backends -%}
9+
standalone_tests_{{ project.name }}_{{ backend }}_{{ editor }}_{{ platform.name }}:
10+
name : Standalone Tests - {{ project.name }} - [{{ backend }}, {{ platform.name }}, {{ editor }}]
1211
agent:
1312
type: {{ platform.type }}{% if platform.name == "ubuntu" %}::GPU{% endif %}
1413
{% if platform.name == "ubuntu" %} model: rtx2080{% endif %}
15-
image: {{ platform.image }}
14+
image: {% if platform.name == 'win' and backend == 'il2cpp' %}{{ win_il2cpp_test_image }} {% else %} {{ platform.image }} {% endif %}
1615
flavor: {{ platform.flavor}}
1716
commands:
1817
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
1918
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
2019
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr{% if platform.name == "win" %}.bat{% endif %} --output utr{% if platform.name == "win" %}.bat{% endif %}
21-
{% if platform.name != "win" %} - chmod +x ./utr{% endif %}
22-
- unity-downloader-cli -u {{editor}} -c Editor --fast --wait
23-
- {% if platform.name != "win" %}./{% endif %}utr --suite=playmode --platform={{platform.standalone}} --editor-location=.Editor --testproject=testproject --player-save-path=build/players --artifacts_path=build/logs --scripting-backend=mono --build-only --testfilter=Unity.Netcode.RuntimeTests --extra-editor-arg=-batchmode --extra-editor-arg=-nographics
20+
{% if platform.name != "win" %}
21+
- chmod +x ./utr
22+
{% endif %}
23+
- unity-downloader-cli -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp{% endif %} --fast --wait
24+
- {% if platform.name != "win" %}./{% endif %}utr --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --testproject=testproject --player-save-path=build/players --artifacts_path=build/logs --scripting-backend={{ backend }} --build-only --testfilter=Unity.Netcode.RuntimeTests --extra-editor-arg=-batchmode --extra-editor-arg=-nographics
2425
- |
2526
{% if platform.name == "win" %}set{% endif %}{% if platform.name != "win" %}export{% endif %} UTR_VERSION=0.12.0
26-
{% if platform.name != "win" %}./{% endif %}utr --suite=playmode --platform={{platform.standalone}} --player-load-path=build/players --artifacts_path=build/test-results --testfilter=Unity.Netcode.RuntimeTests --playergraphicsapi=Null
27-
- echo {{ platform.name }}
27+
{% if platform.name != "win" %}./{% endif %}utr --suite=playmode --platform={{ platform.standalone }} --player-load-path=build/players --artifacts_path=build/test-results --scripting-backend={{ backend }} --testfilter=Unity.Netcode.RuntimeTests --playergraphicsapi=Null
2828
artifacts:
2929
logs:
3030
paths:
@@ -36,5 +36,5 @@ standalone_test_{{ project.name }}_{{ editor }}_{{ platform.name }}:
3636
{% endfor -%}
3737
{% endfor -%}
3838
{% endfor -%}
39-
40-
39+
{% endif -%}
40+
{% endfor -%}

0 commit comments

Comments
 (0)