Skip to content

Commit 1ef98b8

Browse files
chore: [Backport] Small yamato tweaks (#3724)
* chore: [Backport] Small yamato tweaks * Backport of PR-3725 --------- Co-authored-by: michal-chrobot <[email protected]>
1 parent 7fb6ed5 commit 1ef98b8

16 files changed

+138
-157
lines changed

.yamato/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ CI related files are present inside .yamato/ folder and we can distinguish speci
99

1010
### Helper jobs
1111
- `.yamato/package-pack.yml` responsible for generating package artifacts (.tgz) required for testing and publishing.
12-
- `.yamato/project-pack.yml` responsible for generating package artifacts (.tgz) required for testing and publishing. This packs all packages of a given project.
1312
- `.yamato/_run-all.yml` responsible for grouping tests into groups for easier management (for example "all console tests").
1413
- `.yamato/_triggers.yml` responsible for defining triggers (PR, nightly, weekly etc.) and defining which tests to run.
1514
- `disable-burst-if-requested.py` responsible for helping to disable burst if needed.
@@ -77,4 +76,4 @@ Currently, the CI implementation supports the following platforms:
7776

7877
## Design Considerations
7978
In theory, we could manually write jobs for every configuration. However, this approach would be more error-prone, especially when modifications or fixes are needed, as it would require keeping track of all configurations.
80-
The downside of our current approach is that it can sometimes impact readability due to the use of nested if and for statements.
79+
The downside of our current approach is that it can sometimes impact readability due to the use of nested if and for statements.

.yamato/_run-all.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ run_quick_checks:
1717
dependencies:
1818
- .yamato/package-pack.yml#package_pack_-_ngo_ubuntu
1919
- .yamato/project-standards.yml#standards_ubuntu_testproject_6000.2
20-
# Run API validation to early-detect all new APIs that would force us to release new minor version of the package. Note that for this to work the package version in package.json must correspond to "actual package state" which means that it should be higher than last released version
21-
- .yamato/vetting-test.yml#vetting_test
2220

2321
# Runs all package tests
2422
run_all_package_tests:

.yamato/_triggers.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# It's important to ensure that all dependencies exist (this can be verified in Yamato) since a modification in parameters may result in a given job not being generated, and thus we will not be able to run such erroneous job.
4242

4343

44-
#-----------------------------------------------------------------------------------
44+
#-----------------------------------------------------------------------------------
4545

4646
# After some experimenting with CI setups we discovered that even though sometimes we don't need CI to run (no reason to run package tests if only Documentation is changed) there are some checks that devs may not realize but changes in seemingly unrelated files will cause their failures
4747
# This trigger was created to ensure that ALL PRs run this minimal check even when we don't need to run full tests
@@ -69,6 +69,9 @@ pr_code_changes_checks:
6969
name: Code changes PR checks
7070
# Run the following tests on a selection of different desktop platforms
7171
dependencies:
72+
# Run API validation to early-detect all new APIs that would force us to release new minor version of the package. Note that for this to work the package version in package.json must correspond to "actual package state" which means that it should be higher than last released version
73+
- .yamato/vetting-test.yml#vetting_test
74+
7275
# Run package EditMode and Playmode package tests on 6000.2 (latest supported editor) and an older supported editor (2022.3) (2022.3 will soon be a minimum supported editor)
7376
- .yamato/package-tests.yml#package_test_-_ngo_6000.2_mac
7477
- .yamato/package-tests.yml#package_test_-_ngo_2022.3_win
@@ -104,9 +107,9 @@ pr_code_changes_checks:
104107
"**/*.md"
105108
]
106109
cancel_old_ci: true
107-
108-
109-
110+
111+
112+
110113

111114

112115

@@ -122,6 +125,8 @@ develop_nightly:
122125
frequency: daily
123126
rerun: always
124127
dependencies:
128+
# Run API validation to early-detect all new APIs that would force us to release new minor version of the package. Note that for this to work the package version in package.json must correspond to "actual package state" which means that it should be higher than last released version
129+
- .yamato/vetting-test.yml#vetting_test
125130
# Run project standards to verify package/default project
126131
- .yamato/project-standards.yml#standards_ubuntu_testproject_6000.2
127132
- .yamato/project-standards.yml#standards_ubuntu_testproject_2022.3
@@ -164,6 +169,8 @@ develop_weekly_trunk:
164169
frequency: weekly
165170
rerun: always
166171
dependencies:
172+
# Run API validation to early-detect all new APIs that would force us to release new minor version of the package. Note that for this to work the package version in package.json must correspond to "actual package state" which means that it should be higher than last released version
173+
- .yamato/vetting-test.yml#vetting_test
167174
# Run project standards to verify package/default project
168175
- .yamato/_run-all.yml#run_all_projects_standards
169176
# Run package EditMode and Playmode tests on desktop platforms

