Skip to content

Commit e8ba41b

Browse files
committed
Second comment pass
1 parent 9869eed commit e8ba41b

15 files changed

+179
-142
lines changed

.yamato/_run-all.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
---
33

44
# DESCRIPTION--------------------------------------------------------------------------
5-
# Those jobs group together related test executions
6-
# Enables efficient test execution for different validation scenarios
5+
# Those jobs group together related test as dependencies to allow to easily manage running a given set of tests.
6+
# This enables efficient test execution for different validation scenarios
7+
8+
# CONFIGURATION STRUCTURE--------------------------------------------------------------
9+
# It may seem that there is only 1 job defined, but we are using "for" loops based on .yamato/project.metafile configuration. Yamato "compiles" this code in order to generate jobs with multiple given configurations
10+
# Jobs are generated using nested loops through:
11+
12+
# It's important to ensure that all generated in such way dependencies exist (this can be verified in Yamato)
13+
# 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.
14+
# The downside of our current approach is that it can sometimes impact readability due to the use of nested if and for statements.
715

816
#-----------------------------------------------------------------------------------
917

.yamato/_triggers.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,37 @@
22
---
33

44
# DESCRIPTION--------------------------------------------------------------------------
5-
# Defines three main CI trigger patterns:
6-
# 1. Pull Request Validation: Basic validation for PR changes
7-
# 2. Nightly Development: Comprehensive testing on trunk
8-
# 3. Weekly Full Validation: Complete testing across all editor versions
9-
# Each pattern represents different balance between validation depth, execution time and CI resource usage
5+
# This configuration defines three main CI trigger patterns:
6+
# 1. Pull Request Validation: Validation performed on PR basis
7+
# 2. Nightly Development: Test set run nightly (validates most important test cases)
8+
# 3. Weekly Full Validation: Test set run weekly (validates all test cases to prevent any suprises)
9+
# Each pattern represents different balance between validation depth, execution time and CI resource usage
1010

1111
# TRIGGER PATTERNS-------------------------------------------------------------------
1212
# Pull Request:
13+
# This test validaes Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered
1314
# Triggers on PRs to develop, develop-2.0.0, and release branches
1415
# Focuses on critical validation paths that we should validate before merging PRs
1516
# Cancels previous runs on new commits
1617
# Excludes draft PRs
1718

1819
# Nightly:
20+
# This test validaes same subset as pull_request_trigger with addition of mobile/console tests and webgl builds
1921
# Runs daily on develop-2.0.0 (local configuration)
2022
# Includes all test types but only on trunk. TODO: Add validation for minimum supported editor in nightly
2123
# Adds platform-specific and APV validation
2224

2325
# Weekly:
24-
# Most comprehensive validation
26+
# This test validaes same subset as develop_nightly but runs per all supported editors as well as executes code coverage test and runs project standards per project
2527
# Runs across all supported editor versions
2628
# Includes code coverage analysis
2729
# Validates all projects and standards
2830

31+
# CONFIGURATION STRUCTURE--------------------------------------------------------------
32+
# Jobs configurations are generated by ensuring that all dependencies are successful.
33+
# The dependencies are taken from _run-all.yml file where we can gather multiple tests into proper sets
34+
35+
2936
#-----------------------------------------------------------------------------------
3037

3138
# Run all relevant tasks when a pull request targeting the develop or release branch is created or updated.

.yamato/code-coverage.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
---
33

44
# DESCRIPTION--------------------------------------------------------------------------
5-
# This job executes package tests with code coverage analysis enabled for the NGO (Netcode for GameObjects) package
5+
# This job is responsible for executing package tests with code coverage analysis enabled.
66
# Coverage analysis provides insights into:
77
# Test coverage metrics for NGO assemblies
88
# Line and branch coverage statistics
99
# Generated HTML reports for coverage visualization
1010
# Additional metrics for coverage analysis
1111

1212
# CONFIGURATION STRUCTURE--------------------------------------------------------------
13-
# It may seem that there is only 1 job defined, but we are using for loops based on .yamato/project.metafile configuration. Yamato "compiles" this code in order to generate jobs with multiple given configurations
13+
# It may seem that there is only 1 job defined, but we are using "for" loops based on .yamato/project.metafile configuration. Yamato "compiles" this code in order to generate jobs with multiple given configurations
1414
# Jobs are generated using nested loops through:
1515
# 1. For default platform only (Ubuntu) since coverage would not vary between platforms (no need for checks on more platforms)
1616
# 2. For default editor version (trunk) since coverage would not vary between editors (no need for checks on more editors)
@@ -20,13 +20,14 @@
2020

2121
# The jobs name being generated would be for example "Code Coverage - NGO [testproject, 6000.0]" (name visible in Yamato) or "code_coverage_testproject_6000.0" (job name when querying for it)
2222

