Skip to content

Commit 6344e04

Browse files
committed
Added code-coverage comments and modifications (same as in develop-2.0.0 branch)
1 parent 7be30cd commit 6344e04

File tree

3 files changed

+54
-38
lines changed

3 files changed

+54
-38
lines changed

.yamato/_run-all.yml

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

44
# DESCRIPTION--------------------------------------------------------------------------
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
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
77

88
# QUALITY CONSIDERATIONS---------------------------------------------------------------
9-
# 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.
9+
# 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.
1010

1111
#-----------------------------------------------------------------------------------
1212

.yamato/_triggers.yml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,38 @@
22
---
33

44
# DESCRIPTION--------------------------------------------------------------------------
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 surprises)
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 surprises)
9+
# Each pattern represents different balance between validation depth, execution time and CI resource usage
1010

1111
# TRIGGER PATTERNS-------------------------------------------------------------------
12-
# Pull Request:
13-
# This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered
14-
# Triggers on PRs to develop, develop, and release branches
15-
# Focuses on critical validation paths that we should validate before merging PRs
16-
# Cancels previous runs on new commits
17-
# Excludes draft PRs
12+
# Pull Request:
13+
# This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered
14+
# Triggers on PRs to develop, develop, and release branches
15+
# Focuses on critical validation paths that we should validate before merging PRs
16+
# Cancels previous runs on new commits
17+
# Excludes draft PRs
1818

19-
# Nightly:
20-
# This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds
21-
# Runs daily on develop (local configuration)
22-
# Includes all test types but only on trunk.
23-
# Adds platform-specific and APV validation
19+
# Nightly:
20+
# This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds
21+
# Runs daily on develop (local configuration)
22+
# Includes all test types but only on trunk.
23+
# Adds platform-specific and APV validation
2424

25-
# Weekly:
26-
# This test validates same subset as develop_nightly but runs per all supported editors as well as executes code coverage test and runs project standards per project
27-
# Runs across all supported editor versions
28-
# Includes code coverage analysis
29-
# Validates all projects and standards
25+
# Weekly:
26+
# This test validates same subset as develop_nightly but runs per all supported editors as well as executes code coverage test and runs project standards per project
27+
# Runs across all supported editor versions
28+
# Includes code coverage analysis
29+
# Validates all projects and standards
3030

3131
# 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
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
3434

3535
# QUALITY CONSIDERATIONS---------------------------------------------------------------
36-
# 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.
37-
36+
# 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.
3837

3938

4039
#-----------------------------------------------------------------------------------

.yamato/code-coverage.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
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
---
33

4-
# Runs package tests in order to determine code coverage of the NGO package.
5-
# In essence it's performing the same task as .yamato/package-test jobs with the overhead being the measured code coverage
6-
# It's ok for code coverage to be performed only on one platform (default) since code coverage won't change much between those.
7-
# Default platform was chosen (ubuntu) since it's the fastest and most resource friendly with default editor.
4+
# DESCRIPTION--------------------------------------------------------------------------
5+
# This job is responsible for executing package tests with code coverage analysis enabled.
6+
# Coverage analysis provides insights into:
7+
# Test coverage metrics for NGO assemblies
8+
# Line and branch coverage statistics
9+
# Generated HTML reports for coverage visualization
10+
# Additional metrics for coverage analysis
11+
12+
# CONFIGURATION STRUCTURE--------------------------------------------------------------
13+
# Jobs are generated using nested loops through:
14+
# 1. For default platform only (Ubuntu) since coverage would not vary between platforms (no need for checks on more platforms)
15+
# 2. For default editor version (trunk) since coverage would not vary between editors (no need for checks on more editors)
16+
17+
#TECHNICAL CONSIDERATIONS---------------------------------------------------------------
18+
# 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
19+
# Requires Unity Editor installation
20+
# Burst compilation is disabled to ensure accurate coverage measurement
21+
# 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+
23+
# QUALITY CONSIDERATIONS--------------------------------------------------------------------
24+
# TODO: somewhere in 2025 we will be able to upload resuls to CodeCov from public repos
25+
# To see where this job is included (in trigger job definitions) look into _triggers.yml file
26+
27+
828
{% for platform in test_platforms.default -%}
929
{% for editor in validation_editors.default -%}
1030
code_coverage_{{ platform.name }}_{{ editor }}:
@@ -14,16 +34,13 @@ code_coverage_{{ platform.name }}_{{ editor }}:
1434
image: {{ platform.image }}
1535
flavor: {{ platform.flavor }}
1636
commands:
17-
- npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
18-
- unity-downloader-cli -u {{ editor }} -c Editor --fast --wait
37+
- unity-downloader-cli -u {{ editor }} -c Editor
1938
- upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --unity .Editor
20-
- UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage --code-coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --extra-editor-arg=testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun --artifacts-path=test-results
39+
- UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage -coverage-results-path=$PWD/test-results/CodeCoverage --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
2140
artifacts:
2241
logs:
2342
paths:
2443
- "test-results/**/*"
25-
- "test-results/CodeCoverage/**/*"
26-
- "test-results/CoverageResults/**/*"
2744
dependencies:
2845
- .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }}
2946
{% endfor -%}

0 commit comments

Comments
 (0)