.yamato/code-coverage.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88
# Line and branch coverage statistics
99
# Generated HTML reports for coverage visualization
1010
# Additional metrics for coverage analysis
11-
11+
1212
# CONFIGURATION STRUCTURE--------------------------------------------------------------
1313
# Jobs are generated using nested loops through:
1414
# 1. For default platform only (Ubuntu) since coverage would not vary between platforms (no need for checks on more platforms)
1515
# 2. For default editor version (6000.2) since coverage would not vary between editors (no need for checks on more editors)
16-
16+
1717
#TECHNICAL CONSIDERATIONS---------------------------------------------------------------
1818
# In theory this job also runs package tests, but we don't want to use it as default since is heavier (because of added coverage analysis) and coverage is not changing that often
1919
# Requires Unity Editor installation
2020
# Burst compilation is disabled to ensure accurate coverage measurement
2121
# In order to properly use -coverage-results-path parameter we need to start it with $PWD (which means the absolute path). Otherwise, coverage results will not be visible
22-
22+
2323
# QUALITY CONSIDERATIONS--------------------------------------------------------------------
2424
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
25-
26-
25+
26+
2727
{% for platform in test_platforms.default -%}
2828
{% for editor in validation_editors.default -%}
2929
code_coverage_{{ platform.name }}_{{ editor }}:
@@ -38,12 +38,12 @@ code_coverage_{{ platform.name }}_{{ editor }}:
3838
commands:
3939
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models
4040
- upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --unity .Editor
41-
- UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage coverage-upload-options="reportsDir:$PWD/test-results/CoverageResults;name:NGOv1_{{ platform.name }}_{{ editor }};flags:NGOv1_{{ platform.name }}_{{ editor }};verbose" --coverage-results-path=$PWD/test-results/CoverageResults --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout=1800 --reruncount=1 --clean-library-on-rerun --artifacts-path=test-results
41+
- UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage coverage-upload-options="reportsDir:$PWD/test-results/CoverageResults;name:NGOv1_{{ platform.name }}_{{ editor }};flags:NGOv1_{{ platform.name }}_{{ editor }};verbose" --coverage-results-path=$PWD/test-results/CoverageResults --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout={ test_timeout }} --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --artifacts-path=test-results
4242
artifacts:
4343
logs:
4444
paths:
4545
- "test-results/**/*"
4646
dependencies:
4747
- .yamato/package-pack.yml#package_pack_-_ngo_ubuntu
4848
{% endfor -%}
49-
{% endfor -%}
49+
{% endfor -%}

