Skip to content

Commit

Permalink
NEW: add code coverage to CI jobs running Editor and Playmode tests o…
Browse files Browse the repository at this point in the history
…n editor platforms (#2086)

Co-authored-by: Nikos Chagialas <[email protected]>
  • Loading branch information
stefanunity and unity-nikos authored Dec 18, 2024
1 parent aec5efc commit 7924b18
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
17 changes: 10 additions & 7 deletions .yamato/config.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@ upm_ci_install: npm install -g upm-ci-utils@stable --registry https://artifactor
platforms_win:
- name: win
type: Unity::VM
image: package-ci/win10:default
image: package-ci/win10:v4
flavor: b1.large
- name: win_standalone
type: Unity::VM
image: package-ci/win10:default
image: package-ci/win10:v4
flavor: b1.large
runtime: StandaloneWindows64
- name: win_standalone_il2cpp
type: Unity::VM
image: package-ci/win10:default
image: package-ci/win10:v4
flavor: b1.large
runtime: StandaloneWindows64
scripting-backend: Il2Cpp
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP --wait --fast -u
platforms_nix:
- name: mac
type: Unity::VM::osx
image: package-ci/macos-13:default
image: package-ci/macos-13:v4
flavor: m1.mac
instabilities_run: sh ./run_standalone_instability_detection-latest.sh macos 0.5.1 || exit 0
- name: mac_standalone
type: Unity::VM::osx
image: package-ci/macos-13:default
image: package-ci/macos-13:v4
flavor: m1.mac
instabilities_run: sh ./run_standalone_instability_detection-latest.sh macos 0.5.1 || exit 0
runtime: StandaloneOSX
- name: mac_standalone_il2cpp
type: Unity::VM::osx
image: package-ci/macos-13:default
image: package-ci/macos-13:v4
flavor: m1.mac
instabilities_run: sh ./run_standalone_instability_detection-latest.sh macos 0.5.1 || exit 0
runtime: StandaloneOSX
Expand Down Expand Up @@ -84,4 +84,7 @@ instabilities_install_win: curl -s https://artifactory.prd.it.unity3d.com/artifa
instabilities_run_win: run_standalone_instability_detection-latest.bat 0.5.1 || exit 0

instabilities_install_nix: curl -s https://artifactory.prd.it.unity3d.com/artifactory/automation-and-tooling/infrastructure-instability-detection/standalone/setup/run_standalone_instability_detection-latest.sh --output run_standalone_instability_detection-latest.sh --retry 5 || exit 0
instabilities_run_mac: sh ./run_standalone_instability_detection-latest.sh macos 0.5.1 || exit 0
instabilities_run_mac: sh ./run_standalone_instability_detection-latest.sh macos 0.5.1 || exit 0

yamato_source_dir_win: "%YAMATO_SOURCE_DIR%"
yamato_source_dir_nix: ${YAMATO_SOURCE_DIR}
10 changes: 6 additions & 4 deletions .yamato/upm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
- move /Y .\Assets\Samples.meta .\Packages\com.unity.inputsystem
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
# Run upm-ci verification tests as well as tests contained in the package.
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
{% if platform.name == "win" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem"
--extra-utr-arg="--coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package" {% endif %}
{% if platform.installscript %}
- {{ unity_downloader_install }}
- {{ platform.installscript }} {{ editor.version }}
Expand All @@ -33,7 +35,7 @@
- move /Y .\Packages\com.unity.inputsystem\Samples .\Assets
- move /Y .\Packages\com.unity.inputsystem\Samples.meta .\Assets
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "win" %} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "win" %} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem {% if platform.name == "win" %}--enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project {% endif %}
after:
- {{ instabilities_install_win }}
- {{ instabilities_run_win }}
Expand Down Expand Up @@ -64,7 +66,7 @@
- mv ./Assets/Samples.meta ./Packages/com.unity.inputsystem
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
# Run upm-ci verification tests as well as tests contained in the package.
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }} {% if platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Package" {% endif %}
{% if platform.installscript %}
- {{ unity_downloader_install }}
- {{ platform.installscript }} {{ editor.version }}
Expand All @@ -74,7 +76,7 @@
- mv ./Packages/com.unity.inputsystem/Samples ./Assets
- mv ./Packages/com.unity.inputsystem/Samples.meta ./Assets
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" %} --suite=editor {% endif %} {% if platform.name == "linux" %} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" or platform.name == "linux"%} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem {% if platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project {% endif %}
after:
- {{ instabilities_install_nix }}
- {{ platform.instabilities_run }}
Expand Down

0 comments on commit 7924b18

Please sign in to comment.