23-
#TECHNICAL CONSTRAINTS---------------------------------------------------------------
23+
#TECHNICAL CONSIDERATIONS---------------------------------------------------------------
24+
# 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
2425
# Requires Unity Editor installation
25-
# Uses UnifiedTestRunner (UTR) for test execution
26-
# Depends on successful package pack job completion
2726
# Burst compilation is disabled to ensure accurate coverage measurement
27+
# 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
2828

29-
# QUALITY THOUGHTS--------------------------------------------------------------------
29+
# QUALITY CONSIDERATIONS--------------------------------------------------------------------
30+
# TODO: somewhere in 2025 we will be able to upload resuls to CodeCov from public repos
3031
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
3132

3233

.yamato/console-standalone-test.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,30 @@
22
---
33

44
# DESCRIPTION--------------------------------------------------------------------------
5-
# This file contains Console platform test validation for NGO package consisting of two phases:
6-
# 1. Build Phase: Creates standalone players for console platforms
7-
# 2. Run Phase: Executes runtime tests on actual console devices
8-
# Those phases need to be separated (in contrast to for example desktop tests)
5+
# This job is responsible for Console platform test validation.
6+
# Those tests cover both PlayMode and EditMode tests from package test assemblies.
97

108
# CONFIGURATION STRUCTURE--------------------------------------------------------------
11-
# It may seem that there is only 1 job defined, but we are using for loops based on .yamato/project.metafile configuration. Yamato "compiles" this code in order to generate jobs with multiple given configurations
9+
# It may seem that there is only 1 job defined, but we are using "for" loops based on .yamato/project.metafile configuration. Yamato "compiles" this code in order to generate jobs with multiple given configurations
1210
# Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency:
13-
# 1. For all console platform (Switch, ps4, ps5, xbox360, xboxOne) defined in test_platforms.console_ (in project.metafile)
14-
# 2. For all supported Unity Editor versions (for NGOv2.X this means 6000.0+ editors defined in project.metafile)
15-
# 3. For default project which serves as context
11+
# 1. For all console platform (Switch, ps4, ps5, xbox360, xboxOne)
12+
# 2. For all supported Unity Editor versions (for NGOv2.X this means 6000.0+ editors)
13+
` # 3. For the default project.
1614
1715
# 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.
1816
# The downside of our current approach is that it can sometimes impact readability due to the use of nested if and for statements.
1917
2018
# The jobs name being generated would be for example "Build testproject - [win, 6000.0, il2cpp]" (name visible in Yamato) or "console_standalone_build_testproject_win_6000.0" (job name when querying for it)
2119
20+
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
21+
# For console devices a split is required into two phases:
22+
# 1. Build Phase: Creates standalone players for console platforms
23+
# 2. Run Phase: Executes runtime tests on actual console devices
24+
# The Run phase uses build job as dependency
25+
26+
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
27+
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
28+
2229
# PLATFORM SPECIFICS-----------------------------------------------------------------
2330
# Common Requirements:
2431
# All consoles require IL2CPP scripting backend
@@ -28,11 +35,9 @@
2835
# Switch: ARM64 architecture only
2936
# Other Consoles: x64 architecture
3037
# Each console requires specific SDK paths and tools
31-
32-
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
33-
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
3438
3539
# QUALITY THOUGHTS--------------------------------------------------------------------
40+
# TODO: consider adding all projects that have tests
3641
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
3742
3843

.yamato/desktop-standalone-tests.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,33 @@
22
---
33

44
# DESCRIPTION--------------------------------------------------------------------------
5-
# This file contains Desktop platform test validation for NGO package consisting of two phases:
6-
# 1. Build Phase: Creates standalone players for desktop platforms
7-
# 2. Run Phase: Executes runtime tests on actual desktop devices
8-
# For desktop devices the phase separation is not necessary, but we did it for consistency with other standalone tests configurations
5+
# This job is responsible for Desktop platform test validation.
6+
# Those tests cover both PlayMode and EditMode tests from package test assemblies.
97

108
# CONFIGURATION STRUCTURE--------------------------------------------------------------
11-
# It may seem that there is only 1 job defined, but we are using for loops based on .yamato/project.metafile configuration. Yamato "compiles" this code in order to generate jobs with multiple given configurations
9+
# It may seem that there is only 1 job defined, but we are using "for" loops based on .yamato/project.metafile configuration. Yamato "compiles" this code in order to generate jobs with multiple given configurations
1210
# Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency:
13-
# 1. For all desktop platform (Windows, macOS, Ubuntu) defined in test_platforms.desktop_ (in project.metafile)
14-
# 2. For all supported Unity Editor versions (for NGOv2.X this means 6000.0+ editors defined in project.metafile)
15-
# 3. For default project which serves as context
16-
# 4. For all scripting backends
11+
# 1. For all desktop platform (Windows, macOS, Ubuntu)
12+
# 2. For all supported Unity Editor versions (for NGOv2.X this means 6000.0+ editors)
13+
# 3. For the default project.
14+
# 4. For all scripting backends (mono, il2cpp)
1715

1816
# 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.
1917
# The downside of our current approach is that it can sometimes impact readability due to the use of nested if and for statements.
2018

2119
# The jobs name being generated would be for example "Standalone Build - NGO testproject - [win, mono, 6000.0]" (name visible in Yamato) or "desktop_standalone_build_testproject_win_mono_6000.0" (job name when querying for it)
2220

21+
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
22+
# For desktop devices a split is into two phases is not required but we use it for consistency with setup of others standalone platforms:
23+
# 1. Build Phase: Creates standalone players for desktop platforms
24+
# 2. Run Phase: Executes runtime tests on actual desktop devices
25+
# The Run phase uses build job as dependency
26+
27+
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
28+
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
29+
2330
# QUALITY THOUGHTS--------------------------------------------------------------------
31+
# TODO: consider adding all projects that have tests
2432
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
2533

2634
#-----------------------------------------------------------------------------------

.yamato/mobile-standalone-test.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@
22
---
33

44
# DESCRIPTION--------------------------------------------------------------------------
5-
# This file contains Mobile platform test validation for NGO package consisting of two phases:
6-
# 1. Build Phase: Creates standalone players for mobile platforms
7-
# 2. Run Phase: Executes runtime tests on actual mobile devices
8-
# Those phases need to be separated (in contrast to for example desktop tests)
5+
# This job is responsible for Mobile platform test validation.
6+
# Those tests cover both PlayMode and EditMode tests from package test assemblies.
97

108
# CONFIGURATION STRUCTURE--------------------------------------------------------------
11-
# It may seem that there is only 1 job defined, but we are using for loops based on .yamato/project.metafile configuration. Yamato "compiles" this code in order to generate jobs with multiple given configurations
12-
# Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency:
13-
# 1. For all mobile platform (Android, iOS) defined in test_platforms.mobile_ (in project.metafile)
14-
# 2. For all supported Unity Editor versions (for NGOv2.X this means 6000.0+ editors defined in project.metafile)
15-
# 3. For default project which serves as context
9+
# It may seem that there is only 1 job defined, but we are using "for" loops based on .yamato/project.metafile configuration. Yamato "compiles" this code in order to generate jobs with multiple given configurations
10+
# Jobs are generated using nested loops through:
11+
# 1. For all mobile platform (Android, iOS)
12+
# 2. For all supported Unity Editor versions (for NGOv2.X this means 6000.0+ editors)
13+
# 3. For the default project.
1614

1715
# 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.
1816
# The downside of our current approach is that it can sometimes impact readability due to the use of nested if and for statements.
1917

2018
# The jobs name being generated would be for example "Build testproject - [win, 6000.0, il2cpp]" (name visible in Yamato) or "build_testproject_win_6000.0" (job name when querying for it)
2119

22-
# PLATFORM SPECIFICS-----------------------------------------------------------------
20+
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
21+
# For mobile devices a split is required into two phases:
22+
# 1. Build Phase: Creates standalone players for mobile platforms
23+
# 2. Run Phase: Executes runtime tests on actual mobile devices
24+
# The Run phase uses build job as dependency
25+
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
26+
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
27+
28+
# PLATFORM SPECIFICS--------------------------------------------------------------------
2329
# iOS Requirements:
2430
# Must use IL2CPP scripting backend
2531
# Only supports ARM64 architecture
@@ -29,11 +35,9 @@
2935
# Uses IL2CPP scripting backend (recommended over Mono)
3036
# Supports both ARM64 and ARMv7 architectures
3137
# Can be build on any desktop platform
32-
33-
# Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices
34-
# Note: More of a Unity specific but test assemblies need to be included in the build phase command
3538

36-
# QUALITY THOUGHTS--------------------------------------------------------------------
39+
# QUALITY CONSIDERATIONS--------------------------------------------------------------------
40+
# TODO: consider adding all projects that have tests
3741
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
3842

3943

@@ -49,7 +53,6 @@ mobile_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}:
4953
flavor: {{ platform.flavor }}
5054
commands:
5155
- unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %}
52-
5356
- 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
5457
artifacts:
5558
players:
@@ -77,7 +80,7 @@ mobile_standalone_test_{{ project.name }}_tests_{{ platform.name }}_{{ editor }}
7780
model: {{ platform.model }}
7881
{% endif %}
7982
commands:
80-
# Installing editor. We still need the editor to run tests on standalone build
83+
# Installing editor. We still need the editor to run tests on standalone build and for that the Editor is required
8184
- unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %}
8285

8386
{% if platform.standalone == "Android" %}

0 commit comments

Comments
 (0)