.yamato/console-standalone-test.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
# DESCRIPTION--------------------------------------------------------------------------
55
# This job is responsible for Console platform test validation.
66
# Those tests cover both PlayMode and EditMode tests from package test assemblies.
7-
7+
88
# CONFIGURATION STRUCTURE--------------------------------------------------------------
99
# Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency:
1010
# 1. For all console platform (Switch, ps4, ps5, xbox360, xboxOne)
1111
# 2. For all supported Unity Editor versions (for NGOv1.X this means 2022.3+ editors)
1212
# 3. For the default project.
13-
13+
1414
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
1515
# For console devices a split is required into two phases:
1616
# 1. Build Phase: Creates standalone players for console platforms
1717
# 2. Run Phase: Executes runtime tests on actual console devices
1818
# The Run phase uses build job as dependency
19-
19+
2020
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
2121
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
22-
22+
2323
# PLATFORM SPECIFICS-----------------------------------------------------------------
2424
# Common Requirements:
2525
# All consoles require IL2CPP scripting backend
@@ -29,13 +29,13 @@
2929
# Switch: ARM64 architecture only
3030
# Other Consoles: x64 architecture
3131
# Each console requires specific SDK paths and tools
32-
32+
3333
# QUALITY THOUGHTS--------------------------------------------------------------------
3434
# TODO: consider adding all projects that have tests
3535
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
36-
37-
38-
36+
37+
38+
3939
# BUILD PHASE CONFIGURATION------------------------------------------------------------------------------------
4040
{% for project in projects.default -%}
4141
{% for platform in test_platforms.console_build -%}
@@ -51,7 +51,7 @@ console_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}:
5151
{% endif %}
5252
commands:
5353
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor -c il2cpp -c {{ platform.name }}
54-
- UnifiedTestRunner --testproject={{ project.path }} --architecture={% if platform.name == "switch" %}arm64{% else %}x64{% endif %} --scripting-backend=il2cpp --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --artifacts-path=artifacts --player-save-path=build/players --testfilter="Unity.Netcode.RuntimeTests.*" --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800
54+
- UnifiedTestRunner --testproject={{ project.path }} --architecture={% if platform.name == "switch" %}arm64{% else %}x64{% endif %} --scripting-backend=il2cpp --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --artifacts-path=artifacts --player-save-path=build/players --testfilter="Unity.Netcode.RuntimeTests.*" --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout={{ test_timeout}}
5555
variables:
5656
# PS4 related
5757
SCE_ORBIS_SDK_DIR: 'C:\Users\bokken\SCE\ps4_sdk_12_00'
@@ -72,9 +72,9 @@ console_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}:
7272
{% endfor -%}
7373
{% endfor -%}
7474
{% endfor -%}
75-
76-
77-
75+
76+
77+
7878
# RUN PHASE CONFIGURATION------------------------------------------------------------------------------------
7979
{% for project in projects.default -%}
8080
{% for platform in test_platforms.console_test -%}
@@ -109,4 +109,4 @@ console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }}:
109109
- .yamato/console-standalone-test.yml#console_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}
110110
{% endfor -%}
111111
{% endfor -%}
112-
{% endfor -%}
112+
{% endfor -%}

.yamato/desktop-standalone-tests.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@
44
# DESCRIPTION--------------------------------------------------------------------------
55
# This job is responsible for Desktop platform test validation.
66
# Those tests cover both PlayMode and EditMode tests from package test assemblies.
7-
7+
88
# CONFIGURATION STRUCTURE--------------------------------------------------------------
99
# Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency:
1010
# 1. For all desktop platform (Windows, macOS, Ubuntu)
1111
# 2. For all supported Unity Editor versions (for NGOv1.X this means 2022.3+ editors)
1212
# 3. For the default project.
1313
# 4. For all scripting backends (mono, il2cpp)
14-
14+
1515
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
1616
# For desktop devices a split is into two phases is not required but we use it for consistency with setup of others standalone platforms:
1717
# 1. Build Phase: Creates standalone players for desktop platforms
1818
# 2. Run Phase: Executes runtime tests on actual desktop devices
1919
# The Run phase uses build job as dependency
20-
20+
2121
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
2222
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
23-
23+
2424
# QUALITY THOUGHTS--------------------------------------------------------------------
2525
# TODO: consider adding all projects that have tests
2626
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
27-
27+
2828
#-----------------------------------------------------------------------------------
29-
30-
29+
30+
3131
# BUILD PHASE CONFIGURATION------------------------------------------------------------------------------------
3232
{% for project in projects.default -%}
3333
{% for platform in test_platforms.desktop -%}
@@ -53,15 +53,16 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{
5353
paths:
5454
- "artifacts/**/*"
5555
dependencies:
56-
- .yamato/project-pack.yml#project_pack_-_{{ project.name }}_{{ platform.name }}
56+
- .yamato/_run-all.yml#run_quick_checks # initial checks to perform fast validation of common errors
57+
- .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }}
5758
{% endfor -%}
5859
{% endfor -%}
5960
{% endfor -%}
6061
{% endfor -%}
61-
62-
63-
64-
62+
63+
64+
65+
6566
# RUN PHASE CONFIGURATION------------------------------------------------------------------------------------
6667
{% for project in projects.default -%}
6768
{% for platform in test_platforms.desktop -%}
@@ -78,7 +79,7 @@ desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{
7879
{% endif %}
7980
commands:
8081
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %}
81-
- 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
82+
- UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }}
8283
artifacts:
8384
logs:
8485
paths:

0 commit comments

Comments
 (0)