From a5df3df1207a64d2f235e944d22aa876f40b0fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Tue, 18 Mar 2025 15:51:11 +0100 Subject: [PATCH 01/23] Update labels in issue templates Correction of stat:awaiting triage label since name changed to stat:awaiting-triage as well as adding a default stat:reply:needed --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/ISSUE_TEMPLATE/feedback.md | 2 +- .github/ISSUE_TEMPLATE/other-issues.md | 2 +- .github/ISSUE_TEMPLATE/rfc-tracking-issue.md | 2 +- .github/ISSUE_TEMPLATE/support.md | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 19f05fa213..403f5c841b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a report to help us improve title: '' -labels: stat:awaiting triage, type:bug +labels: stat:awaiting-triage, stat:reply-needed, type:bug assignees: '' --- @@ -39,4 +39,4 @@ If applicable, add screenshots to help explain your problem. ### Additional Context -Add any other context about the problem here. Logs, code snippets would be useful here but please also consider attaching a minimal Unity project that reproduces the issue. \ No newline at end of file +Add any other context about the problem here. Logs, code snippets would be useful here but please also consider attaching a minimal Unity project that reproduces the issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index b60aea003a..4f2bd56e8f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature Request about: Suggest an idea for this project title: '' -labels: stat:awaiting triage, type:feature +labels: stat:awaiting-triage, stat:reply-needed, type:feature assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/feedback.md b/.github/ISSUE_TEMPLATE/feedback.md index 30aad2a683..07c76f975c 100644 --- a/.github/ISSUE_TEMPLATE/feedback.md +++ b/.github/ISSUE_TEMPLATE/feedback.md @@ -2,7 +2,7 @@ name: Feedback about: Provide feedback to the Netcode for GameObjects team title: '' -labels: stat:awaiting triage, type:feedback +labels: stat:awaiting-triage, stat:reply-needed, type:feedback assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/other-issues.md b/.github/ISSUE_TEMPLATE/other-issues.md index 72ca8eeecf..8b00095b8b 100644 --- a/.github/ISSUE_TEMPLATE/other-issues.md +++ b/.github/ISSUE_TEMPLATE/other-issues.md @@ -2,7 +2,7 @@ name: Other Issues about: Use this template for any other non-support related issues title: '' -labels: stat:awaiting triage +labels: stat:awaiting-triage, stat:reply-needed assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/rfc-tracking-issue.md b/.github/ISSUE_TEMPLATE/rfc-tracking-issue.md index 5d2468d7da..3b112ff8bb 100644 --- a/.github/ISSUE_TEMPLATE/rfc-tracking-issue.md +++ b/.github/ISSUE_TEMPLATE/rfc-tracking-issue.md @@ -2,7 +2,7 @@ name: RFC Tracking Issue about: Track the development of a RFC title: 'Track RFC #: ' -labels: type:rfc +labels: stat:awaiting-triage, stat:reply-needed assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/support.md b/.github/ISSUE_TEMPLATE/support.md index 0033a651de..65cdca0654 100644 --- a/.github/ISSUE_TEMPLATE/support.md +++ b/.github/ISSUE_TEMPLATE/support.md @@ -2,7 +2,7 @@ name: Support about: Have a question or need help with anything? title: '' -labels: stat:awaiting triage, type:support +labels: stat:awaiting-triage, stat:reply-needed, type:support assignees: '' --- From daed8398ab54b3994a3649a9d019133aab9117a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Wed, 19 Mar 2025 13:18:04 +0100 Subject: [PATCH 02/23] docs: [NGOv1.X] Update of API Reference link (#3354) This PR builds on https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/2579 and updates link for API Reference in **Documentation~** folder so it's up to date --- com.unity.netcode.gameobjects/Documentation~/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Documentation~/index.md b/com.unity.netcode.gameobjects/Documentation~/index.md index bd5e331a18..8344b9e7db 100644 --- a/com.unity.netcode.gameobjects/Documentation~/index.md +++ b/com.unity.netcode.gameobjects/Documentation~/index.md @@ -9,7 +9,7 @@ See guides below to install Unity Netcode for GameObjects, set up your project, - [Documentation](https://docs-multiplayer.unity3d.com/netcode/current/about) - [Installation](https://docs-multiplayer.unity3d.com/netcode/current/installation) - [First Steps](https://docs-multiplayer.unity3d.com/netcode/current/tutorials/get-started-ngo) -- [API Reference](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@1.6/api/index.html) +- [API Reference](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@1.12/api/index.html) # Technical details From 12dd5bd90a02ed4d70b322d2609c62b27377c7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:23:33 +0100 Subject: [PATCH 03/23] ci: [NGOv1.X] Corrections of CI setup issues (#3326) This PR focuses on fixing CI issues raised in https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/3303 and before. Specifically: 1. 2023.3 editor was removed from supported list since based on official info it transitioned into 6000 editor and 2023 editor (by itself) is not supported. The associated ticket was (MTT-11355) 2. In case of ubuntu and 2021 editor (MTT-11354) correct version of libssl is being installed 3. UTR command was corrected to use preinstalled UTR on the image instead of downloading it 4. Removed upm-ci project pack definition and converted Code Coverage test to use upm-pvp pack job 5. Simplifies some unnecessary CI commands 6. Added detailed comments regarding CI setup and commands 7. Created CI_README file which describes overall configuration structure. 8. For macOS devices we now use M1 model (Apple Silicon) in contrast to default x64 Intel Mac which introduced a lot of bit-flipping errors --------- Co-authored-by: NoelStephensUnity --- .yamato/README.md | 80 +++++++++++++ .yamato/_run-all.yml | 39 +++--- .yamato/_triggers.yml | 42 ++++++- .yamato/code-coverage.yml | 44 +++++-- .yamato/console-standalone-test.yml | 84 +++++++------ .yamato/desktop-standalone-tests.yml | 107 ++++++----------- .yamato/mobile-standalone-test.yml | 111 +++++++++--------- .yamato/package-pack.yml | 53 ++++----- .yamato/package-tests.yml | 47 +++++--- .yamato/performance-tests.yml | 66 +++++------ .yamato/project-pack.yml | 30 ++++- .yamato/project-standards.yml | 49 ++++++-- .yamato/project-tests.yml | 38 ++++-- .yamato/project-updated-dependencies-test.yml | 35 ++++-- .yamato/project.metafile | 53 +++++++-- .yamato/webgl-build.yml | 68 +++++------ .../Tests/Editor/Timing/NetworkTimeTests.cs | 3 + .../Tests/Runtime/UniversalRpcTests.cs | 1 + pvpExceptions.json | 5 + 19 files changed, 605 insertions(+), 350 deletions(-) create mode 100644 .yamato/README.md diff --git a/.yamato/README.md b/.yamato/README.md new file mode 100644 index 0000000000..f5eafa856b --- /dev/null +++ b/.yamato/README.md @@ -0,0 +1,80 @@ +# Netcode for GameObjects CI Documentation + +## Overview +This document provides an overview of the Continuous Integration (CI) implementation for Netcode for GameObjects. +Specifics of each test are described within related files (for example .yamato/package-tests.yml) and this file present high level overview related to overall implementation. + +## Test Configurations +CI related files are present inside .yamato/ folder and we can distinguish specific tests + +### Helper jobs +- `.yamato/package-pack.yml` responsible for generating package artifacts (.tgz) required for testing and publishing. +- `.yamato/project-pack.yml` responsible for generating package artifacts (.tgz) required for testing and publishing. This packs all packages of a given project. +- `.yamato/_run-all.yml` responsible for grouping tests into groups for easier management (for example "all console tests"). +- `.yamato/_triggers.yml` responsible for defining triggers (PR, nightly, weekly etc.) and defining which tests to run. +- `disable-burst-if-requested.py` responsible for helping to disable burst if needed. +- `.yamato/project.metafile` being the central configuration file defining test environments, platforms, projects, editors and other parameters used. + +### In-Editor Tests +- `.yamato/package-tests.yml` responsible for running package tests. +- `.yamato/project-tests.yml` responsible for running project tests. +- `.yamato/project-updated-dependencies-test.yml` responsible for running tests after updating dependencies to latest ones. +- `.yamato/project-standards.yml` responsible for running standards check on a package. +- `.yamato/code-coverage.yml` responsible for running code coverage analysis. +- `.yamato/performance-tests.yml` responsible for running performance tests. +- `.yamato/webgl-build.yml` responsible for making a build for webgl platform. + +### Standalone Tests +- `.yamato/desktop-standalone-tests.yml` responsible for running tests on standalone desktops. +- `.yamato/console-standalone-test.yml` responsible for running tests on standalone consoles. +- `.yamato/mobile-standalone-test.yml` responsible for running tests on standalone mobiles. + +### Wrench jobs +This file is auto generated by wrench and used for automating release process. +Those tests can also be used by our CI as dependencies. +- `.yamato/wrench/api-validation-jobs.yml` responsible for validating api for a given package version (for example if there are no breaking changes when updating patch version) +- `.yamato/wrench/package-pack-jobs.yml` responsible for generating package artifacts (.tgz) required for testing and publishing. +- `.yamato/wrench/preview-a-p-v.yml` responsible for validating PVP (Package Verification Profiles) standards for the package. +- `.yamato/wrench/promotion-jobs.yml` responsible for publishing. +- `.yamato/wrench/publish-trigger.yml` responsible for defining jobs that need to pass in order to publish. +- `.yamato/wrench/recipe-regeneration.yml` responsible for verifying regeneration of wrench recipes (no manual changes). +- `.yamato/wrench/validation-jobs.yml` responsible for running package tests. +- `.yamato/wrench/wrench_config.json` this is the configuration file for wrench. +- `.yamato/generated-scripts/` is a collection of infrastructure instability detection tools. + +## Jobs Configuration Structure +This section explains some configuration details that may be confusing while looking at .yml files. + +### Job Generation +Our configuration uses a dynamic job generation approach based on the `.yamato/project.metafile` configuration. While it may appear that only one job is defined per file, the system (Yamato) actually generates multiple jobs through nested loops. +Usually only 1 job is defined and then generated with multiple configurations/parameters but in case of standalone tests 2 jobs are defined which are responsible for building and then testing. + +### Job Naming Convention +Because the jobs are being generated their names will be filled by given parameters from project.metfaile. For example jobs from .yamato/console-standalone-test may have names like: +- Display Name (in Yamato): `Build testproject - [win, 6000.0, il2cpp]` +- Internal Job Name (used when adding dependency for example): `console_standalone_build_testproject_win_6000.0` + +## Platform Support +Currently, the CI implementation supports the following platforms: +1. Console Platforms: + - Switch + - PS4 + - PS5 + - Xbox360 + - XboxOne +2. Mobile Platforms: + - Android + - iOS +3. Desktop Platforms: + - Windows + - Ubuntu + - macOS +4. Unity Editor Versions + - Supports NGOv1.X (2021.3+ editors) +5. Architectures + - x64 + - ARM64 (This is present for consoles/mobiles but will be extended. More information is present in specific standalone test files) + +## Design Considerations +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. +The downside of our current approach is that it can sometimes impact readability due to the use of nested if and for statements. \ No newline at end of file diff --git a/.yamato/_run-all.yml b/.yamato/_run-all.yml index 011a93208d..372152bb19 100644 --- a/.yamato/_run-all.yml +++ b/.yamato/_run-all.yml @@ -1,6 +1,16 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- +# DESCRIPTION-------------------------------------------------------------------------- + # Those jobs group together related test as dependencies to allow to easily manage running a given set of tests. + # This enables efficient test execution for different validation scenarios + +# QUALITY CONSIDERATIONS--------------------------------------------------------------- + # 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. + +#----------------------------------------------------------------------------------- + + # Runs all package tests run_all_package_tests: name: Run All Package Tests @@ -130,13 +140,7 @@ run_all_project_tests_desktop_standalone: {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} {% for backend in scripting_backends -%} -# There is an error 'No usable version of libssl' when it comes to building with combination of ubuntu and 2021 editor. It's not really worth to address it since -# 1) The 2021 editor will soon be out of support -# 2) We still have the same coverage by using mac and ubuntu is used in a whole bunch of different tests, so I'm quite sure it won't lead to any bug leaks -# 3) The solution could be to manually install libss1.1 (since image has libssl3 and this causes conflicts on 2021 editor related to dotnet versions and support). There were several threads on this topic which can be looked on -{% if editor != "2021.3" or platform.name != "ubuntu" %} - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }} -{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} @@ -164,13 +168,7 @@ run_all_project_tests_desktop_standalone_2021: {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} {% for backend in scripting_backends -%} -# There is an error 'No usable version of libssl' when it comes to building with combination of ubuntu and 2021 editor. It's not really worth to address it since -# 1) The 2021 editor will soon be out of support -# 2) We still have the same coverage by using mac and ubuntu is used in a whole bunch of different tests, so I'm quite sure it won't lead to any bug leaks -# 3) The solution could be to manually install libss1.1 (since image has libssl3 and this causes conflicts on 2021 editor related to dotnet versions and support). There were several threads on this topic which can be looked on -{% if platform.name != "ubuntu" %} - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_2021.3 -{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} @@ -182,7 +180,7 @@ run_all_project_tests_mobile_standalone: {% for project in projects.default -%} {% for platform in test_platforms.mobile_test -%} {% for editor in validation_editors.all -%} - - .yamato/mobile-standalone-test.yml#run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }} + - .yamato/mobile-standalone-test.yml#mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }} {% endfor -%} {% endfor -%} {% endfor -%} @@ -195,7 +193,7 @@ run_all_project_tests_mobile_standalone_trunk: {% for project in projects.default -%} {% for platform in test_platforms.mobile_test -%} {% for editor in validation_editors.default -%} - - .yamato/mobile-standalone-test.yml#run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }} + - .yamato/mobile-standalone-test.yml#mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }} {% endfor -%} {% endfor -%} {% endfor -%} @@ -206,7 +204,7 @@ run_all_project_tests_mobile_standalone_2021: dependencies: {% for project in projects.default -%} {% for platform in test_platforms.mobile_test -%} - - .yamato/mobile-standalone-test.yml#run_{{ project.name }}_tests_{{ platform.name }}_2021.3 + - .yamato/mobile-standalone-test.yml#mobile_standalone_test_{{ project.name }}_{{ platform.name }}_2021.3 {% endfor -%} {% endfor -%} @@ -218,10 +216,7 @@ run_all_project_tests_console_standalone: {% for project in projects.default -%} {% for platform in test_platforms.console_test -%} {% for editor in validation_editors.all -%} -# When building consoles with 2023 editor there are errors related to SDK version or uninstalled components. I will disable those for now and will add to my investigation list -{% if editor != "2023.3" %} - - .yamato/console-standalone-test.yml#run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }} -{% endif -%} + - .yamato/console-standalone-test.yml#console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }} {% endfor -%} {% endfor -%} {% endfor -%} @@ -234,7 +229,7 @@ run_all_project_tests_console_standalone_trunk: {% for project in projects.default -%} {% for platform in test_platforms.console_test -%} {% for editor in validation_editors.default -%} - - .yamato/console-standalone-test.yml#run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }} + - .yamato/console-standalone-test.yml#console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }} {% endfor -%} {% endfor -%} {% endfor -%} @@ -245,6 +240,6 @@ run_all_project_tests_console_standalone_2021: dependencies: {% for project in projects.default -%} {% for platform in test_platforms.console_test -%} - - .yamato/console-standalone-test.yml#run_{{ project.name }}_tests_{{ platform.name }}_2021.3 + - .yamato/console-standalone-test.yml#console_standalone_test_{{ project.name }}_{{ platform.name }}_2021.3 {% endfor -%} {% endfor -%} diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index e8e7a330ce..e3e42504f4 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -1,6 +1,43 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- +# DESCRIPTION-------------------------------------------------------------------------- + # This configuration defines three main CI trigger patterns: + # 1. Pull Request Validation: Validation performed on PR basis + # 2. Nightly Development: Test set run nightly (validates most important test cases) + # 3. Weekly Full Validation: Test set run weekly (validates all test cases to prevent any surprises) + # Each pattern represents different balance between validation depth, execution time and CI resource usage + +# TRIGGER PATTERNS------------------------------------------------------------------- + # Pull Request: + # This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered + # Triggers on PRs to develop, develop, and release branches + # Focuses on critical validation paths that we should validate before merging PRs + # Cancels previous runs on new commits + # Excludes draft PRs + + # Nightly: + # This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds + # Runs daily on develop (local configuration) + # Includes all test types but only on trunk. + # Adds platform-specific and APV validation + + # Weekly: + # 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 + # Runs across all supported editor versions + # Includes code coverage analysis + # Validates all projects and standards + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs configurations are generated by ensuring that all dependencies are successful. + # The dependencies are taken from _run-all.yml file where we can gather multiple tests into proper sets + +# QUALITY CONSIDERATIONS--------------------------------------------------------------- + # 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. + + +#----------------------------------------------------------------------------------- + # Run all relevant tasks when a pull request targeting the develop or release branch is created or updated. pull_request_trigger: name: Pull Request Trigger (develop, develop-2.0.0, & release branches) @@ -66,6 +103,9 @@ develop_nightly: # Build player for webgl platform on trunk and 2021 editors - .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_ubuntu_trunk - .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_win_2021.3 + # Clean import test + - .yamato/clean-import-job.yml#clean_import_testproject_trunk + - .yamato/clean-import-job.yml#clean_import_testproject_2021.3 # Run all tests on weekly bases diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index c0aa7e59fd..fcc64a4ccf 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -1,10 +1,30 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Runs package tests in order to determine code coverage of the NGO package. -# In essence it's performing the same task as .yamato/package-test jobs with the overhead being the measured code coverage -# It's ok for code coverage to be performed only on one platform (default) since code coverage won't change much between those. -# Default platform was chosen (ubuntu) since it's the fastest and most resource friendly with default editor. +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for executing package tests with code coverage analysis enabled. + # Coverage analysis provides insights into: + # Test coverage metrics for NGO assemblies + # Line and branch coverage statistics + # Generated HTML reports for coverage visualization + # Additional metrics for coverage analysis + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs are generated using nested loops through: + # 1. For default platform only (Ubuntu) since coverage would not vary between platforms (no need for checks on more platforms) + # 2. For default editor version (trunk) since coverage would not vary between editors (no need for checks on more editors) + +#TECHNICAL CONSIDERATIONS--------------------------------------------------------------- + # 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 + # Requires Unity Editor installation + # Burst compilation is disabled to ensure accurate coverage measurement + # 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 + +# QUALITY CONSIDERATIONS-------------------------------------------------------------------- + # TODO: somewhere in 2025 we will be able to upload resuls to CodeCov from public repos + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + + {% for platform in test_platforms.default -%} {% for editor in validation_editors.default -%} code_coverage_{{ platform.name }}_{{ editor }}: @@ -13,16 +33,18 @@ code_coverage_{{ platform.name }}_{{ editor }}: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) +{% endif %} commands: - - npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - - unity-downloader-cli -u {{ editor }} -c Editor --fast --wait - - DISPLAY=:0 upm-ci package test -u {{ editor }} --package-path com.unity.netcode.gameobjects --enable-code-coverage --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models + - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --unity .Editor + - 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 artifacts: logs: paths: - - "upm-ci~/test-results/**/*" - - "upm-ci~/test-results/CoverageResults/**/*" + - "test-results/**/*" dependencies: - - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }}_upmCI + - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }} {% endfor -%} {% endfor -%} \ No newline at end of file diff --git a/.yamato/console-standalone-test.yml b/.yamato/console-standalone-test.yml index 09723ab7fb..0bbd9f9a00 100644 --- a/.yamato/console-standalone-test.yml +++ b/.yamato/console-standalone-test.yml @@ -1,37 +1,57 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Builds a player on console standalone platform and executes RuntimeTests (equivalent to PlayMode tests) of the NGO package in the Standalone build. -# Default project (testptoject) in this case is used as a context. -# Builds/Tests are made on each console platform (PS4, PS5, Switch, XboxOne, XboxSeriesX) as in project.metafile declaration -# Builds/Tests are made on each supported editor as in project.metafile declaration +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for Console platform test validation. + # Those tests cover both PlayMode and EditMode tests from package test assemblies. -# For SOME of the console devices it's necessary to split build and run phases so it was split for all -# For all consoles we need to use il2cpp scripting backend (so no testing with mono) -# Switch works only with ARM64 and the rest with x64 architectures -# For now all platforms used for building are windows based +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency: + # 1. For all console platform (Switch, ps4, ps5, xbox360, xboxOne) + # 2. For all supported Unity Editor versions (for NGOv1.X this means 2021.3+ editors) + # 3. For the default project. -# Builds are made with x64 architecture machines since those are compatible to run on ARM64 devices +# TECHNICAL CONSIDERATIONS--------------------------------------------------------------- + # For console devices a split is required into two phases: + # 1. Build Phase: Creates standalone players for console platforms + # 2. Run Phase: Executes runtime tests on actual console devices + # The Run phase uses build job as dependency + + # Note: More of a Unity specific but test assemblies need to be included in the build phase command + # Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices + +# PLATFORM SPECIFICS----------------------------------------------------------------- + # Common Requirements: + # All consoles require IL2CPP scripting backend + # Platform-specific SDK environment variables + + # Platform-Specific: + # Switch: ARM64 architecture only + # Other Consoles: x64 architecture + # Each console requires specific SDK paths and tools + +# QUALITY THOUGHTS-------------------------------------------------------------------- + # TODO: consider adding all projects that have tests + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + + + +# BUILD PHASE CONFIGURATION------------------------------------------------------------------------------------ {% for project in projects.default -%} {% for platform in test_platforms.console_build -%} {% for editor in validation_editors.all -%} -# When building consoles with 2023 editor there are errors related to SDK version or uninstalled components. I will disable those for now and will add to my investigation list -{% if editor != "2023.3" %} -build_{{ project.name }}_{{ platform.name }}_{{ editor }}: +console_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}: name: Build {{ project.name }} - [{{ platform.name }}, {{ editor }}, il2cpp{% if platform.name == "switch" %}, arm64{% endif %}] agent: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) +{% endif %} commands: - # Installing tools. unity-downloader-cli and utr should be already preinstalled on the image - - sudo pip install unity-downloader-cli - - unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp -c {{ platform.name }} --fast --wait - - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat - - # Platform specific Build - - utr --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 - + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor -c il2cpp -c {{ platform.name }} + - 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 variables: # PS4 related SCE_ORBIS_SDK_DIR: 'C:\Users\bokken\SCE\ps4_sdk_12_00' @@ -49,37 +69,28 @@ build_{{ project.name }}_{{ platform.name }}_{{ editor }}: logs: paths: - "artifacts/**/*" -{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} -# Executes RuntimeTests of the NGO package in the Standalone build for consoles +# RUN PHASE CONFIGURATION------------------------------------------------------------------------------------ {% for project in projects.default -%} {% for platform in test_platforms.console_test -%} {% for editor in validation_editors.all -%} -# When building consoles with 2023 editor there are errors related to SDK version or uninstalled components. I will disable those for now and will add to my investigation list -{% if editor != "2023.3" %} -run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }}: +console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }}: name: Run {{ project.name }} Tests - [{{ platform.name }}, {{ editor }}, il2cpp] agent: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} {% if platform.model %} - model: {{ platform.model }} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} commands: - # Installing tools. - - sudo pip install unity-downloader-cli - - unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp -c {{ platform.name }} --fast --wait - - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat - - # Platform specific Execution - - utr --suite=playmode --testproject={{ project.path }} --editor-location=.Editor --artifacts-path=test-results --player-load-path=build/players --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=1800 - + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor -c il2cpp -c {{ platform.name }} + - UnifiedTestRunner --suite=playmode --testproject={{ project.path }} --editor-location=.Editor --artifacts-path=test-results --player-load-path=build/players --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=1800 variables: # PS4 related SCE_ORBIS_SDK_DIR: 'C:\Users\bokken\SCE\ps4_sdk_12_00' @@ -95,8 +106,7 @@ run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }}: paths: - "test-results/**/*" dependencies: - - .yamato/console-standalone-test.yml#build_{{ project.name }}_{{ platform.name }}_{{ editor }} -{% endif -%} + - .yamato/console-standalone-test.yml#console_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }} {% endfor -%} {% endfor -%} {% endfor -%} \ No newline at end of file diff --git a/.yamato/desktop-standalone-tests.yml b/.yamato/desktop-standalone-tests.yml index eceff41b3c..ec17d182fc 100644 --- a/.yamato/desktop-standalone-tests.yml +++ b/.yamato/desktop-standalone-tests.yml @@ -1,57 +1,50 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Builds a player on desktop standalone platform and executes RuntimeTests (equivalent to PlayMode tests) of the NGO package in the Standalone build. -# Default project (testptoject) in this case is used as a context. -# Builds are made on each desktop platform as in project.metafile declaration -# Builds are made on each supported editor as in project.metafile declaration -# Builds are made with different scripting backends as in project.metafile declaration -# ARM64 architectures are for now not considered since Windows_arm64 is recommended to use only after builds (would require separation here) and when it comes to macOS_arm64 there is problem with OpenCL not being available +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for Desktop platform test validation. + # Those tests cover both PlayMode and EditMode tests from package test assemblies. -# Build phase +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency: + # 1. For all desktop platform (Windows, macOS, Ubuntu) + # 2. For all supported Unity Editor versions (for NGOv1.X this means 2021.3+ editors) + # 3. For the default project. + # 4. For all scripting backends (mono, il2cpp) + +# TECHNICAL CONSIDERATIONS--------------------------------------------------------------- + # For desktop devices a split is into two phases is not required but we use it for consistency with setup of others standalone platforms: + # 1. Build Phase: Creates standalone players for desktop platforms + # 2. Run Phase: Executes runtime tests on actual desktop devices + # The Run phase uses build job as dependency + + # Note: More of a Unity specific but test assemblies need to be included in the build phase command + # Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices + +# QUALITY THOUGHTS-------------------------------------------------------------------- + # TODO: consider adding all projects that have tests + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + +#----------------------------------------------------------------------------------- + + +# BUILD PHASE CONFIGURATION------------------------------------------------------------------------------------ {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} {% for backend in scripting_backends -%} -# There is an error 'No usable version of libssl' when it comes to building with combination of ubuntu and 2021 editor. It's not really worth to address it since -# 1) The 2021 editor will soon be out of support -# 2) We still have the same coverage by using mac and ubuntu is used in a whole bunch of different tests, so I'm quite sure it won't lead to any bug leaks -# 3) The solution could be to manually install libss1.1 (since image has libssl3 and this causes conflicts on 2021 editor related to dotnet versions and support). There were several threads on this topic which can be looked on -{% if editor != "2021.3" or platform.name != "ubuntu" %} desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}: name : Standalone Build - NGO {{ project.name }} - [{{ platform.name }}, {{ editor }}, {{ backend }}] agent: type: {% if platform.name == "mac" %} {{ platform.type }} {% else %} {{ platform.type }}::GPU {% endif %} image: {{ platform.image }} flavor: {{ platform.flavor }} - commands: -# Installing tools -{% if platform.name == "ubuntu" %} - - sudo apt-get update -q - - sudo apt install -qy imagemagick -{% endif %} - - - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple - -# Platform specific UTR setup - - | -{% if platform.name == "win" %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat -{% else %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} - -# Installing editor - - unity-downloader-cli -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} --fast --wait - -# Build Player - - | -{% if platform.name == "win" %} - utr.bat --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --testproject={{ project.path }} --scripting-backend={{ backend }} --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --artifacts-path=artifacts --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 -{% else %} - ./utr --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --testproject={{ project.path }} --scripting-backend={{ backend }} --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --artifacts-path=artifacts --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 -{% endif %} - + commands: + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} + - UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --testproject={{ project.path }} --scripting-backend={{ backend }} --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --artifacts-path=artifacts --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 artifacts: players: paths: @@ -59,10 +52,8 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ logs: paths: - "artifacts/**/*" - dependencies: - .yamato/project-pack.yml#project_pack_-_{{ project.name }}_{{ platform.name }} -{% endif %} {% endfor -%} {% endfor -%} {% endfor -%} @@ -71,49 +62,29 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ -# Run phase +# RUN PHASE CONFIGURATION------------------------------------------------------------------------------------ {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} {% for backend in scripting_backends -%} -# There is an error 'No usable version of libssl' when it comes to building with combination of ubuntu and 2021 editor. It's not really worth to address it since -# 1) The 2021 editor will soon be out of support -# 2) We still have the same coverage by using mac and ubuntu is used in a whole bunch of different tests, so I'm quite sure it won't lead to any bug leaks -# 3) The solution could be to manually install libss1.1 (since image has libssl3 and this causes conflicts on 2021 editor related to dotnet versions and support). There were several threads on this topic which can be looked on -{% if editor != "2021.3" or platform.name != "ubuntu" %} desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}: name : Standalone Test - NGO {{ project.name }} - [{{ platform.name }}, {{ editor }}, {{ backend }}] agent: type: {% if platform.name == "mac" %} {{ platform.type }} {% else %} {{ platform.type }}::GPU {% endif %} image: {{ platform.image }} flavor: {{ platform.flavor }} - commands: -# Platform specific UTR setup - - | -{% if platform.name == "win" %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat -{% else %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} - - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple - - - unity-downloader-cli -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} --fast --wait - -# Run Standalone tests - - | -{% if platform.name == "win" %} - utr.bat --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 -{% else %} - ./utr --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 -{% endif %} - + commands: + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} + - 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 artifacts: logs: paths: - "test-results/**/*" dependencies: - .yamato/desktop-standalone-tests.yml#desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }} -{% endif %} {% endfor -%} {% endfor -%} {% endfor -%} diff --git a/.yamato/mobile-standalone-test.yml b/.yamato/mobile-standalone-test.yml index 2ca2444b86..8a1ca65b4d 100644 --- a/.yamato/mobile-standalone-test.yml +++ b/.yamato/mobile-standalone-test.yml @@ -1,41 +1,56 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- - -# Builds a player on mobile standalone platform and executes RuntimeTests (equivalent to PlayMode tests) of the NGO package in the Standalone build. -# Default project (testptoject) in this case is used as a context. -# Builds/Tests are made on each mobile platform (Android and iOS) as in project.metafile declaration -# Builds/Tests are made on each supported editor as in project.metafile declaration - -# For mobile devices it's necessary to split build and run phases -# For iOS we need to use il2cpp. For android we could use both but il2cpp is recommended so for now we will only use il2cpp as scripting backend -# iOS works only with ARM64 and Android is tested with both ARM64 and ARMv7 -# Builds are made with x64 architecture machines since those are compatible to run on ARM64 devices +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for Mobile platform test validation. + # Those tests cover both PlayMode and EditMode tests from package test assemblies. + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs are generated using nested loops through: + # 1. For all mobile platform (Android, iOS) + # 2. For all supported Unity Editor versions (for NGOv1.X this means 2021.3+ editors) + # 3. For the default project. + +# TECHNICAL CONSIDERATIONS--------------------------------------------------------------- + # For mobile devices a split is required into two phases: + # 1. Build Phase: Creates standalone players for mobile platforms + # 2. Run Phase: Executes runtime tests on actual mobile devices + # The Run phase uses build job as dependency + # Note: More of a Unity specific but test assemblies need to be included in the build phase command + # Note: All builds can be made on x64 machines since those are compatible with ARM64 target devices + +# PLATFORM SPECIFICS-------------------------------------------------------------------- + # iOS Requirements: + # Must use IL2CPP scripting backend + # Only supports ARM64 architecture + # Builds on macOS agents only + + # Android Requirements: + # Uses IL2CPP scripting backend (recommended over Mono) + # Supports both ARM64 and ARMv7 architectures + # Can be built on any desktop platform + +# QUALITY CONSIDERATIONS-------------------------------------------------------------------- + # TODO: consider adding all projects that have tests + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + + +# BUILD PHASE CONFIGURATION------------------------------------------------------------------------------------ {% for project in projects.default -%} {% for platform in test_platforms.mobile_build -%} {% for editor in validation_editors.all -%} -build_{{ project.name }}_{{ platform.name }}_{{ editor }}: - name: Build {{ project.name }} - [{{ platform.name }}, {{ editor }}, il2cpp] +mobile_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}: + name: Build {{ project.name }} - [{{ platform.name }}, {{ editor }}, il2cpp] agent: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} - commands: - # Installing tools - - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple - - # Installing editor - - unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %} --fast --wait - - # Platform specific Build -{% if platform.base == "win" %} - - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat - - utr.bat --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 -{% else %} - - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr - - chmod +x ./utr - - ./utr --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 +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} + commands: + - unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %} --wait + - 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 artifacts: players: paths: @@ -43,64 +58,52 @@ build_{{ project.name }}_{{ platform.name }}_{{ editor }}: logs: paths: - "artifacts/**/*" - - variables: - CI: true - ENABLE_BURST_COMPILATION: False {% endfor -%} {% endfor -%} {% endfor -%} -# Executes RuntimeTests of the NGO package in the Standalone build for mobiles +# RUN PHASE CONFIGURATION------------------------------------------------------------------------------------ {% for project in projects.default -%} {% for platform in test_platforms.mobile_test -%} {% for editor in validation_editors.all -%} -run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }}: +mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }}: name: Run {{ project.name }} Tests - [{{ platform.name }}, {{ editor }}, il2cpp] agent: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} {% if platform.model %} - model: {{ platform.model }} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} - # Skip repository cloning - skip_checkout: true commands: - # Installing tools - - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple - - # Installing editor. We still need the editor to run tests on standalone build - - unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %} --fast --wait - + # Installing editor. We still need the editor to run tests on standalone build and for that the Editor is required + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %} + {% if platform.standalone == "Android" %} # Download standalone UnityTestRunner and ADB setup - - command: curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat - command: wget http://artifactory-slo.bf.unity3d.com/artifactory/mobile-generic/android/ADBKeys.zip!/adbkey.pub -O %USERPROFILE%/.android/adbkey.pub - command: wget http://artifactory-slo.bf.unity3d.com/artifactory/mobile-generic/android/ADBKeys.zip!/adbkey -O %USERPROFILE%/.android/adbkey - command: gsudo NetSh Advfirewall set allprofiles state off - + # Connect to Android device - command: '"%ANDROID_SDK_ROOT%\platform-tools\adb.exe" connect %BOKKEN_DEVICE_IP%' - - # Run tests + + # Run tests for Android devices - | set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP% - utr --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --editor-location=.Editor --player-connection-ip=%BOKKEN_HOST_IP% --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=3600 + UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --editor-location=.Editor --player-connection-ip=%BOKKEN_HOST_IP% --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=3600 {% else %} - # Download standalone UnityTestRunner - - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr - - # Run tests - - ./utr --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --editor-location=.Editor --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=3600 + + # Run tests for non-Android devices + - UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --editor-location=.Editor --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=3600 {% endif %} artifacts: logs: paths: - "test-results/**/*" dependencies: - - .yamato/mobile-standalone-test.yml#build_{{ project.name }}_{{ platform.name }}_{{ editor }} + - .yamato/mobile-standalone-test.yml#mobile_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }} {% endfor -%} {% endfor -%} {% endfor -%} diff --git a/.yamato/package-pack.yml b/.yamato/package-pack.yml index 1d54e47212..61e794f110 100644 --- a/.yamato/package-pack.yml +++ b/.yamato/package-pack.yml @@ -1,9 +1,28 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Packs Netcode for GameObjects together with performing initial checks. -# For this job no specific platform support and no running Unity instance is required so small agent (as per project.metafile definition) could be used to save resources and speed up the process. -# If everyone adheres to this rule it can create bottlenecks (since everyone would use this machine) so we decided to pack with the same platform as the given job runs on +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for packing a specific package. It generates package artifacts (.tgz) required for testing and publishing, ensuring all dependencies are properly bundled and validated before any test execution. + # The job itself doesn't test anything specific but rather it prepares project packages that will be consumed by other pipeline jobs. + # The job performs additional validation by using Package Verification Pipeline (PVP). It includes x-ray validation for quick package structure verification + # Because of that validation we can detect errors at the early stage of testing so not to waste CI resources + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs are generated using nested loops through: + # 1. For all desktop platforms (Windows, Ubuntu, macOS) + +# TECHNICAL CONSIDERATIONS--------------------------------------------------------------- + # Job does not require Unity Editor in order to perform packing. + # Job uses PVP x-ray for lightweight validation + # Job generates both packages artifacts and pvp-results file. + # In theory, we could just use one platform for packing projects (for example ubuntu) but in order to reduce confusion we are using same platform as the job utilizing project pack as dependency. + +# QUALITY CONSIDERATIONS-------------------------------------------------------------------- + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + # TODO: we should aim to replace target PVP profile from supported to gold + +#------------------------------------------------------------------------------------ + {% for platform in test_platforms.desktop -%} package_pack_-_ngo_{{ platform.name }}: name: Package Pack (and x-ray) - NGO [{{ platform.name }}] @@ -11,6 +30,9 @@ package_pack_-_ngo_{{ platform.name }}: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) +{% endif %} timeout: 0.25 variables: XRAY_PROFILE: "supported ./pvpExceptions.json" @@ -25,27 +47,4 @@ package_pack_-_ngo_{{ platform.name }}: packages: paths: - "upm-ci~/**" -{% endfor -%} - -# This is in essence the same job as the one above with the difference that upm-ci is used instead of upm-pvp -# The reason for using it is that I had some problems with Code Coverage which in its current form uses upm-ci but if we would use the other pack job (the one above) we would need to use upm-pvp -# I had some problems with getting it to work so as temporary solution I created this pack job which is used ONLY as a dependency of Code Coverage job (other jobs use the above definition of pack job) -# TODO: remove this job and utilize the above one for Code Coverage job. This is tracked in MTT-11383 -{% for platform in test_platforms.default -%} -{% for project in projects.default -%} -package_pack_-_ngo_{{ platform.name }}_upmCI: - name: Package Pack (legacy upm-ci) - NGO [{{ platform.name }}] - agent: - type: {{ platform.type }} - image: {{ platform.image }} - flavor: {{ platform.flavor }} - timeout: 0.25 - commands: - - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - - upm-ci project pack --project-path {{ project.path }} - artifacts: - packages: - paths: - - "upm-ci~/packages/**/*" -{% endfor -%} {% endfor -%} \ No newline at end of file diff --git a/.yamato/package-tests.yml b/.yamato/package-tests.yml index 5373551ca2..0d354967ae 100644 --- a/.yamato/package-tests.yml +++ b/.yamato/package-tests.yml @@ -1,9 +1,29 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Executes PlayMode and EditMode tests of the NGO package in the Editor context -# Those tests run in the editor so we don't need to consider different scripting backends or architectures -# Tests are executed for all supported editors on each desktop platform as in project.metafile declaration +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for execution of package-specific tests in Unity Editor context + # Those tests cover both PlayMode and EditMode tests from package test assemblies + # Additionally it combines Package Verification Pipeline (PVP) validation. This ensures that package is compatible with Unity standards + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs are generated using nested loops through: + # 1. For all desktop platforms (Windows, Ubuntu, macOS) + # 2. For all supported Unity Editor versions (for NGOv1.X this means 2021.3+ editors) + +# TECHNICAL CONSIDERATIONS--------------------------------------------------------------- + # This job runs in Editor context only (no player builds required) + # No scripting backend variations needed (Editor context) + # Architecture variations not applicable (Editor context) + # Requires project packaging as prerequisite (dependency job) + # Uses PVP for package validation. Specifically it looks for supported profiles which we should conform to but takes ./pvpExceptions.json file into consideration where we note our known issues related to PVP checks + +# QUALITY CONSIDERATIONS-------------------------------------------------------------------- + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + # TODO: we should aim to replace target PVP profile from supported to gold + +#------------------------------------------------------------------------------------ + {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} package_test_-_ngo_{{ editor }}_{{ platform.name }}: @@ -12,25 +32,22 @@ package_test_-_ngo_{{ editor }}_{{ platform.name }}: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) +{% endif %} variables: XRAY_PROFILE: "supported ./pvpExceptions.json" UNITY_EXT_LOGGING: 1 commands: - - unity-downloader-cli -u {{ editor }} -c Editor --fast --wait - # Platform specific UTR setup - - | -{% if platform.name == "win" %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat -{% else %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr -{% endif %} - - # Validate packages. + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. + + # Validate PVP checks for package. - upm-pvp test --unity .Editor --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --results pvp-results - upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results + # Run UTR to test packages. - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor - - {% if platform.name == "ubuntu" %}DISPLAY=:0 {% endif %} {% if platform.name == "win" %} utr.bat {% else %} ./utr {% endif %} --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --artifacts-path=test-results "--ff={ops.upmpvpevidence.enable=true}" --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun + - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --artifacts-path=test-results "--ff={ops.upmpvpevidence.enable=true}" --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun artifacts: logs: paths: diff --git a/.yamato/performance-tests.yml b/.yamato/performance-tests.yml index abdbef444e..e18b2ff19d 100644 --- a/.yamato/performance-tests.yml +++ b/.yamato/performance-tests.yml @@ -1,8 +1,27 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Performance tests for the `com.unity.netcode.gameobjects` package. No performance data will be reported. -# Performance tests are executed within editor on desktop platforms in context of default project (testproject) +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for executing performance tests for NGO package. + # Its configuration is set to not report any data but just to give results (at least in current state since we don't have any tests to run). + # Currently, because of lack of performance tests this job will always return "no tests have been selected" and because oif that it's not included in any trigger jobs. + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs configurations are generated using nested loops through: + # 1. For all desktop platforms (Windows, Ubuntu, macOS) + # 2. For all supported Unity Editor versions (For NGOv1.X it means 2021.3+) + # 3. For the default project (project is used only as a context for the build). TODO-comment: if performance tests would be included in projects then we should make an appropriate split. + +# TECHNICAL CONSIDERATIONS--------------------------------------------------------------- + # Tests are run in Editor context only + # No performance metrics are reported to monitoring systems + +# QUALITY CONSIDERATIONS-------------------------------------------------------------------- + # TODO: Currently NGO don't have any performance tests so this job is a placeholder for the future. We should discuss how to approach the topic of performance testing + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + +#------------------------------------------------------------------------------------ + {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} {% for project in projects.default -%} @@ -12,44 +31,17 @@ performance_editor_tests_-_NGO_{{ platform.name }}_{{ editor }}_no_data_reportin type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} - commands: - # Installing tools -{% if platform.name == "ubuntu" %} - - sudo apt-get update -q - - sudo apt install -qy imagemagick -{% endif %} - - npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple - - # Platform specific UTR setup -{% if platform.name == "win" %} - - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat -{% else %} - - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} - - # Installing editor - - unity-downloader-cli -u {{ editor }} -c Editor --fast --wait - - # Build Player - - | -{% if platform.name == "win" %} - utr.bat --suite=editor --suite=playmode --testproject={{ project.path }} --editor-location=.Editor --timeout=3600 --artifacts-path=artifacts --extra-editor-arg=-assemblyNames --extra-editor-arg=Unity.NetCode.* --extra-editor-arg=-testCategory --extra-editor-arg=Performance --extra-editor-arg=-enablePackageManagerTraces --reruncount=1 --clean-library-on-rerun --dontreportperformancedata -{% else %} - ./utr --suite=editor --suite=playmode --testproject={{ project.path }} --editor-location=.Editor --timeout=3600 --artifacts-path=artifacts --extra-editor-arg=-assemblyNames --extra-editor-arg=Unity.NetCode.* --extra-editor-arg=-testCategory --extra-editor-arg=Performance --extra-editor-arg=-enablePackageManagerTraces --reruncount=1 --clean-library-on-rerun --dontreportperformancedata -{% endif %} - + commands: + - unity-downloader-cli -u {{ editor }} -c Editor --wait {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Installing basic editor + - UnifiedTestRunner --suite=editor --suite=playmode --testproject={{ project.path }} --editor-location=.Editor --timeout=3600 --artifacts-path=artifacts --extra-editor-arg=-assemblyNames --extra-editor-arg=Unity.NetCode.* --extra-editor-arg=-testCategory --extra-editor-arg=Performance --extra-editor-arg=-enablePackageManagerTraces --reruncount=1 --clean-library-on-rerun --dontreportperformancedata + # TODO: when performance tests will be present we need to add actuall execution of this test artifacts: logs: paths: - - '*.log' - - '*.xml' - - artifacts/**/* - - {{ project.name }}/Logs/** - - {{ project.name }}/Library/*.log - - {{ project.name }}/*.log - - {{ project.name }}/Builds/*.log - - build/test-results/** + - "artifacts/**/*" {% endfor -%} {% endfor -%} {% endfor -%} \ No newline at end of file diff --git a/.yamato/project-pack.yml b/.yamato/project-pack.yml index 0963d99271..d9dd6143d5 100644 --- a/.yamato/project-pack.yml +++ b/.yamato/project-pack.yml @@ -1,9 +1,26 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Jobs that iterate through and packs all NGO projects listed (to use in different jobs) -# For this job no specific platform support and no running Unity instance is required so small agent (as per project.metafile definition) coul be used to save resources and speed up the process -# If everyone adheres to this rule it can create bottlenecks (since everyone would use this machine) so we decided to pack project with the same platform as the given job runs on +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for packing a specific project. It generates package artifacts (.tgz) required for testing and publishing, ensuring all dependencies are properly bundled and validated before any test execution. + # The job itself doesn't test anything specific but rather it prepares project packages that will be consumed by other pipeline jobs. + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs configurations are generated using nested loops through: + # 1. For all projects (testproject, minimalproject, testproject-tools-integration). + # 2. For all desktop platforms (Win, Ubuntu, Mac) + +# TECHNICAL CONSIDERATIONS-------------------------------------------------------------------- + # Job does not require Unity Editor in order to perform packing. + # In theory, we could just use one platform for packing projects (for example ubuntu) but in order to reduce confusion we are using same platform as the job utilizing project pack as dependency. + +# QUALITY CONSIDERATIONS-------------------------------------------------------------------- + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + # TODO: Currently upm-ci is being used but in the future it will be replaced by upm-pvp. Additionally this would allow us to run PVP checks on projects + + +#-------------------------------------------------------------------------------------- + {% for project in projects.all -%} {% for platform in test_platforms.desktop -%} project_pack_-_{{ project.name }}_{{ platform.name }}: @@ -12,8 +29,11 @@ project_pack_-_{{ project.name }}_{{ platform.name }}: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) +{% endif %} commands: - - npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm + - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm # upm-ci is not preinstalled on the image so we need to download it - upm-ci project pack --project-path {{ project.path }} artifacts: packages: diff --git a/.yamato/project-standards.yml b/.yamato/project-standards.yml index 0bb442971e..dd88c60e68 100644 --- a/.yamato/project-standards.yml +++ b/.yamato/project-standards.yml @@ -1,9 +1,32 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Project standards are being checked for package (in project context). -# It should be enough to perform the test on default project (testproject) but to make sure that all projects conform to our standards job for each of them will be available. -# Tests are executed for default editor (trunk) on default platform (ubuntu) as in project.metafile declaration since results would be the same across editors and platforms. +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for validating project compliance with NGO coding standards and conventions + # Standards validation includes: + # Code formatting compliance + # Project structure validation + # Coding convention adherence + # Solution file synchronization + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs configurations are generated using nested loops through: + # 1. For all NGO projects (testproject, testproject-tools-interation, minimalproject) + # 2. For default platform only (Ubuntu) since standards would not vary between platforms (no need for checks on more platforms) + # 3. For default editor version (trunk) since standards would not vary between editors (no need for checks on more editors) + +# TECHNICAL CONSTRAINTS--------------------------------------------------------------- + # Requires .NET SDK installed (should be preinstalled on the image so we just check for version) + # Needs Unity Editor for solution synchronization + # Uses custom standards validation tool (netcode.standards) + # Generates no test artifacts (pass/fail only). Eventual failure will be visible in the logs + +# QUALITY THOUGHTS-------------------------------------------------------------------- + # While testproject validation would be sufficient, since it validates both project and package (where package is our main concern) jobs for all projects are being generated to ensure that we conform to quality standards in all projects. + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + +#------------------------------------------------------------------------------------ + {% for project in projects.all -%} {% for platform in test_platforms.default -%} {% for editor in validation_editors.all -%} @@ -13,18 +36,18 @@ standards_{{ platform.name }}_{{ project.name }}_{{ editor }}: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) +{% endif %} commands: - # .NET environment setup + # .NET environment setup. Ensures required .NET SDK and formatting tools are available - dotnet --version - dotnet format --version - - # Unity setup - - pip install unity-downloader-cli --upgrade --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple - - unity-downloader-cli -u {{ editor }} -c editor --wait --fast - - .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit - - # Standards check - - dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --check + + - unity-downloader-cli --fast --wait -u {{ editor }} -c editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloads basic editor + + - .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit # This command is used to invoke Unity in a "headless" mode. It's used to sync the project + - dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --check # Runs standards check {% endfor -%} {% endfor -%} {% endfor -%} \ No newline at end of file diff --git a/.yamato/project-tests.yml b/.yamato/project-tests.yml index ec91e04540..153f452170 100644 --- a/.yamato/project-tests.yml +++ b/.yamato/project-tests.yml @@ -1,10 +1,29 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Executes PlayMode and EditMode tests of the given project (ones that have tests) in the Editor context -# Those tests don't include NGO package tests since they are handled on their respective jobs. -# Those tests run in the editor so we don't need to consider different scripting backends or architectures -# Tests are executed for all supported editors on each desktop platform as in project.metafile declaration +# DESCRIPTION-------------------------------------------------------------------------- + # This job executes project-specific tests in Unity Editor context + # Those tests cover both PlayMode and EditMode tests from project test assemblies + # NGO package tests are NOT being executed within this job (those are handled in separate package test jobs) + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs configurations are generated using nested loops through: + # 1. For all projects WITH TESTS (filtered by has_tests flag) (testproject, testproject-tools-interation) [For more info look into project.metafile configuration] + # 2. For all desktop platforms (Windows, Ubuntu, macOS) + # 3. For all supported Unity Editor versions (for NGOv1.X this means 2021.3+ editors) + +# TECHNICAL CONSIDERATIONS--------------------------------------------------------------- + # This job runs in Editor context only (no player builds is required) + # No scripting backend variations needed (Editor context) + # Architecture variations not applicable (Editor context) + # Requires project packaging as prerequisite (dependency job) + +# QUALITY CONSIDERATIONS-------------------------------------------------------------------- + # TODO: Currently upm-ci is being used but in the future it will be replaced by upm-pvp + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + +#------------------------------------------------------------------------------------ + {% for project in projects.all -%} {% if project.has_tests == "true" -%} {% for platform in test_platforms.desktop -%} @@ -15,10 +34,13 @@ test_{{ project.name }}_{{ platform.name }}_{{ editor }}: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) +{% endif %} commands: - - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - - unity-downloader-cli -u {{ editor }} -c Editor --fast --wait - - {% if platform.name == "ubuntu" %}DISPLAY=:0 && {% endif %}upm-ci project test -u {{ editor }} --project-path {{ project.path }} --type project-tests --extra-utr-arg="--extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun" + - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm # upm-ci is not preinstalled on the image so we need to download it + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Installing basic editor for tests execution + - upm-ci project test -u {{ editor }} --project-path {{ project.path }} --type project-tests --extra-utr-arg="--reruncount=1 --clean-library-on-rerun" # project tests execution via upm-ci artifacts: logs: paths: diff --git a/.yamato/project-updated-dependencies-test.yml b/.yamato/project-updated-dependencies-test.yml index cdc44c9e8e..5b7530ac60 100644 --- a/.yamato/project-updated-dependencies-test.yml +++ b/.yamato/project-updated-dependencies-test.yml @@ -1,9 +1,28 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Executes package tests for each package referenced in the project using the newest compatible version of the package dependencies. -# This is just to ensure that no critical change is made. It will be run on a default editor and default platform (it can be discussed if we should run it per all editors and platforms) -{% for project in projects.default -%} +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible fo validating package compatibility with latest dependency versions. + # This helps detect potential breaking changes from dependency updates early + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs configurations are generated using nested loops through: + # 1. For all projects (testproject, minimalproject, testproject-tools-integration). + # 2. For all desktop platforms (Win, Ubuntu, Mac) + # 3. For all supported editors (For NGOv1.X it means 2021.3+) + +# TECHNICAL CONSIDERATIONS---------------------------------------------------------------- + # This job requires successful project packaging before execution (job dependency) + # This job tests only NGO package dependencies (com.unity.netcode.gameobjects) + # The results are being generated in upm-ci~/test-results directory (specific of upm-ci) + +# QUALITY CONSIDERATIONS--------------------------------------------------------------------- + # TODO: Currently upm-ci is being used but in the future it will be replaced by upm-pvp + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + +#-------------------------------------------------------------------------------------- + +{% for project in projects.all -%} {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} updated-dependencies_{{ project.name }}_NGO_{{ platform.name }}_{{ editor }}: @@ -12,16 +31,18 @@ updated-dependencies_{{ project.name }}_NGO_{{ platform.name }}_{{ editor }}: type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) +{% endif %} commands: - - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm + - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm # upm-ci is not preinstalled on the image so we need to download it - upm-ci project test -u {{ editor }} --project-path {{ project.path }} --type updated-dependencies-tests --package-filter com.unity.netcode.gameobjects artifacts: logs: paths: - "upm-ci~/test-results/**/*" dependencies: - - path: .yamato/project-pack.yml#project_pack_-_{{ project.name }}_{{ platform.name }} - rerun: always + - .yamato/project-pack.yml#project_pack_-_{{ project.name }}_{{ platform.name }} {% endfor -%} {% endfor -%} {% endfor -%} diff --git a/.yamato/project.metafile b/.yamato/project.metafile index e924f8426c..0c9c6ae1e1 100644 --- a/.yamato/project.metafile +++ b/.yamato/project.metafile @@ -1,4 +1,22 @@ -# The small agent was created to handle jobs that don't involve running Unity (for example pack job). +# DESCRIPTION----------------------------------------------------------------------------------------------------------------- + # This file is the central configuration file defining test environments, platforms, projects, editors and other parameters used. + # Data from this file is used to generate CI pipeline configurations through templating in other .yamato/ files. + # This provides consistent environment definitions across all CI jobs. It's easier to modify values in central place (for example image reference) than having to modify every job + +# VALUE MEANING---------------------------------------------------------------------------------------------------------------------------- + # Usual fields being defined are + # name --> Identifier used to distinguish different configurations in the CI pipeline + # type --> Specifies the Bokken agent type (e.g., Unity::VM, Unity::VM::osx, Unity::mobile::shield) + # image --> Defines the package-ci Bokken image to use for the environment (e.g., package-ci/ubuntu-22.04:v4). This is basically a device configuration + # flavor --> Determines the VM size/resources (e.g., b1.small, b1.large, m1.mac) + # standalone --> Specifies the build target platform (e.g., StandaloneLinux64, Android, IOS) + # model --> Defines specific hardware model requirements (e.g., rtx2080, SE for iPhone SE) + # base --> Indicates the base operating system for build operations (e.g., win, mac) + # architecture --> Specifies the target CPU architecture (e.g., armv7, arm64) + + +# SMALL AGENT CONFIGURATION--------------------------------------------------------------------------------------------------- +# The small agent was created to handle jobs that don't involve running Unity and are in general super light when it comes to resource usage (for example pack job). # It uses ubuntu since Linux VMs are faster and cheaper to provision than Mac or Windows Virtual Machines (VMs). # The b1.small flavour is nearly always sufficient for jobs that don’t involve running Unity Editor. small_agent_platform: @@ -7,7 +25,13 @@ small_agent_platform: image: package-ci/ubuntu-22.04:v4 flavor: b1.small -# Platforms that project will/can be tested on. + +# PLATFORM CONFIGURATIONS---------------------------------------------------------------------------------------------------------------- +# test_platforms specifies platforms that project will/can be tested on. +# For desktops we include Windows, Ubuntu and Mac, for mobiles we include Android and iOS, for consoles we include ps4, ps5, switch, xbox360 and xboxOne +# For mobile and console a split was required for build and test jobs and this is also applied for desktops for consistency (though for desktop this split is not required) + + test_platforms: # Default platform is used for all basic jobs. Ubuntu was chosen since it's fastest and most available default: @@ -31,10 +55,12 @@ test_platforms: model: rtx2080 - name: mac type: Unity::VM::osx - image: package-ci/macos-13:v4 + image: package-ci/macos-13-arm64:v4 # ARM64 to support M1 model (below) flavor: m1.mac standalone: StandaloneOSX + model: M1 # The default model (an x64 Intel Mac VM) quite often caused a known issue of doing all the bitflips in packages resulting in failures # For mobile devices there is a split between the build and run phase so there is a need of splitting specification for both + # TODO: For android we could consider adding ARM64 configuration mobile_build: - name: android type: Unity::VM @@ -43,7 +69,7 @@ test_platforms: standalone: Android base: win architecture: armv7 - # iOS modern builds are ARM64-only, thus no testing with armv7 (as in android case) + # iOS modern builds are ARM64-only, thus no testing with armv7 - name: ios-arm64 type: Unity::VM::osx image: package-ci/macos-13:v4 @@ -121,30 +147,33 @@ test_platforms: flavor: b1.large standalone: GameCoreScarlett - -# Editors to be used for testing. -# Since NGOv2 official support started from U6 it means that only those editors should be used for testing +# EDITOR CONFIGURATIONS------------------------------------------------------------------------------- +# Editors to be used for testing. NGOv1.X official support started from 2021.3 editor +# TODO: When a new editor will be released it should be added to this list. Correct also if we will stop supporting one of the editors present here + validation_editors: default: - trunk all: - 2021.3 - 2022.3 - - 2023.3 - 6000.0 - 6000.1 - trunk -# Scripting backends used by Standalone RunTimeTests +# Scripting backends used by Standalone RunTimeTests--------------------------------------------------- + scripting_backends: - mono - il2cpp -# Projects within the repository that will be tested. Name will be used -# for job ids, so it should not contain spaces/non-supported characters -# The default project will also be used for validation, code coverage etc. +# PROJECTS CONFIGURATIONS------------------------------------------------------------------------------- +# Projects within the repository that will be tested/build. +# The default project should be used for general validation, code coverage and other tests where choice of project should not matter (because we are interested in NGO package) +# has_tests --> describes if projects contains any tests to run. + projects: default: - name: testproject diff --git a/.yamato/webgl-build.yml b/.yamato/webgl-build.yml index 97a182acdb..33fac79782 100644 --- a/.yamato/webgl-build.yml +++ b/.yamato/webgl-build.yml @@ -1,53 +1,55 @@ -{% metadata_file .yamato/project.metafile %} +{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file. --- -# Builds a player on WebGl standalone platform without executing any tests. -# This setup performs build-only validation since WebGL runs in browser and for tests to be executed we would need to -# consider having a web server, browser automation and overall complex test setup. -# Default project (testptoject) in this case is used as a context. -# WebGL requires Il2cpp scripting backend so mono is not considered -# ARM64 architectures are not considered since Windows_arm64 is recommended to use only after builds and when it comes to macOS_arm64 there is problem with OpenCL not being available -# Builds are made on each desktop platform as in project.metafile declaration +# DESCRIPTION-------------------------------------------------------------------------- + # This job is responsible for validating a successful building of a player on WebGl standalone platform. + # This job WILL NOT execute any tests, we only validate the building process. + # This is because WebGL runs in browser and for tests to be executed we would need to consider having a web server, browser automation and overall complex test setup which currently we don't have. + +# CONFIGURATION STRUCTURE-------------------------------------------------------------- + # Jobs configurations are generated using nested loops through: + # 1. For the default project (project is used only as a context for the build). + # 2. For all desktop platforms (Windows, Ubuntu, macOS) + # 3. For all supported Unity Editor versions (For NGOv1.X it means 2021.3+) + +# TECHNICAL CONSIDERATIONS---------------------------------------------------------------- + # WebGL requires IL2CPP scripting backend (Mono is not supported) + # We are not using ARM64 architectures since we only perform a build action. x64 architectures are preferred for build phase (in order to optimize available resource usage) + # We only perform build validation (no runtime testing) + +# QUALITY CONSIDERATIONS-------------------------------------------------------------------- + # In the future we could try to implement an infrastructure to run test in webgl context but this could be quite complicated and would need to be evaluated if it's worth it + # To see where this job is included (in trigger job definitions) look into _triggers.yml file + +#-------------------------------------------------------------------------------------- + {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} webgl_build_{{ project.name }}_{{ platform.name }}_{{ editor }}: name: WebGl Build - {{ project.name }} [{{ platform.name }}, {{ editor }}, il2cpp] agent: - type: {% if platform.name == "mac" %} {{ platform.type }} {% else %} {{ platform.type }}::GPU {% endif %} + type: {{ platform.type }} image: {{ platform.image }} flavor: {{ platform.flavor }} - commands: - # Installing tools - - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple - - # Platform specific UTR setup - - | -{% if platform.name == "win" %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat -{% else %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr +{% if platform.model %} + model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} + commands: + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor -c webgl -c il2cpp {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloading the editor with additional webgl and il2cpp components - # Installing editor - - unity-downloader-cli -u {{ editor }} -c Editor -c webgl -c il2cpp -w --fast - - # Build Player - - | -{% if platform.name == "win" %} - utr.bat --suite=playmode --platform=WebGL --scripting-backend=il2cpp --testproject={{ project.path }} --editor-location=.Editor --artifacts_path=artifacts --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg="-cloudEnvironment staging" --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 -{% else %} - ./utr --suite=playmode --platform=WebGL --scripting-backend=il2cpp --testproject={{ project.path }} --editor-location=.Editor --artifacts-path=artifacts --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg="-cloudEnvironment staging" --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 -{% endif %} - + # The following step builds the player with defined options such as: + # Suite parameter if defined since it's a mandatory field to define which test suite should be used, but it doesn't matter in this case since we won't run any tests (--suite) + # Editor is run in batchmode, which means that Unity runs command line arguments without the need for human interaction. It also suppresses pop-up windows that require human interaction (such as the Save Scene window). We should always run Unity in batch mode when using command line arguments, because it allows automation to run without interruption. (--extra-editor-arg=-batchmode) + # Engine is initialized in ‘nographics’ mode since we don't need any graphics for this case (--extra-editor-arg=-nographics) + # In case of failure the job will be rerunned once (--reruncount=1) with clean library (--clean-library-on-rerun) + # This will perform only building phase (--build-only) with a timeout of 3m (--timeout=1800) + - UnifiedTestRunner --suite=playmode --platform=WebGL --scripting-backend=il2cpp --testproject={{ project.path }} --editor-location=.Editor --artifacts_path=artifacts --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 artifacts: logs: paths: - "artifacts/**/*" - "build/players/**/*" - variables: - CI: true - ENABLE_BURST_COMPILATION: False {% endfor -%} {% endfor -%} {% endfor -%} diff --git a/com.unity.netcode.gameobjects/Tests/Editor/Timing/NetworkTimeTests.cs b/com.unity.netcode.gameobjects/Tests/Editor/Timing/NetworkTimeTests.cs index be53a0df7f..9256951193 100644 --- a/com.unity.netcode.gameobjects/Tests/Editor/Timing/NetworkTimeTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Editor/Timing/NetworkTimeTests.cs @@ -3,6 +3,7 @@ using System.Linq; using NUnit.Framework; using UnityEngine; +using UnityEngine.TestTools; using Random = System.Random; namespace Unity.Netcode.EditorTests @@ -38,6 +39,7 @@ public void TestTimeAsFloat(double d, float f, uint tickRate) } [Test] + [UnityPlatform(exclude = new[] { RuntimePlatform.OSXPlayer, RuntimePlatform.OSXEditor })] // Tracked in MTT-11608 [TestCase(53.55d, 53.5d, 10u)] [TestCase(1013553.55d, 1013553.5d, 10u)] [TestCase(0d, 0d, 10u)] @@ -52,6 +54,7 @@ public void TestToFixedTime(double time, double expectedFixedTime, uint tickRate } [Test] + [UnityPlatform(exclude = new[] { RuntimePlatform.OSXPlayer, RuntimePlatform.OSXEditor })] // Tracked in MTT-11608 [TestCase(34d, 0)] [TestCase(17.32d, 0.2d / 60d)] [TestCase(-42.44d, 1d / 60d - 0.4d / 60d)] diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs index 584a13ae62..69674c20d9 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs @@ -1668,6 +1668,7 @@ public void TestMutualRecursion() Clear(); } + serverObj.Stop = true; WaitForMessageReceivedWithTimeTravel(serverList); Assert.IsFalse(serverObj.Stop); diff --git a/pvpExceptions.json b/pvpExceptions.json index 4deefeeb86..b3aaff683e 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -5,6 +5,11 @@ "CHANGELOG.md: line 9: Unreleased section is not allowed for public release" ] }, + "PVP-300-4": { + "errors": [ + "Failed to find a suitable OpenCL device, baking cannot use GPU lightmapper." + ] + }, "PVP-150-1": { "errors": [ "Unity.Netcode.Components.NetworkTransform: void OnSynchronize(ref BufferSerializer): empty tag", From ced4384f0bdc277e9ea9d4384ca2eede2fc3596f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Mon, 24 Mar 2025 20:36:04 +0100 Subject: [PATCH 04/23] docs: [1.X] fixes of PVP exceptions (#3300) This PR focuses on fixing PVP errors related to PVP-151-1 "**_Public APIs should be documented_**" and all remaining PVP errors **present in pvpExceptions.json file** We have quite a lot of errors to address so this PR will be a collaborative effort. If anyone want's to add to it what we should do is: 1. Check errors present in pvpExceptions.json file (preferably under "PVP-150-1", choose some to fix 2. Address those errors and when making commit remove the fixed errors from pvpExceptions file The first commit of this PR is an example of how such process should look like In general [new CI implementation](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/3193) will catch all new errors like this so all we need to do is fix the present ones. This PR **does not** focus on PVP present in gold profile but if capacity allows, those can also be addressed. **Error present in "PVP-41-1" is to be expected** so there is no need of fixing this one! Another thing is that we could ignore error related to missing APIs for RuntimeTests because those were made internal in 2.X version (that's why those errors are not popping by there). Those APIs are not user facing so we could just leave them (otherwise there is like 2000 more APIs to add) --------- Co-authored-by: Noel Stephens Co-authored-by: Emma Co-authored-by: unity-renovate[bot] <120015202+unity-renovate[bot]@users.noreply.github.com> --- .yamato/wrench/package-pack-jobs.yml | 1 + .../Components/AnticipatedNetworkTransform.cs | 44 +++ .../Components/HalfVector3.cs | 2 + .../Components/HalfVector4.cs | 2 + .../Components/NetworkDeltaPosition.cs | 4 + .../Components/NetworkTransform.cs | 65 +++-- .../AnticipatedNetworkTransformEditor.cs | 3 + .../NetcodeForGameObjectsProjectSettings.cs | 23 ++ .../Configuration/NetworkPrefabProcessor.cs | 3 + .../Configuration/NetworkPrefabsEditor.cs | 9 + .../Editor/NetworkTransformEditor.cs | 7 +- .../Runtime/Core/NetworkBehaviour.cs | 32 ++- .../Collections/NetworkList.cs | 118 +++++--- .../NetworkVariableSerialization.cs | 65 +++-- .../Serialization/NetworkObjectReference.cs | 4 +- .../Runtime/NetcodeIntegrationTest.cs | 260 ++++++++++++++++-- .../Runtime/Timing/NetworkTimeSystemTests.cs | 2 +- pvpExceptions.json | 218 +-------------- 18 files changed, 512 insertions(+), 350 deletions(-) diff --git a/.yamato/wrench/package-pack-jobs.yml b/.yamato/wrench/package-pack-jobs.yml index fd763f6fa5..43d968cc25 100644 --- a/.yamato/wrench/package-pack-jobs.yml +++ b/.yamato/wrench/package-pack-jobs.yml @@ -26,3 +26,4 @@ package_pack_-_netcode_gameobjects: Job Maintainers: '#rm-packageworks' Wrench: 0.10.44.0 + diff --git a/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs b/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs index 279592184f..d3c0cafb72 100644 --- a/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs @@ -46,10 +46,24 @@ namespace Unity.Netcode.Components [DefaultExecutionOrder(100000)] // this is needed to catch the update time after the transform was updated by user scripts public class AnticipatedNetworkTransform : NetworkTransform { + /// + /// Represents the state of a transform, including position, rotation, and scale. + /// public struct TransformState { + /// + /// The position of the transform. + /// public Vector3 Position; + + /// + /// The rotation of the transform. + /// public Quaternion Rotation; + + /// + /// The scale of the transform. + /// public Vector3 Scale; } @@ -242,6 +256,9 @@ public void AnticipateState(TransformState newState) m_CurrentSmoothTime = 0; } + /// + /// Updates the AnticipatedNetworkTransform each frame. + /// protected override void Update() { // If not spawned or this instance has authority, exit early @@ -350,6 +367,13 @@ private void ResetAnticipatedState() m_CurrentSmoothTime = 0; } + /// + /// Invoked when a new client joins (server and client sides). + /// Server Side: Serializes as if we were teleporting (everything is sent via NetworkTransformState). + /// Client Side: Adds the interpolated state which applies the NetworkTransformState as well. + /// + /// The type of the serializer. + /// The serializer used to serialize the state. protected override void OnSynchronize(ref BufferSerializer serializer) { base.OnSynchronize(ref serializer); @@ -361,6 +385,9 @@ protected override void OnSynchronize(ref BufferSerializer serializer) } } + /// + /// Invoked when the NetworkObject is spawned. + /// public override void OnNetworkSpawn() { base.OnNetworkSpawn(); @@ -373,6 +400,9 @@ public override void OnNetworkSpawn() NetworkManager.AnticipationSystem.AllAnticipatedObjects.Add(m_AnticipatedObject); } + /// + /// Invoked when the NetworkObject is despawned. + /// public override void OnNetworkDespawn() { if (m_AnticipatedObject != null) @@ -387,6 +417,9 @@ public override void OnNetworkDespawn() base.OnNetworkDespawn(); } + /// + /// Invoked when the NetworkObject is destroyed. + /// public override void OnDestroy() { if (m_AnticipatedObject != null) @@ -438,6 +471,9 @@ public void Smooth(TransformState from, TransformState to, float durationSeconds m_CurrentSmoothTime = 0; } + /// + /// Invoked just before the authoritative state is updated and pushed to non-authoritative instances. + /// protected override void OnBeforeUpdateTransformState() { // this is called when new data comes from the server @@ -445,12 +481,20 @@ protected override void OnBeforeUpdateTransformState() m_OutstandingAuthorityChange = true; } + /// + /// Invoked when the NetworkTransform state is updated. + /// + /// The previous state of the NetworkTransform. + /// The new state of the NetworkTransform. protected override void OnNetworkTransformStateUpdated(ref NetworkTransformState oldState, ref NetworkTransformState newState) { base.OnNetworkTransformStateUpdated(ref oldState, ref newState); ApplyAuthoritativeState(); } + /// + /// Invoked whenever the transform has been updated. + /// protected override void OnTransformUpdated() { if (CanCommitToTransform || m_AnticipatedObject == null) diff --git a/com.unity.netcode.gameobjects/Components/HalfVector3.cs b/com.unity.netcode.gameobjects/Components/HalfVector3.cs index 48ae12196f..338feed578 100644 --- a/com.unity.netcode.gameobjects/Components/HalfVector3.cs +++ b/com.unity.netcode.gameobjects/Components/HalfVector3.cs @@ -77,6 +77,8 @@ private void SerializeRead(FastBufferReader reader) /// /// The serialization implementation of . /// + /// The type of the serializer. + /// The serializer used to serialize or deserialize the state. public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { if (serializer.IsReader) diff --git a/com.unity.netcode.gameobjects/Components/HalfVector4.cs b/com.unity.netcode.gameobjects/Components/HalfVector4.cs index 03702f0eed..f9e6f5ce2f 100644 --- a/com.unity.netcode.gameobjects/Components/HalfVector4.cs +++ b/com.unity.netcode.gameobjects/Components/HalfVector4.cs @@ -61,6 +61,8 @@ private void SerializeRead(FastBufferReader reader) /// /// The serialization implementation of . /// + /// The type of the serializer. + /// The serializer used to serialize or deserialize the state. public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { if (serializer.IsReader) diff --git a/com.unity.netcode.gameobjects/Components/NetworkDeltaPosition.cs b/com.unity.netcode.gameobjects/Components/NetworkDeltaPosition.cs index 2ed982d3e3..cd85a06a04 100644 --- a/com.unity.netcode.gameobjects/Components/NetworkDeltaPosition.cs +++ b/com.unity.netcode.gameobjects/Components/NetworkDeltaPosition.cs @@ -30,6 +30,8 @@ public struct NetworkDeltaPosition : INetworkSerializable /// /// The serialization implementation of /// + /// The type of the serializer. + /// The serializer used to serialize or deserialize the state. public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { if (!SynchronizeBase) @@ -105,6 +107,7 @@ public Vector3 GetFullPosition() /// /// Only applies to the authoritative side for instances. /// + /// The current delta position as a with half float precision. [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector3 GetConvertedDelta() { @@ -120,6 +123,7 @@ public Vector3 GetConvertedDelta() /// Precision loss adjustments are one network tick behind on the /// non-authoritative side. /// + /// The current delta position as a . [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector3 GetDeltaPosition() { diff --git a/com.unity.netcode.gameobjects/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Components/NetworkTransform.cs index 13f17e99e5..77a7f4293e 100644 --- a/com.unity.netcode.gameobjects/Components/NetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Components/NetworkTransform.cs @@ -66,7 +66,7 @@ public class NetworkTransform : NetworkBehaviour /// - The teleporting state update. /// - When using half float precision and the `NetworkDeltaPosition` delta exceeds the maximum delta forcing the axis in /// question to be collapsed into the core base position, this state update will be sent as reliable fragmented sequenced. - /// + /// /// In order to preserve a continual consistency of axial values when unreliable delta messaging is enabled (due to the /// possibility of dropping packets), NetworkTransform instances will send 1 axial frame synchronization update per /// second (only for the axis marked to synchronize are sent as reliable fragmented sequenced) as long as a delta state @@ -104,7 +104,7 @@ public struct NetworkTransformState : INetworkSerializable private const int k_ReliableSequenced = 0x00080000; private const int k_UseUnreliableDeltas = 0x00100000; private const int k_UnreliableFrameSync = 0x00200000; - private const int k_TrackStateId = 0x10000000; // (Internal Debugging) When set each state update will contain a state identifier + private const int k_TrackStateId = 0x10000000; // (Internal Debugging) When set each state update will contain a state identifier // Stores persistent and state relative flags private uint m_Bitset; @@ -459,10 +459,11 @@ internal set } /// - /// Returns whether this state update was a frame synchronization when - /// UseUnreliableDeltas is enabled. When set, the entire transform will + /// Returns whether this state update was a frame synchronization when + /// UseUnreliableDeltas is enabled. When set, the entire transform will /// be or has been synchronized. /// + /// if this state update was a frame synchronization; otherwise, . public bool IsUnreliableFrameSync() { return UnreliableFrameSync; @@ -475,6 +476,7 @@ public bool IsUnreliableFrameSync() /// /// Unreliable delivery will only be used if is set. /// + /// if this state was sent with reliable delivery; otherwise, . public bool IsReliableStateUpdate() { return ReliableSequenced; @@ -586,7 +588,7 @@ public Quaternion GetRotation() /// /// When there is no change in an updated state's position then there are no values to return. /// Checking for is one way to detect this. - /// When used with half precision it returns the half precision delta position state update + /// When used with half precision it returns the half precision delta position state update /// which will not be the full position. /// To get a NettworkTransform's full position, use and /// pass true as the parameter. @@ -661,6 +663,8 @@ public int GetNetworkTick() /// /// Serializes this /// + /// The type of the serializer. + /// The serializer used for reading or writing the state. public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { // Used to calculate the LastSerializedSize value @@ -897,7 +901,7 @@ public void NetworkSerialize(BufferSerializer serializer) where T : IReade if (HasScaleChange) { // If we are teleporting (which includes synchronizing) and the associated NetworkObject has a parent - // then we want to serialize the LossyScale since NetworkObject spawn order is not guaranteed + // then we want to serialize the LossyScale since NetworkObject spawn order is not guaranteed if (IsTeleportingNextFrame && IsParented) { serializer.SerializeValue(ref LossyScale); @@ -1419,9 +1423,8 @@ private bool ShouldSynchronizeHalfFloat(ulong targetClientId) /// /// If a derived class overrides this, then make sure to invoke this base method! /// - /// - /// - /// the clientId being synchronized (both reading and writing) + /// The type of the serializer. + /// The serializer used for reading or writing the state. protected override void OnSynchronize(ref BufferSerializer serializer) { m_CachedNetworkManager = NetworkManager; @@ -1575,11 +1578,11 @@ private void TryCommitTransform(ref Transform transformToCommit, bool synchroniz Debug.LogException(ex); } - // The below is part of assuring we only send a frame synch, when sending unreliable deltas, if + // The below is part of assuring we only send a frame synch, when sending unreliable deltas, if // we have already sent at least one unreliable delta state update. At this point in the callstack, // a delta state update has just been sent in the above UpdateTransformState() call and as long as // we didn't send a frame synch and we are not synchronizing then we know at least one unreliable - // delta has been sent. Under this scenario, we should start checking for this instance's alloted + // delta has been sent. Under this scenario, we should start checking for this instance's alloted // frame synch "tick slot". Once we send a frame synch, if no other deltas occur after that // (i.e. the object is at rest) then we will stop sending frame synch's until the object begins // moving, rotating, or scaling again. @@ -1862,7 +1865,7 @@ private bool ApplyTransformToNetworkStateWithInfo(ref NetworkTransformState netw networkState.NetworkDeltaPosition = m_HalfPositionState; - // If ownership offset is greater or we are doing an axial synchronization then synchronize the base position + // If ownership offset is greater or we are doing an axial synchronization then synchronize the base position if ((m_HalfFloatTargetTickOwnership > m_CachedNetworkManager.ServerTime.Tick || isAxisSync) && !networkState.IsTeleportingNextFrame) { networkState.SynchronizeBaseHalfFloat = true; @@ -2056,6 +2059,10 @@ private bool ApplyTransformToNetworkStateWithInfo(ref NetworkTransformState netw return isDirty; } + /// + /// Invoked whenever the transform has been updated. + /// This method can be overridden to handle any custom logic that needs to occur after the transform has been updated. + /// protected virtual void OnTransformUpdated() { @@ -2602,6 +2609,10 @@ protected virtual void OnNetworkTransformStateUpdated(ref NetworkTransformState } + /// + /// Invoked just before the transform state is updated. + /// This method can be overridden to handle any custom logic that needs to occur before the transform state is updated. + /// protected virtual void OnBeforeUpdateTransformState() { @@ -2816,6 +2827,12 @@ public override void OnGainedOwnership() base.OnGainedOwnership(); } + /// + /// Invoked when the ownership of the changes. + /// This method handles reinitialization when the local client gains or loses ownership of the . + /// + /// The client ID of the previous owner. + /// The client ID of the new owner. protected override void OnOwnershipChanged(ulong previous, ulong current) { // If we were the previous owner or the newly assigned owner then reinitialize @@ -2842,7 +2859,7 @@ protected virtual void OnInitialize(ref NetworkTransformState replicatedState) /// This method is only invoked by the owner /// Use: OnInitialize(ref NetworkTransformState replicatedState) to be notified on all instances /// - /// + /// The current after initializing. protected virtual void OnInitialize(ref NetworkVariable replicatedState) { @@ -2851,9 +2868,9 @@ protected virtual void OnInitialize(ref NetworkVariable r private int m_HalfFloatTargetTickOwnership; /// - /// The internal initialzation method to allow for internal API adjustments + /// The internal initialization method to allow for internal API adjustments /// - /// + /// Indicates whether the initialization is due to an ownership change. private void InternalInitialization(bool isOwnershipChange = false) { if (!IsSpawned) @@ -2956,11 +2973,11 @@ public override void OnNetworkObjectParentChanged(NetworkObject parentNetworkObj /// The parameters are broken up into pos / rot / scale on purpose so that the caller can perturb /// just the desired one(s) /// - /// new position to move to. Can be null - /// new rotation to rotate to. Can be null + /// new position to move to. Can be null. + /// new rotation to rotate to. Can be null. /// new scale to scale to. Can be null /// When true (the default) the will not be teleported and, if enabled, will interpolate. When false the will teleport/apply the parameters provided immediately. - /// + /// Thrown when the function is called on non-spawned object or, when it's called without proper authority public void SetState(Vector3? posIn = null, Quaternion? rotIn = null, Vector3? scaleIn = null, bool teleportDisabled = true) { if (!IsSpawned) @@ -3023,7 +3040,7 @@ private void SetStateInternal(Vector3 pos, Quaternion rot, Vector3 scale, bool s var transformToCommit = transform; - // Explicit set states are cumulative during a fractional tick period of time (i.e. each SetState invocation will + // Explicit set states are cumulative during a fractional tick period of time (i.e. each SetState invocation will // update the axial deltas to whatever changes are applied). As such, we need to preserve the dirty and explicit // state flags. var stateWasDirty = m_LocalAuthoritativeNetworkState.IsDirty; @@ -3111,7 +3128,9 @@ private void UpdateInterpolation() } } - /// + /// + /// This method is called once per frame. + /// /// /// If you override this method, be sure that: /// - Non-authority always invokes this base class method. @@ -3134,10 +3153,10 @@ protected virtual void Update() /// /// Teleport the transform to the given values without interpolating /// - /// new position to move to. - /// new rotation to rotate to. + /// new position to move to. + /// new rotation to rotate to. /// new scale to scale to. - /// + /// Thrown if teleporting is attempted on a non-authoritative side. public void Teleport(Vector3 newPosition, Quaternion newRotation, Vector3 newScale) { if (!CanCommitToTransform) diff --git a/com.unity.netcode.gameobjects/Editor/AnticipatedNetworkTransformEditor.cs b/com.unity.netcode.gameobjects/Editor/AnticipatedNetworkTransformEditor.cs index 0986808fc4..8202cf425a 100644 --- a/com.unity.netcode.gameobjects/Editor/AnticipatedNetworkTransformEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/AnticipatedNetworkTransformEditor.cs @@ -9,6 +9,9 @@ namespace Unity.Netcode.Editor [CustomEditor(typeof(AnticipatedNetworkTransform), true)] public class AnticipatedNetworkTransformEditor : NetworkTransformEditor { + /// + /// Gets a value indicating whether the interpolate value should be hidden in the inspector. + /// public override bool HideInterpolateValue => true; } } diff --git a/com.unity.netcode.gameobjects/Editor/Configuration/NetcodeForGameObjectsProjectSettings.cs b/com.unity.netcode.gameobjects/Editor/Configuration/NetcodeForGameObjectsProjectSettings.cs index e5d18b6bb8..fea84450db 100644 --- a/com.unity.netcode.gameobjects/Editor/Configuration/NetcodeForGameObjectsProjectSettings.cs +++ b/com.unity.netcode.gameobjects/Editor/Configuration/NetcodeForGameObjectsProjectSettings.cs @@ -3,13 +3,30 @@ namespace Unity.Netcode.Editor.Configuration { + /// + /// Project settings for Netcode for GameObjects. + /// [FilePath("ProjectSettings/NetcodeForGameObjects.asset", FilePathAttribute.Location.ProjectFolder)] public class NetcodeForGameObjectsProjectSettings : ScriptableSingleton { + /// + /// The default path for network prefabs. + /// internal static readonly string DefaultNetworkPrefabsPath = "Assets/DefaultNetworkPrefabs.asset"; + + /// + /// The path to the network prefabs. + /// [SerializeField] public string NetworkPrefabsPath = DefaultNetworkPrefabsPath; + + /// + /// A temporary path to the network prefabs. + /// public string TempNetworkPrefabsPath; + /// + /// Called when the script instance is being loaded. + /// private void OnEnable() { if (NetworkPrefabsPath == "") @@ -19,9 +36,15 @@ private void OnEnable() TempNetworkPrefabsPath = NetworkPrefabsPath; } + /// + /// Indicates whether to generate default network prefabs. + /// [SerializeField] public bool GenerateDefaultNetworkPrefabs = true; + /// + /// Saves the project settings. + /// internal void SaveSettings() { Save(true); diff --git a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabProcessor.cs b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabProcessor.cs index 55f5fcbfc4..b1ad838d77 100644 --- a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabProcessor.cs +++ b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabProcessor.cs @@ -9,6 +9,9 @@ namespace Unity.Netcode.Editor.Configuration /// public class NetworkPrefabProcessor : AssetPostprocessor { + /// + /// Gets or sets the default path for network prefabs. + /// public static string DefaultNetworkPrefabsPath { get diff --git a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs index 0845068be7..c871fcdcc1 100644 --- a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs @@ -4,6 +4,9 @@ namespace Unity.Netcode.Editor { + /// + /// Custom editor for the class. + /// [CustomEditor(typeof(NetworkPrefabsList), true)] [CanEditMultipleObjects] public class NetworkPrefabsEditor : UnityEditor.Editor @@ -11,6 +14,9 @@ public class NetworkPrefabsEditor : UnityEditor.Editor private ReorderableList m_NetworkPrefabsList; private SerializedProperty m_IsDefaultBool; + /// + /// Initializes the custom editor when it is enabled. + /// private void OnEnable() { m_IsDefaultBool = serializedObject.FindProperty(nameof(NetworkPrefabsList.IsDefault)); @@ -82,6 +88,9 @@ private void OnEnable() m_NetworkPrefabsList.drawHeaderCallback = rect => EditorGUI.LabelField(rect, "NetworkPrefabs"); } + /// + /// Draws the custom inspector GUI for the NetworkPrefabsEditor. + /// public override void OnInspectorGUI() { using (new EditorGUI.DisabledScope(true)) diff --git a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs index f8bd23f0db..fb52217960 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs @@ -37,9 +37,14 @@ public class NetworkTransformEditor : UnityEditor.Editor private static GUIContent s_RotationLabel = EditorGUIUtility.TrTextContent("Rotation"); private static GUIContent s_ScaleLabel = EditorGUIUtility.TrTextContent("Scale"); + /// + /// Gets a value indicating whether the interpolate value should be hidden in the inspector. + /// public virtual bool HideInterpolateValue => false; - /// + /// + /// Called when the editor is enabled. + /// public void OnEnable() { m_UseUnreliableDeltas = serializedObject.FindProperty(nameof(NetworkTransform.UseUnreliableDeltas)); diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs index 2754fdf8c0..ba8e981795 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs @@ -492,15 +492,15 @@ internal bool IsBehaviourEditable() m_NetworkObject.NetworkManager.IsServer; } - /// TODO: this needs an overhaul. It's expensive, it's ja little naive in how it looks for networkObject in - /// its parent and worst, it creates a puzzle if you are a NetworkBehaviour wanting to see if you're live or not - /// (e.g. editor code). All you want to do is find out if NetworkManager is null, but to do that you - /// need NetworkObject, but if you try and grab NetworkObject and NetworkManager isn't up you'll get - /// the warning below. This is why IsBehaviourEditable had to be created. Matt was going to re-do - /// how NetworkObject works but it was close to the release and too risky to change /// /// Gets the NetworkObject that owns this NetworkBehaviour instance /// + // TODO: this needs an overhaul. It's expensive, it's ja little naive in how it looks for networkObject in + // its parent and worst, it creates a puzzle if you are a NetworkBehaviour wanting to see if you're live or not + // (e.g. editor code). All you want to do is find out if NetworkManager is null, but to do that you + // need NetworkObject, but if you try and grab NetworkObject and NetworkManager isn't up you'll get + // the warning below. This is why IsBehaviourEditable had to be created. Matt was going to re-do + // how NetworkObject works but it was close to the release and too risky to change public NetworkObject NetworkObject { get @@ -620,11 +620,11 @@ internal void UpdateNetworkProperties() /// A reference to is passed in as a parameter to determine the context of execution (IsServer/IsClient) /// /// - /// a ref to the since this is not yet set on the /// The will not have anything assigned to it at this point in time. /// Settings like ownership, NetworkBehaviourId, NetworkManager, and most other spawn related properties will not be set. /// This can be used to handle things like initializing/instantiating a NetworkVariable or the like. /// + /// a ref to the since this is not yet set on the protected virtual void OnNetworkPreSpawn(ref NetworkManager networkManager) { } /// @@ -654,11 +654,11 @@ protected virtual void OnNetworkPostSpawn() { } protected virtual void OnNetworkSessionSynchronized() { } /// - /// [Client & Server Side] + /// [Client and Server Side] /// When a scene is loaded an in-scene placed NetworkObjects are all spawned, this method is invoked on all of the newly spawned in-scene placed NetworkObjects. /// /// - /// This can be used to handle post scene loaded actions for in-scene placed NetworkObjcts where you might need to access a different NetworkObject and/or NetworkBehaviour not local to the current NetworkObject context. + /// This can be used to handle post scene loaded actions for in-scene placed NetworkObjects where you might need to access a different NetworkObject and/or NetworkBehaviour not local to the current NetworkObject context. /// protected virtual void OnInSceneObjectsSpawned() { } @@ -772,7 +772,7 @@ public virtual void OnGainedOwnership() { } internal void InternalOnGainedOwnership() { UpdateNetworkProperties(); - // New owners need to assure any NetworkVariables they have write permissions + // New owners need to assure any NetworkVariables they have write permissions // to are updated so the previous and original values are aligned with the // current value (primarily for collections). if (OwnerClientId == NetworkManager.LocalClientId) @@ -1220,10 +1220,10 @@ internal void SetNetworkVariableData(FastBufferReader reader, ulong clientId) } /// - /// Gets the local instance of a object with a given NetworkId + /// Gets the local instance of a with a given NetworkId. /// - /// - /// + /// The NetworkId of the to retrieve. + /// Returns the with the specified NetworkId, or null if not found. protected NetworkObject GetNetworkObject(ulong networkId) { return NetworkManager.SpawnManager.SpawnedObjects.TryGetValue(networkId, out NetworkObject networkObject) ? networkObject : null; @@ -1246,12 +1246,16 @@ protected NetworkObject GetNetworkObject(ulong networkId) /// Either BufferSerializerReader or BufferSerializerWriter, depending whether the serializer /// is in read mode or write mode. /// - /// the relative client identifier being synchronized protected virtual void OnSynchronize(ref BufferSerializer serializer) where T : IReaderWriter { } + /// + /// Invoked when the network anticipates a change in the state of the object. + /// This method can be used to handle any logic that needs to occur when the network predicts a state change. + /// + /// The last round trip time in seconds. public virtual void OnReanticipate(double lastRoundTripTime) { diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs index 35c38c88a6..eaf06bbb67 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs @@ -26,14 +26,14 @@ public class NetworkList : NetworkVariableBase where T : unmanaged, IEquatabl public event OnListChangedDelegate OnListChanged; /// - /// Constructor method for + /// Creates a /// public NetworkList() { } - /// - /// - /// - /// + /// + /// An optional collection of initial values to populate the list. If null, the list will start empty. + /// The read permission level for the network list. Determines who can read the list (e.g., server-only or everyone). Default is defined by DefaultReadPerm + /// The write permission level for the network list. Determines who can modify the list (e.g., server-only or specific clients). Default is defined by DefaultWritePerm. public NetworkList(IEnumerable values = default, NetworkVariableReadPermission readPerm = DefaultReadPerm, NetworkVariableWritePermission writePerm = DefaultWritePerm) @@ -54,7 +54,7 @@ public NetworkList(IEnumerable values = default, Dispose(); } - /// + /// public override void ResetDirty() { base.ResetDirty(); @@ -64,7 +64,7 @@ public override void ResetDirty() } } - /// + /// public override bool IsDirty() { // we call the base class to allow the SetDirty() mechanism to work @@ -76,7 +76,7 @@ internal void MarkNetworkObjectDirty() MarkNetworkBehaviourDirty(); } - /// + /// public override void WriteDelta(FastBufferWriter writer) { @@ -132,7 +132,7 @@ public override void WriteDelta(FastBufferWriter writer) } } - /// + /// public override void WriteField(FastBufferWriter writer) { writer.WriteValueSafe((ushort)m_List.Length); @@ -142,7 +142,7 @@ public override void WriteField(FastBufferWriter writer) } } - /// + /// public override void ReadField(FastBufferReader reader) { m_List.Clear(); @@ -155,15 +155,15 @@ public override void ReadField(FastBufferReader reader) } } - /// + /// public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta) { - /// This is only invoked by and the only time - /// keepDirtyDelta is set is when it is the server processing. To be able to handle previous - /// versions, we use IsServer to keep the dirty states received and the keepDirtyDelta to - /// actually mark this as dirty and add it to the list of s to - /// be updated. With the forwarding of deltas being handled by , - /// once all clients have been forwarded the dirty events, we clear them by invoking . + // This is only invoked by and the only time + // keepDirtyDelta is set is when it is the server processing. To be able to handle previous + // versions, we use IsServer to keep the dirty states received and the keepDirtyDelta to + // actually mark this as dirty and add it to the list of s to + // be updated. With the forwarding of deltas being handled by , + // once all clients have been forwarded the dirty events, we clear them by invoking . var isServer = m_NetworkManager.IsServer; reader.ReadValueSafe(out ushort deltaCount); for (int i = 0; i < deltaCount; i++) @@ -394,7 +394,7 @@ public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta) } } - /// + /// /// /// For NetworkList, we just need to reset dirty if a server has read deltas /// @@ -406,13 +406,22 @@ internal override void PostDeltaRead() } } - /// + /// + /// Returns an enumerator that iterates through the . + /// + /// An enumerator for the . public IEnumerator GetEnumerator() { return m_List.GetEnumerator(); } - /// + /// + /// Adds an item to the end of the . + /// + /// The item to be added to the list. + /// + /// This method checks for write permissions before adding the item. + /// public void Add(T item) { // check write permissions @@ -434,7 +443,12 @@ public void Add(T item) HandleAddListEvent(listEvent); } - /// + /// + /// Removes all items from the . + /// + /// + /// This method checks for write permissions before clearing the list. + /// public void Clear() { // check write permissions @@ -454,14 +468,25 @@ public void Clear() HandleAddListEvent(listEvent); } - /// + /// + /// Determines whether the contains a specific value. + /// + /// The object to locate in the . + /// if the is found in the ; otherwise, . public bool Contains(T item) { int index = m_List.IndexOf(item); return index != -1; } - /// + /// + /// Removes the first occurrence of a specific object from the . + /// + /// + /// This method checks for write permissions before removing the item. + /// + /// The object to remove from the list. + /// if the item was successfully removed from the list; otherwise, . public bool Remove(T item) { // check write permissions @@ -488,16 +513,29 @@ public bool Remove(T item) return true; } - /// + /// + /// Gets the number of elements contained in the . + /// public int Count => m_List.Length; - /// + /// + /// Determines the index of a specific in the . + /// + /// The object to remove from the list. + /// The index of the if found in the list; otherwise, -1. public int IndexOf(T item) { return m_List.IndexOf(item); } - /// + /// + /// Inserts to the at the specified . + /// + /// + /// This method checks for write permissions before inserting the item. + /// + /// The index at which the item should be inserted. + /// The item to insert. public void Insert(int index, T item) { // check write permissions @@ -527,7 +565,13 @@ public void Insert(int index, T item) HandleAddListEvent(listEvent); } - /// + /// + /// Removes the item at the specified index. + /// + /// + /// This method checks for write permissions before removing the item. + /// + /// The index of the element to remove. public void RemoveAt(int index) { // check write permissions @@ -550,7 +594,14 @@ public void RemoveAt(int index) HandleAddListEvent(listEvent); } - /// + /// + /// Gets or sets the element at the specified index in the . + /// + /// + /// This method checks for write permissions before setting the value. + /// + /// The zero-based index of the element to get or set. + /// The element at the specified index. public T this[int index] { get => m_List[index]; @@ -586,16 +637,9 @@ private void HandleAddListEvent(NetworkListEvent listEvent) } /// - /// This is actually unused left-over from a previous interface + /// This method should not be used. It is left over from a previous interface. /// - public int LastModifiedTick - { - get - { - // todo: implement proper network tick for NetworkList - return NetworkTickSystem.NoTick; - } - } + public int LastModifiedTick => NetworkTickSystem.NoTick; /// /// Overridden implementation. diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs index 312363e88f..3a20c9bf1d 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs @@ -1022,7 +1022,7 @@ public void Duplicate(in NativeList value, ref NativeList duplicatedValue) /// /// Serializer for managed INetworkSerializable types, which differs from the unmanaged implementation in that it /// has to be null-aware - /// + /// internal class ManagedNetworkSerializableSerializer : INetworkVariableSerializer where T : class, INetworkSerializable, new() { public void Write(FastBufferWriter writer, ref T value) @@ -1095,7 +1095,7 @@ public void Duplicate(in T value, ref T duplicatedValue) /// extension methods. Finding those methods isn't achievable efficiently at runtime, so this allows /// users to tell NetworkVariable about those extension methods (or simply pass in a lambda) /// - /// + /// The type to be serialized. public class UserNetworkVariableSerialization { /// @@ -1110,6 +1110,7 @@ public class UserNetworkVariableSerialization /// /// The to write the value of type `T` /// The value of type `T` to be written + /// The previous value of type `T` to be compared. public delegate void WriteDeltaDelegate(FastBufferWriter writer, in T value, in T previousValue); /// @@ -1129,8 +1130,8 @@ public class UserNetworkVariableSerialization /// /// The read value delegate handler definition /// - /// The to read the value of type `T` - /// The value of type `T` to be read + /// The value of type `T` to be duplicated. + /// The duplicated value of type `T`. public delegate void DuplicateValueDelegate(in T value, ref T duplicatedValue); /// @@ -1273,18 +1274,18 @@ internal static void InitializeIntegerSerialization() } /// - /// Registeres an unmanaged type that will be serialized by a direct memcpy into a buffer + /// Registers an unmanaged type that will be serialized by a direct memcpy into a buffer /// - /// + /// The unmanaged type to be serialized public static void InitializeSerializer_UnmanagedByMemcpy() where T : unmanaged { NetworkVariableSerialization.Serializer = new UnmanagedTypeSerializer(); } /// - /// Registeres an unmanaged type that will be serialized by a direct memcpy into a buffer + /// Registers an unmanaged array type that will be serialized by a direct memcpy into a buffer /// - /// + /// The unmanaged type to be serialized public static void InitializeSerializer_UnmanagedByMemcpyArray() where T : unmanaged { NetworkVariableSerialization>.Serializer = new UnmanagedArraySerializer(); @@ -1292,27 +1293,28 @@ public static void InitializeSerializer_UnmanagedByMemcpyArray() where T : un #if UNITY_NETCODE_NATIVE_COLLECTION_SUPPORT /// - /// Registeres an unmanaged type that will be serialized by a direct memcpy into a buffer + /// Registers an unmanaged list type that will be serialized by a direct memcpy into a buffer /// - /// + /// The unmanaged type to be serialized public static void InitializeSerializer_UnmanagedByMemcpyList() where T : unmanaged { NetworkVariableSerialization>.Serializer = new UnmanagedListSerializer(); } /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of elements in the hash set. public static void InitializeSerializer_NativeHashSet() where T : unmanaged, IEquatable { NetworkVariableSerialization>.Serializer = new NativeHashSetSerializer(); } /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of keys in the hash map. + /// The type of values in the hash map. public static void InitializeSerializer_NativeHashMap() where TKey : unmanaged, IEquatable where TVal : unmanaged @@ -1322,27 +1324,28 @@ public static void InitializeSerializer_NativeHashMap() #endif /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of elements in the list. public static void InitializeSerializer_List() { NetworkVariableSerialization>.Serializer = new ListSerializer(); } /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of elements in the hash set. public static void InitializeSerializer_HashSet() where T : IEquatable { NetworkVariableSerialization>.Serializer = new HashSetSerializer(); } /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of keys in the dictionary. + /// The type of values in the dictionary. public static void InitializeSerializer_Dictionary() where TKey : IEquatable { NetworkVariableSerialization>.Serializer = new DictionarySerializer(); @@ -1352,7 +1355,7 @@ public static void InitializeSerializer_Dictionary() where TKey : IE /// Registers an unmanaged type that implements INetworkSerializable and will be serialized through a call to /// NetworkSerialize /// - /// + /// The unmanaged type that implements INetworkSerializable. public static void InitializeSerializer_UnmanagedINetworkSerializable() where T : unmanaged, INetworkSerializable { NetworkVariableSerialization.Serializer = new UnmanagedNetworkSerializableSerializer(); @@ -1362,7 +1365,7 @@ public static void InitializeSerializer_UnmanagedINetworkSerializable() where /// Registers an unmanaged type that implements INetworkSerializable and will be serialized through a call to /// NetworkSerialize /// - /// + /// The unmanaged type that implements INetworkSerializable. public static void InitializeSerializer_UnmanagedINetworkSerializableArray() where T : unmanaged, INetworkSerializable { NetworkVariableSerialization>.Serializer = new UnmanagedNetworkSerializableArraySerializer(); @@ -1373,7 +1376,7 @@ public static void InitializeSerializer_UnmanagedINetworkSerializableArray() /// Registers an unmanaged type that implements INetworkSerializable and will be serialized through a call to /// NetworkSerialize /// - /// + /// The unmanaged type that implements INetworkSerializable. public static void InitializeSerializer_UnmanagedINetworkSerializableList() where T : unmanaged, INetworkSerializable { NetworkVariableSerialization>.Serializer = new UnmanagedNetworkSerializableListSerializer(); @@ -1384,7 +1387,7 @@ public static void InitializeSerializer_UnmanagedINetworkSerializableList() w /// Registers a managed type that implements INetworkSerializable and will be serialized through a call to /// NetworkSerialize /// - /// + /// The managed type that implements INetworkSerializable. public static void InitializeSerializer_ManagedINetworkSerializable() where T : class, INetworkSerializable, new() { NetworkVariableSerialization.Serializer = new ManagedNetworkSerializableSerializer(); @@ -1394,7 +1397,7 @@ public static void InitializeSerializer_UnmanagedINetworkSerializableList() w /// Registers a FixedString type that will be serialized through FastBufferReader/FastBufferWriter's FixedString /// serializers /// - /// + /// The FixedString type to be serialized. public static void InitializeSerializer_FixedString() where T : unmanaged, INativeList, IUTF8Bytes { NetworkVariableSerialization.Serializer = new FixedStringSerializer(); @@ -1404,7 +1407,7 @@ public static void InitializeSerializer_FixedString() where T : unmanaged, IN /// Registers a FixedString type that will be serialized through FastBufferReader/FastBufferWriter's FixedString /// serializers /// - /// + /// The FixedString type to be serialized. public static void InitializeSerializer_FixedStringArray() where T : unmanaged, INativeList, IUTF8Bytes { NetworkVariableSerialization>.Serializer = new FixedStringArraySerializer(); @@ -1415,7 +1418,7 @@ public static void InitializeSerializer_FixedStringArray() where T : unmanage /// Registers a FixedString type that will be serialized through FastBufferReader/FastBufferWriter's FixedString /// serializers /// - /// + /// The FixedString type to be serialized. public static void InitializeSerializer_FixedStringList() where T : unmanaged, INativeList, IUTF8Bytes { NetworkVariableSerialization>.Serializer = new FixedStringListSerializer(); @@ -1467,7 +1470,7 @@ public static void InitializeEqualityChecker_HashSet() where T : IEquatable /// Registers an unmanaged type that will be checked for equality using T.Equals() /// - /// The type of dictionary keys that implements IEquatable. + /// The type of dictionary keys that implements IEquatable. /// The type of dictionary values. public static void InitializeEqualityChecker_Dictionary() where TKey : IEquatable @@ -1495,7 +1498,7 @@ public static void InitializeEqualityChecker_NativeHashSet() where T : unmana /// /// Registers an unmanaged type that will be checked for equality using T.Equals() /// - /// The type of dictionary keys that implements IEquatable. + /// The type of dictionary keys that implements IEquatable. /// The type of dictionary values. public static void InitializeEqualityChecker_NativeHashMap() where TKey : unmanaged, IEquatable @@ -1562,6 +1565,9 @@ public static class NetworkVariableSerialization /// /// A callback to check if two values are equal. /// + /// The first value to compare. + /// The second value to compare. + /// True if the values are equal; otherwise, false. public delegate bool EqualsDelegate(ref T a, ref T b); /// @@ -1642,6 +1648,7 @@ public static void Read(FastBufferReader reader, ref T value) /// /// The FastBufferWriter to write the serialized data to. /// The value to serialize + /// The previous value of type `T` to be compared. public static void WriteDelta(FastBufferWriter writer, ref T value, ref T previousValue) { Serializer.WriteDelta(writer, ref value, ref previousValue); diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkObjectReference.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkObjectReference.cs index c2f1ba46f1..980cf2928c 100644 --- a/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkObjectReference.cs +++ b/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkObjectReference.cs @@ -25,7 +25,7 @@ public ulong NetworkObjectId /// Creates a new instance of the struct. /// /// The to reference. - /// + /// Thrown if the is not spawned. public NetworkObjectReference(NetworkObject networkObject) { if (networkObject == null) @@ -46,7 +46,7 @@ public NetworkObjectReference(NetworkObject networkObject) /// Creates a new instance of the struct. /// /// The GameObject from which the component will be referenced. - /// + /// Thrown if the GameObject does not have a component or if the is not spawned. public NetworkObjectReference(GameObject gameObject) { if (gameObject == null) diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs index db88d77d5e..3372857289 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs @@ -25,9 +25,21 @@ public abstract class NetcodeIntegrationTest /// internal static bool IsRunning { get; private set; } + /// + /// A global instance of used to manage timeouts during integration tests. + /// protected static TimeoutHelper s_GlobalTimeoutHelper = new TimeoutHelper(8.0f); + + /// + /// A default wait time used to yield for one tick interval during integration tests. + /// This is calculated based on the default tick rate of the server's NetworkManager. + /// protected static WaitForSecondsRealtime s_DefaultWaitForTick = new WaitForSecondsRealtime(1.0f / k_DefaultTickRate); + /// + /// An instance of used to capture and assert log messages during integration tests. + /// This helps in verifying that expected log messages are produced and unexpected log messages are not. + /// public NetcodeLogAssert NetcodeLogAssert; /// @@ -41,6 +53,10 @@ public abstract class NetcodeIntegrationTest /// protected static Dictionary> s_GlobalNetworkObjects = new Dictionary>(); + /// + /// Registers a NetworkObject to the global list of spawned NetworkObjects. + /// + /// The NetworkObject to register. public static void RegisterNetworkObject(NetworkObject networkObject) { if (!s_GlobalNetworkObjects.ContainsKey(networkObject.NetworkManager.LocalClientId)) @@ -66,6 +82,10 @@ public static void RegisterNetworkObject(NetworkObject networkObject) } } + /// + /// Deregisters a NetworkObject from the global list of spawned NetworkObjects. + /// + /// The NetworkObject to deregister. public static void DeregisterNetworkObject(NetworkObject networkObject) { if (networkObject.IsSpawned && networkObject.NetworkManager != null) @@ -74,6 +94,11 @@ public static void DeregisterNetworkObject(NetworkObject networkObject) } } + /// + /// Deregisters a NetworkObject from the global list of spawned NetworkObjects using the clientId and NetworkObjectId. + /// + /// clientId who owns the object. + /// The NetworkObjectId of the NetworkObject. public static void DeregisterNetworkObject(ulong localClientId, ulong networkObjectId) { if (s_GlobalNetworkObjects.ContainsKey(localClientId) && s_GlobalNetworkObjects[localClientId].ContainsKey(networkObjectId)) @@ -86,11 +111,22 @@ public static void DeregisterNetworkObject(ulong localClientId, ulong networkObj } } + /// + /// Gets the total number of clients, including the host if applicable. + /// protected int TotalClients => m_UseHost ? m_NumberOfClients + 1 : m_NumberOfClients; + /// + /// The default tick rate used for the server's NetworkManager. + /// This value is used to calculate the default wait time for one tick interval during integration tests. + /// protected const uint k_DefaultTickRate = 30; private int m_NumberOfClients; + + /// + /// Gets the number of clients to be created for the integration test. + /// protected abstract int NumberOfClients { get; } /// @@ -102,21 +138,56 @@ public static void DeregisterNetworkObject(ulong localClientId, ulong networkObj /// protected bool m_CreateServerFirst = true; + /// + /// Specifies the mode of NetworkManager instantiation and destruction for the integration test. + /// public enum NetworkManagerInstatiationMode { - PerTest, // This will create and destroy new NetworkManagers for each test within a child derived class - AllTests, // This will create one set of NetworkManagers used for all tests within a child derived class (destroyed once all tests are finished) - DoNotCreate // This will not create any NetworkManagers, it is up to the derived class to manage. + /// + /// Creates and destroys new NetworkManagers for each test within a child derived class. + /// + PerTest, + + /// + /// Creates one set of NetworkManagers used for all tests within a child derived class, destroyed once all tests are finished. + /// + AllTests, + + /// + /// Does not create any NetworkManagers; it is up to the derived class to manage. + /// + DoNotCreate } + /// + /// Specifies whether the test should run as a host or server. + /// public enum HostOrServer { + /// + /// Runs the test as a host. + /// Host, + + /// + /// Runs the test as a server. + /// Server } + /// + /// The player prefab used in the integration test. + /// protected GameObject m_PlayerPrefab; + + /// + /// The NetworkManager instance for the server. + /// protected NetworkManager m_ServerNetworkManager; + + /// + /// The NetworkManager instances for the clients, one per client. + /// protected NetworkManager[] m_ClientNetworkManagers; /// @@ -128,11 +199,24 @@ public enum HostOrServer /// protected Dictionary> m_PlayerNetworkObjects = new Dictionary>(); + /// + /// Indicates whether the test should run as a host. + /// If true, the test will run as a host; otherwise, it will run as a server. + /// protected bool m_UseHost = true; + + /// + /// The target frame rate for the integration test. + /// This value is used to set the frame rate for the test environment. + /// protected int m_TargetFrameRate = 60; private NetworkManagerInstatiationMode m_NetworkManagerInstatiationMode; + /// + /// Indicates whether verbose debug logging is enabled. + /// If true, detailed debug information will be logged during the integration test. + /// protected bool m_EnableVerboseDebug { get; set; } /// @@ -221,7 +305,7 @@ public enum HostOrServer /// stages and can be used to log verbose information /// for troubleshooting an integration test. /// - /// + /// The message to log. [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void VerboseDebug(string msg) { @@ -236,6 +320,7 @@ protected void VerboseDebug(string msg) /// to troubleshoot a hard to track bug within an /// integration test. /// + /// True if verbose debug logging should be enabled; otherwise, false. protected virtual bool OnSetVerboseDebug() { return false; @@ -248,15 +333,23 @@ protected virtual bool OnSetVerboseDebug() /// Override this method to change the default mode: /// /// + /// The NetworkManager instantiation mode to be used for the integration test. protected virtual NetworkManagerInstatiationMode OnSetIntegrationTestMode() { return NetworkManagerInstatiationMode.PerTest; } + /// + /// Override this method to perform any setup that needs to be done once before any tests are run. + /// This method is called during the process. + /// protected virtual void OnOneTimeSetup() { } + /// + /// Called once before any tests are run to perform setup operations. + /// [OneTimeSetUp] public void OneTimeSetup() { @@ -284,6 +377,7 @@ public void OneTimeSetup() /// s then override . /// and /// + /// An IEnumerator for use with Unity's coroutine system. protected virtual IEnumerator OnSetup() { yield return null; @@ -301,6 +395,10 @@ protected virtual void OnInlineSetup() { } + /// + /// Called before each test is run to perform setup operations. + /// + /// An IEnumerator for use with Unity's coroutine system. [UnitySetUp] public IEnumerator SetUp() { @@ -419,9 +517,11 @@ private void AddRemoveNetworkManager(NetworkManager networkManager, bool addNetw } /// - /// CreateAndStartNewClient Only - /// Invoked when the newly created client has been created + /// Invoked when a new client has been created during the integration test. + /// Override this method to perform any setup or configuration needed for the new client + /// before it is started. /// + /// The NetworkManager instance of the client. protected virtual void OnNewClientCreated(NetworkManager networkManager) { } @@ -430,6 +530,7 @@ protected virtual void OnNewClientCreated(NetworkManager networkManager) /// CreateAndStartNewClient Only /// Invoked when the newly created client has been created and started /// + /// The NetworkManager instance of the client. protected virtual void OnNewClientStarted(NetworkManager networkManager) { } @@ -439,6 +540,7 @@ protected virtual void OnNewClientStarted(NetworkManager networkManager) /// Invoked when the newly created client has been created, started, and connected /// to the server-host. /// + /// The NetworkManager instance of the client. protected virtual void OnNewClientStartedAndConnected(NetworkManager networkManager) { } @@ -450,6 +552,8 @@ protected virtual void OnNewClientStartedAndConnected(NetworkManager networkMana /// /// Use this for testing connection and disconnection scenarios /// + /// The NetworkManager instance of the client. + /// True if the test should wait for the new client to connect; otherwise, false. protected virtual bool ShouldWaitForNewClientToConnect(NetworkManager networkManager) { return true; @@ -459,6 +563,7 @@ protected virtual bool ShouldWaitForNewClientToConnect(NetworkManager networkMan /// This will create, start, and connect a new client while in the middle of an /// integration test. /// + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator CreateAndStartNewClient() { var networkManager = NetcodeIntegrationTestHelpers.CreateNewClient(m_ClientNetworkManagers.Length, m_EnableTimeTravel); @@ -539,6 +644,9 @@ protected void CreateAndStartNewClientWithTimeTravel() /// /// This will stop a client while in the middle of an integration test /// + /// The NetworkManager instance of the client to stop. + /// If true, the client's NetworkManager GameObject will be destroyed. + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator StopOneClient(NetworkManager networkManager, bool destroy = false) { NetcodeIntegrationTestHelpers.StopOneClient(networkManager, destroy); @@ -549,6 +657,8 @@ protected IEnumerator StopOneClient(NetworkManager networkManager, bool destroy /// /// This will stop a client while in the middle of an integration test /// + /// The NetworkManager instance of the client to stop. + /// If true, the client's NetworkManager GameObject will be destroyed. protected void StopOneClientWithTimeTravel(NetworkManager networkManager, bool destroy = false) { NetcodeIntegrationTestHelpers.StopOneClient(networkManager, destroy); @@ -556,6 +666,10 @@ protected void StopOneClientWithTimeTravel(NetworkManager networkManager, bool d Assert.True(WaitForConditionOrTimeOutWithTimeTravel(() => !networkManager.IsConnectedClient)); } + /// + /// Sets the simulated network latency for time travel. + /// + /// The amount of latency to simulate in seconds. protected void SetTimeTravelSimulatedLatency(float latencySeconds) { ((MockTransport)m_ServerNetworkManager.NetworkConfig.NetworkTransport).SimulatedLatencySeconds = latencySeconds; @@ -565,6 +679,10 @@ protected void SetTimeTravelSimulatedLatency(float latencySeconds) } } + /// + /// Sets the simulated packet drop rate for time travel. + /// + /// The percentage of packets to drop (0 to 100). protected void SetTimeTravelSimulatedDropRate(float dropRatePercent) { ((MockTransport)m_ServerNetworkManager.NetworkConfig.NetworkTransport).PacketDropRate = dropRatePercent; @@ -574,6 +692,10 @@ protected void SetTimeTravelSimulatedDropRate(float dropRatePercent) } } + /// + /// Sets the simulated network latency jitter for time travel. + /// + /// The amount of jitter to simulate in seconds. protected void SetTimeTravelSimulatedLatencyJitter(float jitterSeconds) { ((MockTransport)m_ServerNetworkManager.NetworkConfig.NetworkTransport).LatencyJitter = jitterSeconds; @@ -586,7 +708,7 @@ protected void SetTimeTravelSimulatedLatencyJitter(float jitterSeconds) /// /// Creates the server and clients /// - /// + /// The number of clients to create. protected void CreateServerAndClients(int numberOfClients) { VerboseDebug($"Entering {nameof(CreateServerAndClients)}"); @@ -632,6 +754,7 @@ protected void CreateServerAndClients(int numberOfClients) /// Override this method and return false in order to be able /// to manually control when the server and clients are started. /// + /// True if the server and clients can be started automatically; otherwise, false. protected virtual bool CanStartServerAndClients() { return true; @@ -641,6 +764,7 @@ protected virtual bool CanStartServerAndClients() /// Invoked after the server and clients have started. /// Note: No connection verification has been done at this point /// + /// An IEnumerator for use with Unity's coroutine system. protected virtual IEnumerator OnStartedServerAndClients() { yield return null; @@ -658,6 +782,7 @@ protected virtual void OnTimeTravelStartedServerAndClients() /// Invoked after the server and clients have started and verified /// their connections with each other. /// + /// An IEnumerator for use with Unity's coroutine system. protected virtual IEnumerator OnServerAndClientsConnected() { yield return null; @@ -719,6 +844,11 @@ private void ClientNetworkManagerPostStart(NetworkManager networkManager) } } + /// + /// Initializes the client network managers after they have been started. + /// This method creates a dictionary for all player instances relative to each client and server. + /// It provides a simpler way to get a specific player instance relative to a client instance. + /// protected void ClientNetworkManagerPostStartInit() { // Creates a dictionary for all player instances client and server relative @@ -751,8 +881,17 @@ protected void ClientNetworkManagerPostStartInit() } } + /// + /// Indicates whether all network messages should be logged during the integration test. + /// If true, detailed information about all sent and received network messages will be logged. + /// protected virtual bool LogAllMessages => false; + /// + /// Determines whether the test should check for spawned player objects after the server and clients have started and connected. + /// Override this method to control whether player objects should be checked for existence after the server and clients are connected. + /// + /// True if the test should check for spawned player objects; otherwise, false. protected virtual bool ShouldCheckForSpawnedPlayers() { return true; @@ -762,6 +901,7 @@ protected virtual bool ShouldCheckForSpawnedPlayers() /// This starts the server and clients as long as /// returns true. /// + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator StartServerAndClients() { if (CanStartServerAndClients()) @@ -777,7 +917,7 @@ protected IEnumerator StartServerAndClients() } // When scene management is enabled, we need to re-apply the scenes populated list since we have overriden the ISceneManagerHandler - // imeplementation at this point. This assures any pre-loaded scenes will be automatically assigned to the server and force clients + // imeplementation at this point. This assures any pre-loaded scenes will be automatically assigned to the server and force clients // to load their own scenes. if (m_ServerNetworkManager.NetworkConfig.EnableSceneManagement) { @@ -918,6 +1058,7 @@ protected void StartServerAndClientsWithTimeTravel() /// Override this method to control when clients /// can fake-load a scene. /// + /// True if clients are allowed to load a scene; otherwise, false. protected virtual bool CanClientsLoad() { return true; @@ -927,6 +1068,7 @@ protected virtual bool CanClientsLoad() /// Override this method to control when clients /// can fake-unload a scene. /// + /// True if clients are allowed to unload a scene; otherwise, false. protected virtual bool CanClientsUnload() { return true; @@ -964,6 +1106,12 @@ private bool ClientSceneHandler_CanClientsLoad() return CanClientsLoad(); } + /// + /// Determines whether a scene can be unloaded during the cleanup process. + /// Override this method to specify custom logic for deciding if a scene should be unloaded. + /// + /// The scene to check. + /// True if the scene can be unloaded; otherwise, false. protected bool OnCanSceneCleanUpUnload(Scene scene) { return true; @@ -1015,15 +1163,24 @@ protected void ShutdownAndCleanUp() /// Note: For mode /// this is called before ShutdownAndCleanUp. /// + /// An IEnumerator for use with Unity's coroutine system. protected virtual IEnumerator OnTearDown() { yield return null; } + /// + /// Called during the tear down process if is set to false. + /// Override this method to perform any tear down operations that do not require a coroutine. + /// protected virtual void OnInlineTearDown() { } + /// + /// Called during the tear down process after each test is run to perform cleanup operations. + /// + /// An IEnumerator for use with Unity's coroutine system. [UnityTearDown] public IEnumerator TearDown() { @@ -1074,6 +1231,9 @@ protected virtual void OnOneTimeTearDown() { } + /// + /// Called once after all tests have run to perform cleanup operations. + /// [OneTimeTearDown] public void OneTimeTearDown() { @@ -1103,6 +1263,7 @@ public void OneTimeTearDown() /// /// /// the network object in question to be destroyed + /// True if the NetworkObject can be destroyed; otherwise, false. protected virtual bool CanDestroyNetworkObject(NetworkObject networkObject) { return true; @@ -1165,6 +1326,10 @@ protected void EnableMessageLogging() /// Note: For more complex tests, and the overloaded /// version of this method /// + /// A function that checks for the condition to be met. + /// An optional TimeoutHelper instance to manage the timeout. If null, the global timeout helper is used. + /// An IEnumerator for use with Unity's coroutine system. + /// Thrown if the checkForCondition function is null. public static IEnumerator WaitForConditionOrTimeOut(Func checkForCondition, TimeoutHelper timeOutHelper = null) { if (checkForCondition == null) @@ -1201,6 +1366,11 @@ public static IEnumerator WaitForConditionOrTimeOut(Func checkForCondition /// Waits for the function condition to return true or it will time out. Uses time travel to simulate this /// for the given number of frames, simulating delta times at the application frame rate. /// + /// A function that checks for the condition to be met. + /// The maximum number of frames to simulate while waiting for the condition to be met. Default is 60. + /// True if the condition is met within the specified number of frames; otherwise, false. + /// Thrown if the checkForCondition function is null. + /// Thrown if time travel is not enabled. public bool WaitForConditionOrTimeOutWithTimeTravel(Func checkForCondition, int maxTries = 60) { if (checkForCondition == null) @@ -1235,9 +1405,13 @@ public bool WaitForConditionOrTimeOutWithTimeTravel(Func checkForCondition } /// - /// This version accepts an IConditionalPredicate implementation to provide + /// This version accepts an implementation to provide /// more flexibility for checking complex conditional cases. /// + /// An implementation of that checks for the condition to be met. + /// An optional TimeoutHelper instance to manage the timeout. If null, the global timeout helper is used. + /// An IEnumerator for use with Unity's coroutine system. + /// Thrown if the conditionalPredicate is null. public static IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate conditionalPredicate, TimeoutHelper timeOutHelper = null) { if (conditionalPredicate == null) @@ -1257,10 +1431,15 @@ public static IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate condit } /// - /// This version accepts an IConditionalPredicate implementation to provide + /// This version accepts an implementation to provide /// more flexibility for checking complex conditional cases. Uses time travel to simulate this /// for the given number of frames, simulating delta times at the application frame rate. /// + /// An implementation of that checks for the condition to be met. + /// The maximum number of frames to simulate while waiting for the condition to be met. Default is 60. + /// True if the condition is met within the specified number of frames; otherwise, false. + /// Thrown if the checkForCondition function is null. + /// Thrown if time travel is not enabled. public bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate conditionalPredicate, int maxTries = 60) { if (conditionalPredicate == null) @@ -1285,6 +1464,7 @@ public bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate condit /// have connected or it will time out. /// /// An array of clients to be checked + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator WaitForClientsConnectedOrTimeOut(NetworkManager[] clientsToCheck) { var remoteClientCount = clientsToCheck.Length; @@ -1301,6 +1481,7 @@ protected IEnumerator WaitForClientsConnectedOrTimeOut(NetworkManager[] clientsT /// for the given number of frames, simulating delta times at the application frame rate. /// /// An array of clients to be checked + /// True if all clients are connected within the specified number of frames; otherwise, false. protected bool WaitForClientsConnectedOrTimeOutWithTimeTravel(NetworkManager[] clientsToCheck) { var remoteClientCount = clientsToCheck.Length; @@ -1309,11 +1490,11 @@ protected bool WaitForClientsConnectedOrTimeOutWithTimeTravel(NetworkManager[] c return WaitForConditionOrTimeOutWithTimeTravel(() => clientsToCheck.Where((c) => c.IsConnectedClient).Count() == remoteClientCount && m_ServerNetworkManager.ConnectedClients.Count == serverClientCount); } - /// /// Overloaded method that just passes in all clients to /// /// + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator WaitForClientsConnectedOrTimeOut() { yield return WaitForClientsConnectedOrTimeOut(m_ClientNetworkManagers); @@ -1324,6 +1505,7 @@ protected IEnumerator WaitForClientsConnectedOrTimeOut() /// Uses time travel to simulate this /// for the given number of frames, simulating delta times at the application frame rate. /// + /// True if all clients are connected within the specified number of frames; otherwise, false. protected bool WaitForClientsConnectedOrTimeOutWithTimeTravel() { return WaitForClientsConnectedOrTimeOutWithTimeTravel(m_ClientNetworkManagers); @@ -1420,8 +1602,12 @@ protected GameObject CreateNetworkObjectPrefab(string baseName) } /// - /// Overloaded method + /// Spawns a GameObject prefab instance. /// + /// The prefab GameObject to spawn. + /// the owner of the instance + /// If true, the spawned object will be destroyed when the scene is unloaded. Default is false. + /// GameObject instance spawned protected GameObject SpawnObject(GameObject prefabGameObject, NetworkManager owner, bool destroyWithScene = false) { var prefabNetworkObject = prefabGameObject.GetComponent(); @@ -1462,8 +1648,14 @@ private GameObject SpawnObject(NetworkObject prefabNetworkObject, NetworkManager } /// - /// Overloaded method + /// Will spawn (x) number of prefab GameObject + /// /// + /// the prefab GameObject to spawn + /// the owner of the instance + /// number of instances to create and spawn + /// If true, the spawned objects will be destroyed when the scene is unloaded. Default is false. + /// A list containing the spawned GameObject instances. protected List SpawnObjects(GameObject prefabGameObject, NetworkManager owner, int count, bool destroyWithScene = false) { var prefabNetworkObject = prefabGameObject.GetComponent(); @@ -1472,13 +1664,14 @@ protected List SpawnObjects(GameObject prefabGameObject, NetworkMana } /// - /// Will spawn (x) number of prefab NetworkObjects + /// Will spawn (x) number of prefab NetworkObject /// /// /// the prefab NetworkObject to spawn /// the owner of the instance /// number of instances to create and spawn - /// default is false + /// If true, the spawned objects will be destroyed when the scene is unloaded. Default is false. + /// A list containing the spawned GameObject instances. private List SpawnObjects(NetworkObject prefabNetworkObject, NetworkManager owner, int count, bool destroyWithScene = false) { var gameObjectsSpawned = new List(); @@ -1498,21 +1691,22 @@ public NetcodeIntegrationTest() } /// - /// Optional Host or Server integration tests - /// Constructor that allows you To break tests up as a host - /// and a server. - /// Example: Decorate your child derived class with TestFixture - /// and then create a constructor at the child level. - /// Don't forget to set your constructor public, else Unity will - /// give you a hard to decipher error + /// Constructor that allows specifying whether the test should run as a host or server. + /// This can be used to break tests up as a host and a server. + /// + /// + /// Decorate your child derived class with TestFixture and then create a constructor at the child level. + /// Don't forget to set your constructor public, else Unity will give you a hard to decipher error. + /// /// [TestFixture(HostOrServer.Host)] /// [TestFixture(HostOrServer.Server)] /// public class MyChildClass : NetcodeIntegrationTest /// { /// public MyChildClass(HostOrServer hostOrServer) : base(hostOrServer) { } /// } - /// - /// + /// + /// + /// Specifies whether the test should run as a host or server. public NetcodeIntegrationTest(HostOrServer hostOrServer) { m_UseHost = hostOrServer == HostOrServer.Host ? true : false; @@ -1522,6 +1716,8 @@ public NetcodeIntegrationTest(HostOrServer hostOrServer) /// Just a helper function to avoid having to write the entire assert just to check if you /// timed out. /// + /// The error message to display if a timeout has occurred. + /// An optional TimeoutHelper instance to check for a timeout. If null, the global timeout helper is used. protected void AssertOnTimeout(string timeOutErrorMessage, TimeoutHelper assignedTimeoutHelper = null) { var timeoutHelper = assignedTimeoutHelper ?? s_GlobalTimeoutHelper; @@ -1592,6 +1788,9 @@ private IEnumerator WaitForTickAndFrames(NetworkManager networkManager, int tick /// /// Yields until specified amount of network ticks and the expected number of frames has been passed. /// + /// The NetworkManager instance to wait for ticks on. + /// The number of network ticks to wait for. + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator WaitForTicks(NetworkManager networkManager, int count) { var targetTick = networkManager.NetworkTickSystem.LocalTime.Tick + count; @@ -1613,8 +1812,8 @@ protected IEnumerator WaitForTicks(NetworkManager networkManager, int count) /// This will only simulate the netcode update loop, as well as update events on /// NetworkBehaviour instances, and will not simulate any Unity update processes (physics, etc) /// - /// - /// + /// The total amount of time to simulate in seconds. + /// The number of frames to simulate. If less than 0, it will be calculated based on the target frame rate. protected static void TimeTravel(double amountOfTimeInSeconds, int numFramesToSimulate = -1) { if (numFramesToSimulate < 0) @@ -1634,11 +1833,20 @@ protected static void TimeTravel(double amountOfTimeInSeconds, int numFramesToSi } } + /// + /// Gets the tick rate for the integration test. + /// Override this method to specify a custom tick rate for the test. + /// + /// The tick rate to be used for the integration test. protected virtual uint GetTickRate() { return k_DefaultTickRate; } + /// + /// Gets the frame rate for the integration test. + /// + /// The frame rate to be used for the integration test. protected virtual int GetFrameRate() { return Application.targetFrameRate == 0 ? 60 : Application.targetFrameRate; diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs index 2e6279999c..992dbb2293 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs @@ -28,7 +28,7 @@ public void Setup() /// /// Tests whether time is accessible and has correct values inside Update/FixedUpdate. - /// This test applies only when is 1. + /// This test applies only when is 1. /// /// An IEnumerator for the UnityTest coroutine that validates time values in the player loop. [UnityTest] diff --git a/pvpExceptions.json b/pvpExceptions.json index b3aaff683e..f4eaca7c3f 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -12,104 +12,14 @@ }, "PVP-150-1": { "errors": [ - "Unity.Netcode.Components.NetworkTransform: void OnSynchronize(ref BufferSerializer): empty tag", - "Unity.Netcode.Components.NetworkTransform: void OnSynchronize(ref BufferSerializer): empty tag", - "Unity.Netcode.Components.NetworkTransform: void OnSynchronize(ref BufferSerializer): unexpected ", - "Unity.Netcode.Components.NetworkTransform: void OnInitialize(ref NetworkVariable): empty tag", - "Unity.Netcode.Components.NetworkTransform: void SetState(Vector3?, Quaternion?, Vector3?, bool): empty tag", - "Unity.Netcode.Components.NetworkTransform: void SetState(Vector3?, Quaternion?, Vector3?, bool): empty tag", - "Unity.Netcode.Components.NetworkTransform: void SetState(Vector3?, Quaternion?, Vector3?, bool): text or XML content outside a top-level tag", - "Unity.Netcode.Components.NetworkTransform: void Update(): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.Components.NetworkTransform: void Teleport(Vector3, Quaternion, Vector3): empty tag", - "Unity.Netcode.Components.NetworkTransform: void Teleport(Vector3, Quaternion, Vector3): empty tag", - "Unity.Netcode.Components.NetworkTransform: void Teleport(Vector3, Quaternion, Vector3): text or XML content outside a top-level tag", - "Unity.Netcode.NetworkBehaviour: NetworkObject: text or XML content outside a top-level tag", - "Unity.Netcode.NetworkBehaviour: void OnNetworkPreSpawn(ref NetworkManager): in block context (only allowed in top-level context)", - "Unity.Netcode.NetworkBehaviour: void OnInSceneObjectsSpawned(): XML is not well-formed: Whitespace is not allowed at this location", - "Unity.Netcode.NetworkBehaviour: NetworkObject GetNetworkObject(ulong): empty tag", - "Unity.Netcode.NetworkBehaviour: NetworkObject GetNetworkObject(ulong): empty tag", - "Unity.Netcode.NetworkBehaviour: void OnSynchronize(ref BufferSerializer): unexpected ", - "Unity.Netcode.NetworkList: .ctor(IEnumerable, NetworkVariableReadPermission, NetworkVariableWritePermission): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: .ctor(IEnumerable, NetworkVariableReadPermission, NetworkVariableWritePermission): empty tag", - "Unity.Netcode.NetworkList: IEnumerator GetEnumerator(): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: void Add(T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: void Clear(): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: bool Contains(T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: bool Remove(T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: Count: cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: int IndexOf(T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: void Insert(int, T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: void RemoveAt(int): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: this[int]: cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.UserNetworkVariableSerialization: empty tag", - "Unity.Netcode.UserNetworkVariableSerialization.DuplicateValueDelegate: unexpected ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedByMemcpy(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedByMemcpyArray(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_List(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_HashSet(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): unexpected ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedINetworkSerializable(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedINetworkSerializableArray(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_ManagedINetworkSerializable(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_FixedString(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_FixedStringArray(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeEqualityChecker_Dictionary(): XML is not well-formed: End tag 'typeparam' does not match the start tag 'TKey'", - "Unity.Netcode.NetworkObjectReference: .ctor(NetworkObject): empty tag", - "Unity.Netcode.NetworkObjectReference: .ctor(GameObject): empty tag", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void VerboseDebug(string): empty tag", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void CreateServerAndClients(int): empty tag", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: .ctor(HostOrServer): empty tag", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void TimeTravel(double, int): empty tag", "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: bool Start(bool, NetworkManager, NetworkManager[], BeforeClientStartCallback): empty tag", "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: IEnumerator WaitForClientsConnected(NetworkManager[], ResultWrapper, float): XML is not well-formed: An identifier was expected", "Unity.Netcode.RuntimeTests.BufferDataValidationComponent: bool IsTestComplete(): empty tag", - "Unity.Netcode.RuntimeTests.NetworkVariableBaseInitializesWhenPersisted.PrefabInstanceHandler: bool ValidateInstanceSpawnCount(int): XML is not well-formed: Expected an end tag for element 'summary'", - "Unity.Netcode.RuntimeTests.NetworkTimeSystemTests: IEnumerator PlayerLoopFixedTimeTest(): XML is not well-formed: End tag 'summary' does not match the start tag 'see'" + "Unity.Netcode.RuntimeTests.NetworkVariableBaseInitializesWhenPersisted.PrefabInstanceHandler: bool ValidateInstanceSpawnCount(int): XML is not well-formed: Expected an end tag for element 'summary'" ] }, "PVP-151-1": { "errors": [ - "Unity.Netcode.Components.AnticipatedNetworkTransform: void Update(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnSynchronize(ref BufferSerializer): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnNetworkSpawn(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnNetworkDespawn(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnDestroy(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnBeforeUpdateTransformState(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnNetworkTransformStateUpdated(ref NetworkTransformState, ref NetworkTransformState): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnTransformUpdated(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform.TransformState: undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform.TransformState: Position: undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform.TransformState: Rotation: undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform.TransformState: Scale: undocumented", - "Unity.Netcode.Components.HalfVector3: XML is not well-formed: End tag 'remarks' does not match the start tag 'ushort'", - "Unity.Netcode.Components.HalfVector3: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.HalfVector3: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.HalfVector4: XML is not well-formed: End tag 'remarks' does not match the start tag 'ushort'", - "Unity.Netcode.Components.HalfVector4: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.HalfVector4: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.NetworkDeltaPosition: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.NetworkDeltaPosition: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.NetworkDeltaPosition: Vector3 GetConvertedDelta(): missing ", - "Unity.Netcode.Components.NetworkDeltaPosition: Vector3 GetDeltaPosition(): missing ", - "Unity.Netcode.Components.NetworkTransform: void OnTransformUpdated(): undocumented", - "Unity.Netcode.Components.NetworkTransform: void OnBeforeUpdateTransformState(): undocumented", - "Unity.Netcode.Components.NetworkTransform: void OnOwnershipChanged(ulong, ulong): undocumented", - "Unity.Netcode.Components.NetworkTransform: void Update(): missing ", - "Unity.Netcode.Components.NetworkTransform.NetworkTransformState: bool IsUnreliableFrameSync(): missing ", - "Unity.Netcode.Components.NetworkTransform.NetworkTransformState: bool IsReliableStateUpdate(): missing ", - "Unity.Netcode.Components.NetworkTransform.NetworkTransformState: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.NetworkTransform.NetworkTransformState: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Editor.AnticipatedNetworkTransformEditor: HideInterpolateValue: undocumented", - "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: undocumented", - "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: NetworkPrefabsPath: undocumented", - "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: TempNetworkPrefabsPath: undocumented", - "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: GenerateDefaultNetworkPrefabs: undocumented", - "Unity.Netcode.Editor.Configuration.NetworkPrefabProcessor: DefaultNetworkPrefabsPath: undocumented", - "Unity.Netcode.Editor.NetworkPrefabsEditor: undocumented", - "Unity.Netcode.Editor.NetworkPrefabsEditor: void OnInspectorGUI(): undocumented", - "Unity.Netcode.Editor.NetworkTransformEditor: HideInterpolateValue: undocumented", - "Unity.Netcode.Editor.NetworkTransformEditor: void OnEnable(): missing ", "Unity.Netcode.NetworkConfig: Prefabs: undocumented", "Unity.Netcode.NetworkPrefab: bool Equals(NetworkPrefab): undocumented", "Unity.Netcode.NetworkPrefab: SourcePrefabGlobalObjectIdHash: undocumented", @@ -126,9 +36,6 @@ "Unity.Netcode.ConnectionEventData: EventType: undocumented", "Unity.Netcode.RpcException: undocumented", "Unity.Netcode.RpcException: .ctor(string): undocumented", - "Unity.Netcode.NetworkBehaviour: void OnNetworkPreSpawn(ref NetworkManager): missing ", - "Unity.Netcode.NetworkBehaviour: void OnInSceneObjectsSpawned(): XML is not well-formed: Whitespace is not allowed at this location", - "Unity.Netcode.NetworkBehaviour: void OnReanticipate(double): undocumented", "Unity.Netcode.NetworkManager: void NetworkUpdate(NetworkUpdateStage): undocumented", "Unity.Netcode.NetworkManager.ReanticipateDelegate: undocumented", "Unity.Netcode.NetworkObject: NetworkBehaviour GetNetworkBehaviourAtOrderIndex(ushort): undocumented", @@ -182,30 +89,7 @@ "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", - "Unity.Netcode.NetworkList: .ctor(IEnumerable, NetworkVariableReadPermission, NetworkVariableWritePermission): missing ", "Unity.Netcode.NetworkList: void Finalize(): undocumented", - "Unity.Netcode.NetworkList: IEnumerator GetEnumerator(): missing ", - "Unity.Netcode.NetworkList: IEnumerator GetEnumerator(): missing ", - "Unity.Netcode.NetworkList: void Add(T): missing ", - "Unity.Netcode.NetworkList: void Add(T): missing ", - "Unity.Netcode.NetworkList: void Clear(): missing ", - "Unity.Netcode.NetworkList: bool Contains(T): missing ", - "Unity.Netcode.NetworkList: bool Contains(T): missing ", - "Unity.Netcode.NetworkList: bool Contains(T): missing ", - "Unity.Netcode.NetworkList: bool Remove(T): missing ", - "Unity.Netcode.NetworkList: bool Remove(T): missing ", - "Unity.Netcode.NetworkList: bool Remove(T): missing ", - "Unity.Netcode.NetworkList: Count: missing ", - "Unity.Netcode.NetworkList: int IndexOf(T): missing ", - "Unity.Netcode.NetworkList: int IndexOf(T): missing ", - "Unity.Netcode.NetworkList: int IndexOf(T): missing ", - "Unity.Netcode.NetworkList: void Insert(int, T): missing ", - "Unity.Netcode.NetworkList: void Insert(int, T): missing ", - "Unity.Netcode.NetworkList: void Insert(int, T): missing ", - "Unity.Netcode.NetworkList: void RemoveAt(int): missing ", - "Unity.Netcode.NetworkList: void RemoveAt(int): missing ", - "Unity.Netcode.NetworkList: this[int]: missing ", - "Unity.Netcode.NetworkList: this[int]: missing ", "Unity.Netcode.NetworkVariable: CheckExceedsDirtinessThreshold: undocumented", "Unity.Netcode.NetworkVariable: bool ExceedsDirtinessThreshold(): undocumented", "Unity.Netcode.NetworkVariable: void OnInitialize(): undocumented", @@ -218,16 +102,6 @@ "Unity.Netcode.NetworkVariableUpdateTraits: MaxSecondsBetweenUpdates: undocumented", "Unity.Netcode.NetworkVariableBase: NetworkBehaviour GetBehaviour(): undocumented", "Unity.Netcode.NetworkVariableBase: void MarkNetworkBehaviourDirty(): undocumented", - "Unity.Netcode.UserNetworkVariableSerialization.WriteDeltaDelegate: missing ", - "Unity.Netcode.UserNetworkVariableSerialization.DuplicateValueDelegate: missing ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): missing ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): missing ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeEqualityChecker_Dictionary(): missing ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeEqualityChecker_Dictionary(): missing ", - "Unity.Netcode.NetworkVariableSerialization: void WriteDelta(FastBufferWriter, ref T, ref T): missing ", - "Unity.Netcode.NetworkVariableSerialization.EqualsDelegate: missing ", - "Unity.Netcode.NetworkVariableSerialization.EqualsDelegate: missing ", - "Unity.Netcode.NetworkVariableSerialization.EqualsDelegate: missing ", "Unity.Netcode.NetworkSceneManager: void SetClientSynchronizationMode(LoadSceneMode): XML is not well-formed: Expected an end tag for element 'summary'", "Unity.Netcode.NetworkTransport.TransportEventDelegate: missing ", "Unity.Netcode.NetworkTransport.TransportEventDelegate: missing ", @@ -294,95 +168,6 @@ "Unity.Netcode.TestHelpers.Runtime.MockTimeProvider: StaticDeltaTime: undocumented", "Unity.Netcode.TestHelpers.Runtime.MockTimeProvider: void TimeTravel(double): undocumented", "Unity.Netcode.TestHelpers.Runtime.MockTimeProvider: void Reset(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: s_GlobalTimeoutHelper: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: s_DefaultWaitForTick: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: NetcodeLogAssert: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void RegisterNetworkObject(NetworkObject): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void DeregisterNetworkObject(NetworkObject): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void DeregisterNetworkObject(ulong, ulong): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: TotalClients: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: k_DefaultTickRate: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: NumberOfClients: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_PlayerPrefab: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_ServerNetworkManager: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_ClientNetworkManagers: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_UseHost: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_TargetFrameRate: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_EnableVerboseDebug: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool OnSetVerboseDebug(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: NetworkManagerInstatiationMode OnSetIntegrationTestMode(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnOneTimeSetup(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OneTimeSetup(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator OnSetup(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator SetUp(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnNewClientCreated(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnNewClientStarted(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnNewClientStartedAndConnected(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool ShouldWaitForNewClientToConnect(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool ShouldWaitForNewClientToConnect(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator CreateAndStartNewClient(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator StopOneClient(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator StopOneClient(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator StopOneClient(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void StopOneClientWithTimeTravel(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void StopOneClientWithTimeTravel(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void SetTimeTravelSimulatedLatency(float): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void SetTimeTravelSimulatedDropRate(float): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void SetTimeTravelSimulatedLatencyJitter(float): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool CanStartServerAndClients(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator OnStartedServerAndClients(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator OnServerAndClientsConnected(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void ClientNetworkManagerPostStartInit(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: LogAllMessages: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool ShouldCheckForSpawnedPlayers(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator StartServerAndClients(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool CanClientsLoad(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool CanClientsUnload(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool OnCanSceneCleanUpUnload(Scene): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator OnTearDown(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnInlineTearDown(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator TearDown(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OneTimeTearDown(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool CanDestroyNetworkObject(NetworkObject): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(Func, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(Func, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(Func, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(Func, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(Func, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(Func, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForClientsConnectedOrTimeOut(NetworkManager[]): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForClientsConnectedOrTimeOutWithTimeTravel(NetworkManager[]): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForClientsConnectedOrTimeOut(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForClientsConnectedOrTimeOutWithTimeTravel(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: GameObject SpawnObject(GameObject, NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: GameObject SpawnObject(GameObject, NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: GameObject SpawnObject(GameObject, NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: GameObject SpawnObject(GameObject, NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void AssertOnTimeout(string, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void AssertOnTimeout(string, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForTicks(NetworkManager, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForTicks(NetworkManager, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForTicks(NetworkManager, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: uint GetTickRate(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: int GetFrameRate(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.NetworkManagerInstatiationMode: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.NetworkManagerInstatiationMode: PerTest: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.NetworkManagerInstatiationMode: AllTests: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.NetworkManagerInstatiationMode: DoNotCreate: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.HostOrServer: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.HostOrServer: Host: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.HostOrServer: Server: undocumented", "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: DefaultMinFrames: undocumented", "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: DefaultTimeout: undocumented", "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: NetworkManagerInstances: undocumented", @@ -2955,7 +2740,6 @@ "Unity.Netcode.RuntimeTests.UniversalRpcTests.UniversalRpcTestsBase: void VerifySentToMeWithParams(ulong, ulong, string, int, bool, float, string): undocumented", "Unity.Netcode.RuntimeTests.UniversalRpcTests.UniversalRpcTestsBase: void VerifySentToNotMeWithParams(ulong, ulong, string, int, bool, float, string): undocumented", "Unity.Netcode.RuntimeTests.UniversalRpcTests.UniversalRpcTestsBase: void RethrowTargetInvocationException(Action): undocumented", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeEqualityChecker_Dictionary(): XML is not well-formed: End tag 'typeparam' does not match the start tag 'TKey'", "Unity.Netcode.RuntimeTests.NetworkTransformPacketLossTests: void NetworkTransformMultipleChangesOverTime(TransformSpace, Axis): missing ", "Unity.Netcode.RuntimeTests.NetworkTransformPacketLossTests: void NetworkTransformMultipleChangesOverTime(TransformSpace, Axis): missing ", "Unity.Netcode.RuntimeTests.NetworkTransformTests: void NetworkTransformMultipleChangesOverTime(TransformSpace, OverrideState, Axis): missing ", From d0f73d4d29763253200395172b9ede8cf1988617 Mon Sep 17 00:00:00 2001 From: jonathanhertz <59826545+jonathanhertz@users.noreply.github.com> Date: Wed, 26 Mar 2025 14:10:36 +0100 Subject: [PATCH 05/23] fix: Add OnPreShutdown to NetworkManager (#3358) This PR adds a `NetworkManager.OnPreShutdown` callback that happens before the internal shutdown is done. This is to allow accessing any state that is cleaned up by the `NetworkManager` during shutdown, such as accessing dynamically spawned NetworkObjects. fix: #3145 close: #3145 ## Changelog - Added: The event NetworkManager.OnPreShutdown has been added which is called before the NetworkManager cleans up and shuts down. ## Testing and Documentation - A test has been added to ensure this is being called, and called before OnServerStopped. --------- Co-authored-by: Noel Stephens --- .../Runtime/Core/NetworkManager.cs | 8 ++++ .../Runtime/NetworkManagerEventsTests.cs | 40 +++++++++++++++++++ pvpExceptions.json | 1 + 3 files changed, 49 insertions(+) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs index 429259c9cb..0aec58612f 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs @@ -477,6 +477,12 @@ public struct ConnectionApprovalRequest /// public event Action OnClientStarted = null; + /// + /// Subscribe to this event to get notifications before a instance is being destroyed. + /// This is useful if you want to use the state of anything the NetworkManager cleans up during its shutdown. + /// + public event Action OnPreShutdown = null; + /// /// This callback is invoked once the local server is stopped. /// @@ -1198,6 +1204,8 @@ internal void ShutdownInternal() NetworkLog.LogInfo(nameof(ShutdownInternal)); } + OnPreShutdown?.Invoke(); + this.UnregisterAllNetworkUpdates(); // Everything is shutdown in the order of their dependencies diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkManagerEventsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkManagerEventsTests.cs index 34a406aed8..1b4d97df73 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkManagerEventsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkManagerEventsTests.cs @@ -237,6 +237,46 @@ public IEnumerator OnClientAndServerStartedCalledWhenHostStarts() Assert.AreEqual(2, callbacksInvoked, "either OnServerStarted or OnClientStarted wasn't invoked"); } + [UnityTest] + public IEnumerator OnPreShutdownCalledWhenShuttingDown() + { + bool preShutdownInvoked = false; + bool shutdownInvoked = false; + var gameObject = new GameObject(nameof(OnPreShutdownCalledWhenShuttingDown)); + m_ServerManager = gameObject.AddComponent(); + + // Set dummy transport that does nothing + var transport = gameObject.AddComponent(); + m_ServerManager.NetworkConfig = new NetworkConfig() { NetworkTransport = transport }; + + Action onPreShutdown = () => + { + preShutdownInvoked = true; + Assert.IsFalse(shutdownInvoked, "OnPreShutdown was invoked after OnServerStopped"); + }; + + Action onServerStopped = (bool wasAlsoClient) => + { + shutdownInvoked = true; + Assert.IsTrue(preShutdownInvoked, "OnPreShutdown wasn't invoked before OnServerStopped"); + }; + + // Start server to cause initialization process + Assert.True(m_ServerManager.StartServer()); + Assert.True(m_ServerManager.IsListening); + + m_ServerManager.OnPreShutdown += onPreShutdown; + m_ServerManager.OnServerStopped += onServerStopped; + m_ServerManager.Shutdown(); + Object.DestroyImmediate(gameObject); + + yield return WaitUntilManagerShutsdown(); + + Assert.False(m_ServerManager.IsListening); + Assert.True(preShutdownInvoked, "OnPreShutdown wasn't invoked"); + Assert.True(shutdownInvoked, "OnServerStopped wasn't invoked"); + } + private IEnumerator WaitUntilManagerShutsdown() { /* Need two updates to actually shut down. First one to see the transport failing, which diff --git a/pvpExceptions.json b/pvpExceptions.json index f4eaca7c3f..0a338d445a 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -928,6 +928,7 @@ "Unity.Netcode.RuntimeTests.NetworkManagerEventsTests: IEnumerator OnServerStartedCalledWhenServerStarts(): undocumented", "Unity.Netcode.RuntimeTests.NetworkManagerEventsTests: IEnumerator OnClientStartedCalledWhenClientStarts(): undocumented", "Unity.Netcode.RuntimeTests.NetworkManagerEventsTests: IEnumerator OnClientAndServerStartedCalledWhenHostStarts(): undocumented", + "Unity.Netcode.RuntimeTests.NetworkManagerEventsTests: IEnumerator OnPreShutdownCalledWhenShuttingDown(): undocumented", "Unity.Netcode.RuntimeTests.NetworkManagerEventsTests: IEnumerator Teardown(): undocumented", "Unity.Netcode.RuntimeTests.NetworkManagerSceneManagerTests: undocumented", "Unity.Netcode.RuntimeTests.NetworkManagerSceneManagerTests: void SceneManagerAssigned(): undocumented", From 02128fa64458c3b2c7f146045782e4eb6717812a Mon Sep 17 00:00:00 2001 From: Emma Date: Wed, 26 Mar 2025 14:42:16 -0400 Subject: [PATCH 06/23] fix: Sync transform position on spawn (#3361) [MTTB-90](https://jira.unity3d.com/browse/MTTB-90) [MTTB-1131](https://jira.unity3d.com/browse/MTTB-1131) ## Changelog - Fixed: Correctly sync network transform using world space on spawn ## Testing and Documentation - No tests have been added. --------- Co-authored-by: Noel Stephens --- com.unity.netcode.gameobjects/CHANGELOG.md | 1 + com.unity.netcode.gameobjects/Components/NetworkTransform.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 5cd33805fa..b661832368 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -14,6 +14,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Fixed +- Fixed initial `NetworkTransform` spawn, ensure it uses world space. (#3361) - Fixed issue where `AnticipatedNetworkVariable` previous value returned by `AnticipatedNetworkVariable.OnAuthoritativeValueChanged` is updated correctly on the non-authoritative side. (#3322) ### Changed diff --git a/com.unity.netcode.gameobjects/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Components/NetworkTransform.cs index 77a7f4293e..90faadae70 100644 --- a/com.unity.netcode.gameobjects/Components/NetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Components/NetworkTransform.cs @@ -2785,7 +2785,7 @@ public override void OnNetworkSpawn() Initialize(); - if (CanCommitToTransform && UseHalfFloatPrecision) + if (CanCommitToTransform) { SetState(GetSpaceRelativePosition(), GetSpaceRelativeRotation(), GetScale(), false); } From 3417c4765f52f72d2384f2f7e65bd9d2d1dfd7ac Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Fri, 28 Mar 2025 19:35:19 -0500 Subject: [PATCH 07/23] Add PR-3358 changelog entry Adding missing changelog entry for PR-3358. --- com.unity.netcode.gameobjects/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index b661832368..4ea3d7cb38 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -9,6 +9,8 @@ Additional documentation and release notes are available at [Multiplayer Documen ## [Unreleased] ### Added + +- Added `NetworkManager.OnPreShutdown` which is called before the NetworkManager cleans up and shuts down. (#3358) - Added `FastBufferReader(ArraySegment buffer, Allocator copyAllocator)` constructor that uses the `ArraySegment.Offset` as the `FastBufferReader` offset and the `ArraySegment.Count` as the `FastBufferReader` length. (#3320) - Added `FastBufferReader(ArraySegment buffer, Allocator copyAllocator, int length = -1)` constructor that uses the `ArraySegment.Offset` as the `FastBufferReader` offset. (#3320) From 36dd3acdd5a5fe19e5f8af624b93ba1397ccc568 Mon Sep 17 00:00:00 2001 From: "unity-renovate[bot]" <120015202+unity-renovate[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 13:29:55 +0200 Subject: [PATCH 08/23] chore(deps): update dependency recipeengine.modules.wrench to 0.10.45 (develop) (#3359) Wrench version update to 0.10.45 and recipes regeneration --- .yamato/wrench/api-validation-jobs.yml | 6 +- .yamato/wrench/package-pack-jobs.yml | 3 +- .yamato/wrench/preview-a-p-v.yml | 92 +++++++++++++------------- .yamato/wrench/promotion-jobs.yml | 72 ++++++++++++++++++-- .yamato/wrench/recipe-regeneration.yml | 2 +- .yamato/wrench/validation-jobs.yml | 90 ++++++++++++------------- .yamato/wrench/wrench_config.json | 2 +- Tools/CI/NGO.Cookbook.csproj | 2 +- 8 files changed, 164 insertions(+), 105 deletions(-) diff --git a/.yamato/wrench/api-validation-jobs.yml b/.yamato/wrench/api-validation-jobs.yml index 143e13805a..29fba54409 100644 --- a/.yamato/wrench/api-validation-jobs.yml +++ b/.yamato/wrench/api-validation-jobs.yml @@ -13,7 +13,7 @@ api_validation_-_netcode_gameobjects_-_2021_3_-_windows: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -51,8 +51,8 @@ api_validation_-_netcode_gameobjects_-_2021_3_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 diff --git a/.yamato/wrench/package-pack-jobs.yml b/.yamato/wrench/package-pack-jobs.yml index 43d968cc25..6413921ce7 100644 --- a/.yamato/wrench/package-pack-jobs.yml +++ b/.yamato/wrench/package-pack-jobs.yml @@ -24,6 +24,5 @@ package_pack_-_netcode_gameobjects: UPMCI_ACK_LARGE_PACKAGE: 1 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 - + Wrench: 0.10.45.0 diff --git a/.yamato/wrench/preview-a-p-v.yml b/.yamato/wrench/preview-a-p-v.yml index 1db74a8b51..c6f4e62b8d 100644 --- a/.yamato/wrench/preview-a-p-v.yml +++ b/.yamato/wrench/preview-a-p-v.yml @@ -22,7 +22,7 @@ all_preview_apv_jobs: - path: .yamato/wrench/preview-a-p-v.yml#preview_apv_-_6000_2_-_windows metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 2021.3 manifest (MacOS). preview_apv_-_2021_3_-_macos: @@ -32,7 +32,7 @@ preview_apv_-_2021_3_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -73,10 +73,10 @@ preview_apv_-_2021_3_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 2021.3 manifest (Ubuntu). preview_apv_-_2021_3_-_ubuntu: @@ -86,7 +86,7 @@ preview_apv_-_2021_3_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -127,10 +127,10 @@ preview_apv_-_2021_3_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 2021.3 manifest (Windows). preview_apv_-_2021_3_-_windows: @@ -141,7 +141,7 @@ preview_apv_-_2021_3_-_windows: flavor: b1.large commands: - command: gsudo reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -182,10 +182,10 @@ preview_apv_-_2021_3_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 2022.3 manifest (MacOS). preview_apv_-_2022_3_-_macos: @@ -195,7 +195,7 @@ preview_apv_-_2022_3_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -236,10 +236,10 @@ preview_apv_-_2022_3_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 2022.3 manifest (Ubuntu). preview_apv_-_2022_3_-_ubuntu: @@ -249,7 +249,7 @@ preview_apv_-_2022_3_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -290,10 +290,10 @@ preview_apv_-_2022_3_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 2022.3 manifest (Windows). preview_apv_-_2022_3_-_windows: @@ -304,7 +304,7 @@ preview_apv_-_2022_3_-_windows: flavor: b1.large commands: - command: gsudo reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -345,10 +345,10 @@ preview_apv_-_2022_3_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 6000.0 manifest (MacOS). preview_apv_-_6000_0_-_macos: @@ -358,7 +358,7 @@ preview_apv_-_6000_0_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -399,10 +399,10 @@ preview_apv_-_6000_0_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 6000.0 manifest (Ubuntu). preview_apv_-_6000_0_-_ubuntu: @@ -412,7 +412,7 @@ preview_apv_-_6000_0_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -453,10 +453,10 @@ preview_apv_-_6000_0_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 6000.0 manifest (Windows). preview_apv_-_6000_0_-_windows: @@ -467,7 +467,7 @@ preview_apv_-_6000_0_-_windows: flavor: b1.large commands: - command: gsudo reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -508,10 +508,10 @@ preview_apv_-_6000_0_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 6000.1 manifest (MacOS). preview_apv_-_6000_1_-_macos: @@ -521,7 +521,7 @@ preview_apv_-_6000_1_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -562,10 +562,10 @@ preview_apv_-_6000_1_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 6000.1 manifest (Ubuntu). preview_apv_-_6000_1_-_ubuntu: @@ -575,7 +575,7 @@ preview_apv_-_6000_1_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -616,10 +616,10 @@ preview_apv_-_6000_1_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 6000.1 manifest (Windows). preview_apv_-_6000_1_-_windows: @@ -630,7 +630,7 @@ preview_apv_-_6000_1_-_windows: flavor: b1.large commands: - command: gsudo reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -671,10 +671,10 @@ preview_apv_-_6000_1_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 6000.2 manifest (MacOS). preview_apv_-_6000_2_-_macos: @@ -684,7 +684,7 @@ preview_apv_-_6000_2_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -725,10 +725,10 @@ preview_apv_-_6000_2_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 6000.2 manifest (Ubuntu). preview_apv_-_6000_2_-_ubuntu: @@ -738,7 +738,7 @@ preview_apv_-_6000_2_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -779,10 +779,10 @@ preview_apv_-_6000_2_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Functional tests for dependents found in the latest 6000.2 manifest (Windows). preview_apv_-_6000_2_-_windows: @@ -793,7 +793,7 @@ preview_apv_-_6000_2_-_windows: flavor: b1.large commands: - command: gsudo reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -834,8 +834,8 @@ preview_apv_-_6000_2_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 diff --git a/.yamato/wrench/promotion-jobs.yml b/.yamato/wrench/promotion-jobs.yml index 7a5c110312..54bbbf81e1 100644 --- a/.yamato/wrench/promotion-jobs.yml +++ b/.yamato/wrench/promotion-jobs.yml @@ -9,7 +9,7 @@ publish_dry_run_netcode_gameobjects: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -34,6 +34,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2021.3-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2021_3_-_ubuntu specific_options: UTR: @@ -42,6 +44,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2021.3-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2021_3_-_windows specific_options: UTR: @@ -50,6 +54,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2021.3-windows unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2022_3_-_macos specific_options: UTR: @@ -58,6 +64,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2022.3-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2022_3_-_ubuntu specific_options: UTR: @@ -66,6 +74,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2022.3-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2022_3_-_windows specific_options: UTR: @@ -74,6 +84,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2022.3-windows unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_0_-_macos specific_options: UTR: @@ -82,6 +94,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.0-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_0_-_ubuntu specific_options: UTR: @@ -90,6 +104,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.0-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_0_-_windows specific_options: UTR: @@ -98,6 +114,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.0-windows unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_1_-_macos specific_options: UTR: @@ -106,6 +124,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.1-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_1_-_ubuntu specific_options: UTR: @@ -114,6 +134,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.1-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_1_-_windows specific_options: UTR: @@ -122,6 +144,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.1-windows unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_2_-_macos specific_options: UTR: @@ -130,6 +154,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.2-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_2_-_ubuntu specific_options: UTR: @@ -138,6 +164,8 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.2-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_2_-_windows specific_options: UTR: @@ -146,12 +174,14 @@ publish_dry_run_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.2-windows unzip: true + packages: + ignore_artifact: true variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 # Publish for netcode.gameobjects to https://artifactory-slo.bf.unity3d.com/artifactory/api/npm/upm-npm publish_netcode_gameobjects: @@ -161,7 +191,7 @@ publish_netcode_gameobjects: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -186,6 +216,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2021.3-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2021_3_-_ubuntu specific_options: UTR: @@ -194,6 +226,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2021.3-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2021_3_-_windows specific_options: UTR: @@ -202,6 +236,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2021.3-windows unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2022_3_-_macos specific_options: UTR: @@ -210,6 +246,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2022.3-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2022_3_-_ubuntu specific_options: UTR: @@ -218,6 +256,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2022.3-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_2022_3_-_windows specific_options: UTR: @@ -226,6 +266,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-2022.3-windows unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_0_-_macos specific_options: UTR: @@ -234,6 +276,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.0-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_0_-_ubuntu specific_options: UTR: @@ -242,6 +286,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.0-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_0_-_windows specific_options: UTR: @@ -250,6 +296,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.0-windows unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_1_-_macos specific_options: UTR: @@ -258,6 +306,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.1-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_1_-_ubuntu specific_options: UTR: @@ -266,6 +316,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.1-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_1_-_windows specific_options: UTR: @@ -274,6 +326,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.1-windows unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_2_-_macos specific_options: UTR: @@ -282,6 +336,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.2-macos unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_2_-_ubuntu specific_options: UTR: @@ -290,6 +346,8 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.2-ubuntu unzip: true + packages: + ignore_artifact: true - path: .yamato/wrench/validation-jobs.yml#validate_-_netcode_gameobjects_-_6000_2_-_windows specific_options: UTR: @@ -298,10 +356,12 @@ publish_netcode_gameobjects: pvp-results: location: results/pvp/validate-netcode.gameobjects-6000.2-windows unzip: true + packages: + ignore_artifact: true variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 diff --git a/.yamato/wrench/recipe-regeneration.yml b/.yamato/wrench/recipe-regeneration.yml index c2b89eecc2..7cec6a1ea8 100644 --- a/.yamato/wrench/recipe-regeneration.yml +++ b/.yamato/wrench/recipe-regeneration.yml @@ -26,5 +26,5 @@ test_-_wrench_jobs_up_to_date: cancel_old_ci: true metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 diff --git a/.yamato/wrench/validation-jobs.yml b/.yamato/wrench/validation-jobs.yml index ff1319d03d..c2ecbd9dd8 100644 --- a/.yamato/wrench/validation-jobs.yml +++ b/.yamato/wrench/validation-jobs.yml @@ -9,7 +9,7 @@ validate_-_netcode_gameobjects_-_2021_3_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -60,10 +60,10 @@ validate_-_netcode_gameobjects_-_2021_3_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -75,7 +75,7 @@ validate_-_netcode_gameobjects_-_2021_3_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -126,10 +126,10 @@ validate_-_netcode_gameobjects_-_2021_3_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -141,7 +141,7 @@ validate_-_netcode_gameobjects_-_2021_3_-_windows: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -192,10 +192,10 @@ validate_-_netcode_gameobjects_-_2021_3_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -207,7 +207,7 @@ validate_-_netcode_gameobjects_-_2022_3_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -258,10 +258,10 @@ validate_-_netcode_gameobjects_-_2022_3_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -273,7 +273,7 @@ validate_-_netcode_gameobjects_-_2022_3_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -324,10 +324,10 @@ validate_-_netcode_gameobjects_-_2022_3_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -339,7 +339,7 @@ validate_-_netcode_gameobjects_-_2022_3_-_windows: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -390,10 +390,10 @@ validate_-_netcode_gameobjects_-_2022_3_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -405,7 +405,7 @@ validate_-_netcode_gameobjects_-_6000_0_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -456,10 +456,10 @@ validate_-_netcode_gameobjects_-_6000_0_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -471,7 +471,7 @@ validate_-_netcode_gameobjects_-_6000_0_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -522,10 +522,10 @@ validate_-_netcode_gameobjects_-_6000_0_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -537,7 +537,7 @@ validate_-_netcode_gameobjects_-_6000_0_-_windows: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -588,10 +588,10 @@ validate_-_netcode_gameobjects_-_6000_0_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -603,7 +603,7 @@ validate_-_netcode_gameobjects_-_6000_1_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -654,10 +654,10 @@ validate_-_netcode_gameobjects_-_6000_1_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -669,7 +669,7 @@ validate_-_netcode_gameobjects_-_6000_1_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -720,10 +720,10 @@ validate_-_netcode_gameobjects_-_6000_1_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -735,7 +735,7 @@ validate_-_netcode_gameobjects_-_6000_1_-_windows: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -786,10 +786,10 @@ validate_-_netcode_gameobjects_-_6000_1_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -801,7 +801,7 @@ validate_-_netcode_gameobjects_-_6000_2_-_macos: type: Unity::VM::osx flavor: b1.xlarge commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -852,10 +852,10 @@ validate_-_netcode_gameobjects_-_6000_2_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -867,7 +867,7 @@ validate_-_netcode_gameobjects_-_6000_2_-_ubuntu: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -918,10 +918,10 @@ validate_-_netcode_gameobjects_-_6000_2_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects @@ -933,7 +933,7 @@ validate_-_netcode_gameobjects_-_6000_2_-_windows: type: Unity::VM flavor: b1.large commands: - - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-59_594aea2e5eb3a7468ad88458b5c5da2e5e72af0d2267db7b025602fb69e57bd7.zip -o wrench-localapv.zip + - command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-60_641f75ebc79901fc7eb7880e924d4adc41d99ad42d02aa320814a9e1e75463c4.zip -o wrench-localapv.zip - command: 7z x -aoa wrench-localapv.zip - command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple - command: python PythonScripts/print_machine_info.py @@ -984,10 +984,10 @@ validate_-_netcode_gameobjects_-_6000_2_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.44.0 + UPMPVP_CONTEXT_WRENCH: 0.10.45.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.44.0 + Wrench: 0.10.45.0 labels: - Packages:netcode.gameobjects diff --git a/.yamato/wrench/wrench_config.json b/.yamato/wrench/wrench_config.json index 8cf2526c56..d8591263ec 100644 --- a/.yamato/wrench/wrench_config.json +++ b/.yamato/wrench/wrench_config.json @@ -31,7 +31,7 @@ }, "publishing_job": ".yamato/wrench/promotion-jobs.yml#publish_netcode_gameobjects", "branch_pattern": "ReleaseSlash", - "wrench_version": "0.10.44.0", + "wrench_version": "0.10.45.0", "pvp_exemption_path": ".yamato/wrench/pvp-exemptions.json", "cs_project_path": "Tools\\CI\\NGO.Cookbook.csproj" } \ No newline at end of file diff --git a/Tools/CI/NGO.Cookbook.csproj b/Tools/CI/NGO.Cookbook.csproj index d994233e00..968e57e6a2 100644 --- a/Tools/CI/NGO.Cookbook.csproj +++ b/Tools/CI/NGO.Cookbook.csproj @@ -8,7 +8,7 @@ - + From d17d98b37fb3ff78bd0b1034061f7270ef9ef909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Mon, 31 Mar 2025 17:54:43 +0200 Subject: [PATCH 09/23] ci: [1.X] disabling WebGL Build job on macOS due to "Light baking could not be started because no valid OpenCL device could be found" error. (#3370) Backport of https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/3369 After switching from Intel macOS to Apple Silicon due to the common problem with bit-flipping on Intel macOS the WebGL build job started failing due to "Light baking could not be started because no valid OpenCL device could be found" error. We need to figure out if this can be fixed or how to proceed with it. * PR that switched macOS device --> [NGOv1.X](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/3326), [NGOv2.X](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/3329) The issue exists on both NGO branches (*develop* and *develop-2.0.0*) so the solution needs to be applied on both. For now I'm disabling this job and tracking it in MTT-11726 --- .yamato/_run-all.yml | 6 ++++++ .yamato/webgl-build.yml | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.yamato/_run-all.yml b/.yamato/_run-all.yml index 372152bb19..84e4a491fb 100644 --- a/.yamato/_run-all.yml +++ b/.yamato/_run-all.yml @@ -102,9 +102,11 @@ run_all_webgl_builds: dependencies: {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} +{% if platform.name != "mac" -%} # There is an error about "Light baking could not be started because no valid OpenCL device could be found". Tracked in MTT-11726 {% for editor in validation_editors.all -%} - .yamato/webgl-build.yml#webgl_build_{{ project.name }}_{{ platform.name }}_{{ editor }} {% endfor -%} +{% endif -%} {% endfor -%} {% endfor -%} @@ -115,9 +117,11 @@ run_all_webgl_builds_trunk: dependencies: {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} +{% if platform.name != "mac" -%} # There is an error about "Light baking could not be started because no valid OpenCL device could be found". Tracked in MTT-11726 {% for editor in validation_editors.default -%} - .yamato/webgl-build.yml#webgl_build_{{ project.name }}_{{ platform.name }}_{{ editor }} {% endfor -%} +{% endif -%} {% endfor -%} {% endfor -%} @@ -127,7 +131,9 @@ run_all_webgl_builds_2021: dependencies: {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} +{% if platform.name != "mac" -%} # There is an error about "Light baking could not be started because no valid OpenCL device could be found". Tracked in MTT-11726 - .yamato/webgl-build.yml#webgl_build_{{ project.name }}_{{ platform.name }}_2021.3 +{% endif -%} {% endfor -%} {% endfor -%} diff --git a/.yamato/webgl-build.yml b/.yamato/webgl-build.yml index 33fac79782..60e762c5a1 100644 --- a/.yamato/webgl-build.yml +++ b/.yamato/webgl-build.yml @@ -25,6 +25,7 @@ {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} +{% if platform.name != "mac" -%} # There is an error about "Light baking could not be started because no valid OpenCL device could be found". Tracked in MTT-11726 {% for editor in validation_editors.all -%} webgl_build_{{ project.name }}_{{ platform.name }}_{{ editor }}: name: WebGl Build - {{ project.name }} [{{ platform.name }}, {{ editor }}, il2cpp] @@ -37,7 +38,7 @@ webgl_build_{{ project.name }}_{{ platform.name }}_{{ editor }}: {% endif %} commands: - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor -c webgl -c il2cpp {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloading the editor with additional webgl and il2cpp components - + # The following step builds the player with defined options such as: # Suite parameter if defined since it's a mandatory field to define which test suite should be used, but it doesn't matter in this case since we won't run any tests (--suite) # Editor is run in batchmode, which means that Unity runs command line arguments without the need for human interaction. It also suppresses pop-up windows that require human interaction (such as the Save Scene window). We should always run Unity in batch mode when using command line arguments, because it allows automation to run without interruption. (--extra-editor-arg=-batchmode) @@ -51,5 +52,6 @@ webgl_build_{{ project.name }}_{{ platform.name }}_{{ editor }}: - "artifacts/**/*" - "build/players/**/*" {% endfor -%} +{% endif -%} {% endfor -%} {% endfor -%} From b0863ca43af7d92feb2b054783502d996e688774 Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 31 Mar 2025 17:14:56 -0400 Subject: [PATCH 10/23] chore: [1.x] Add NetworkTransform parenting test (#3367) Adds a test replicating the bug fixed in #3361 Move the code to sync prefabs for late joining clients into the `NetcodeIntegrationTest` ## Changelog - Added: Test for #3361 ## Testing and Documentation - Adds Unit test --------- Co-authored-by: Noel Stephens --- .../Runtime/NetcodeIntegrationTest.cs | 8 + .../Tests/Runtime/DeferredMessagingTests.cs | 3 +- .../NetworkBehaviourPrePostSpawnTests.cs | 6 - .../NetworkObjectOnSpawnTests.cs | 10 +- .../NetworkObjectSynchronizationTests.cs | 16 +- .../NetworkTransform/NetworkTransformBase.cs | 1 - .../NetworkTransformOwnershipTests.cs | 14 -- .../NetworkTransformParentingTests.cs | 191 ++++++++++++++++++ .../NetworkTransformParentingTests.cs.meta | 3 + .../Runtime/Animation/NetworkAnimatorTests.cs | 13 -- .../Tests/Runtime/DontDestroyOnLoadTests.cs | 6 - .../Tests/Runtime/NetworkManagerTests.cs | 8 +- .../NetworkObjectSceneMigrationTests.cs | 13 -- .../ParentDynamicUnderInScenePlaced.cs | 9 - .../ParentingWorldPositionStaysTests.cs | 8 - .../Tests/Runtime/PrefabExtendedTests.cs | 9 +- 16 files changed, 216 insertions(+), 102 deletions(-) create mode 100644 com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformParentingTests.cs create mode 100644 com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformParentingTests.cs.meta diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs index 3372857289..fe377a6d01 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs @@ -524,6 +524,14 @@ private void AddRemoveNetworkManager(NetworkManager networkManager, bool addNetw /// The NetworkManager instance of the client. protected virtual void OnNewClientCreated(NetworkManager networkManager) { + // Ensure any late joining client has all NetworkPrefabs required to connect. + foreach (var networkPrefab in m_ServerNetworkManager.NetworkConfig.Prefabs.Prefabs) + { + if (!networkManager.NetworkConfig.Prefabs.Contains(networkPrefab.Prefab)) + { + networkManager.NetworkConfig.Prefabs.Add(networkPrefab); + } + } } /// diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs index cd48944567..550118b285 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs @@ -256,8 +256,7 @@ protected override void OnNewClientCreated(NetworkManager networkManager) { AddPrefabsToClient(networkManager); } - - base.OnNewClientCreated(networkManager); + // Don't call base as this will synchronize the prefabs } private void SpawnClients(bool clearTestDeferredMessageManagerCallFlags = true) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkBehaviourPrePostSpawnTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkBehaviourPrePostSpawnTests.cs index 471d9facd6..e149064412 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkBehaviourPrePostSpawnTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkBehaviourPrePostSpawnTests.cs @@ -88,12 +88,6 @@ protected override IEnumerator OnSetup() return base.OnSetup(); } - protected override void OnNewClientCreated(NetworkManager networkManager) - { - networkManager.NetworkConfig.Prefabs = m_ServerNetworkManager.NetworkConfig.Prefabs; - base.OnNewClientCreated(networkManager); - } - /// /// This validates that pre spawn can be used to instantiate and assign a NetworkVariable (or other prespawn tasks) /// which can be useful for assigning a NetworkVariable value on the server side when the NetworkVariable has owner write permissions. diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectOnSpawnTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectOnSpawnTests.cs index 10da7f8437..d7465cf37e 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectOnSpawnTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectOnSpawnTests.cs @@ -62,18 +62,10 @@ private bool CheckClientsSideObserverTestObj() } /// - /// Assures the late joining client has all - /// NetworkPrefabs required to connect. + /// Set up late joining client /// protected override void OnNewClientCreated(NetworkManager networkManager) { - foreach (var networkPrefab in m_ServerNetworkManager.NetworkConfig.Prefabs.Prefabs) - { - if (!networkManager.NetworkConfig.Prefabs.Contains(networkPrefab.Prefab)) - { - networkManager.NetworkConfig.Prefabs.Add(networkPrefab); - } - } networkManager.NetworkConfig.EnableSceneManagement = m_ServerNetworkManager.NetworkConfig.EnableSceneManagement; base.OnNewClientCreated(networkManager); } diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSynchronizationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSynchronizationTests.cs index 3ac712e1e3..c9ece5092a 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSynchronizationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSynchronizationTests.cs @@ -76,21 +76,17 @@ protected override void OnServerAndClientsCreated() protected override void OnNewClientCreated(NetworkManager networkManager) { + // Setup late joining client prefabs first + base.OnNewClientCreated(networkManager); + networkManager.NetworkConfig.PlayerPrefab = m_PlayerPrefab; networkManager.NetworkConfig.EnsureNetworkVariableLengthSafety = m_VariableLengthSafety == VariableLengthSafety.EnabledNetVarSafety; - foreach (var networkPrefab in m_ServerNetworkManager.NetworkConfig.Prefabs.Prefabs) - { - // To simulate a failure, we exclude the m_InValidNetworkPrefab from the connecting - // client's side. - if (networkPrefab.Prefab.name != m_InValidNetworkPrefab.name) - { - networkManager.NetworkConfig.Prefabs.Add(networkPrefab); - } - } + // Disable forcing the same prefabs to avoid failed connections networkManager.NetworkConfig.ForceSamePrefabs = false; networkManager.LogLevel = m_CurrentLogLevel; - base.OnNewClientCreated(networkManager); + // To simulate a failure, exclude the m_InValidNetworkPrefab from the connecting client's side. + networkManager.NetworkConfig.Prefabs.Remove(m_InValidNetworkPrefab); } [UnityTest] diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformBase.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformBase.cs index 6c97328ab2..08789c56ac 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformBase.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformBase.cs @@ -339,7 +339,6 @@ protected override IEnumerator OnServerAndClientsConnected() /// protected override void OnNewClientCreated(NetworkManager networkManager) { - networkManager.NetworkConfig.Prefabs = m_ServerNetworkManager.NetworkConfig.Prefabs; networkManager.NetworkConfig.TickRate = GetTickRate(); if (m_EnableVerboseDebug) { diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformOwnershipTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformOwnershipTests.cs index 1bcd7a9c0a..cee896a4aa 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformOwnershipTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformOwnershipTests.cs @@ -46,20 +46,6 @@ protected override void OnServerAndClientsCreated() base.OnServerAndClientsCreated(); } - /// - /// Clients created during a test need to have their prefabs list updated to - /// match the server's prefab list. - /// - protected override void OnNewClientCreated(NetworkManager networkManager) - { - foreach (var networkPrefab in m_ServerNetworkManager.NetworkConfig.Prefabs.Prefabs) - { - networkManager.NetworkConfig.Prefabs.Add(networkPrefab); - } - - base.OnNewClientCreated(networkManager); - } - private bool ClientIsOwner() { var clientId = m_ClientNetworkManagers[0].LocalClientId; diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformParentingTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformParentingTests.cs new file mode 100644 index 0000000000..96ff803d86 --- /dev/null +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformParentingTests.cs @@ -0,0 +1,191 @@ +using System.Collections; +using Unity.Netcode.Components; +using Unity.Netcode.TestHelpers.Runtime; +using UnityEngine; +using UnityEngine.TestTools; + +namespace Unity.Netcode.RuntimeTests +{ + internal class NetworkTransformParentingTests : IntegrationTestWithApproximation + { + /// + /// A NetworkBehaviour that moves in space. + /// When spawned on the client, an RPC is sent to the server to spawn a player object for that client. + /// The server parents the player object to the spawner object. This gives a moving parent object and a non-moving child object. + /// The child object should always be at {0,0,0} local space, while the parent object moves around. + /// This NetworkBehaviour tests that parenting to a moving object works as expected. + /// + internal class PlayerSpawner : NetworkBehaviour + { + /// + /// Prefab for the player + /// + public NetworkObject PlayerPrefab; + + /// + /// The server side NetworkObject that was spawned when the client connected. + /// + public NetworkObject SpawnedPlayer; + + /// + /// Represents the different movement states of the PlayerSpawner during the test lifecycle. + /// + public enum MoveState + { + // Initial state, PlayerSpawner will move without counting frames + NotStarted, + // The player object has been spawned, start counting frames + PlayerSpawned, + // We have moved far enough to test location + ReachedPeak, + } + public MoveState State = MoveState.NotStarted; + + // A count of the number of updates since the player object was spawned. + private int m_Count; + + // Movement offsets and targets. + private const float k_PositionOffset = 5.0f; + private const float k_RotationOffset = 25.0f; + private readonly Vector3 m_PositionTarget = Vector3.one * k_PositionOffset * 10; + private readonly Vector3 m_RotationTarget = Vector3.one * k_RotationOffset * 10; + + private void Update() + { + if (!IsServer) + { + return; + } + + transform.position = Vector3.Lerp(transform.position, m_PositionTarget, Time.deltaTime * 2); + var rotation = transform.rotation; + rotation.eulerAngles = Vector3.Slerp(rotation.eulerAngles, m_RotationTarget, Time.deltaTime * 2); + transform.rotation = rotation; + + if (State != MoveState.PlayerSpawned) + { + return; + } + + // Move self for some time after player object is spawned + // This ensures the parent object is moving throughout the spawn process. + m_Count++; + if (m_Count > 10) + { + // Mark PlayerSpawner as having moved far enough to test. + State = MoveState.ReachedPeak; + } + } + + public override void OnNetworkSpawn() + { + if (IsOwner) + { + // Owner initialises PlayerSpawner movement on spawn + transform.position = Vector3.one * k_PositionOffset; + var rotation = transform.rotation; + rotation.eulerAngles = Vector3.one * k_RotationOffset; + transform.rotation = rotation; + } + else + { + // When spawned on a client, send the RPC to spawn the player object + // Using an RPC ensures the PlayerSpawner is moving for the entire spawning of the player object. + RequestPlayerObjectSpawnServerRpc(); + } + } + + /// + /// A ServerRpc that requests the server to spawn a player object for the client that invoked this RPC. + /// + /// Parameters for the ServerRpc, including the sender's client ID. + [ServerRpc(RequireOwnership = false)] + private void RequestPlayerObjectSpawnServerRpc(ServerRpcParams rpcParams = default) + { + SpawnedPlayer = Instantiate(PlayerPrefab); + SpawnedPlayer.SpawnAsPlayerObject(rpcParams.Receive.SenderClientId); + SpawnedPlayer.TrySetParent(NetworkObject, false); + State = MoveState.PlayerSpawned; + } + } + + // Client Authoritative NetworkTransform + internal class ClientNetworkTransform : NetworkTransform + { + protected override bool OnIsServerAuthoritative() + { + return false; + } + } + + // Don't start with any clients, we will manually spawn a client inside the test + protected override int NumberOfClients => 0; + + // Parent prefab with moving PlayerSpawner which will spawn the childPrefab + private GameObject m_PlayerSpawnerPrefab; + + // Client and server instances + private PlayerSpawner m_ServerPlayerSpawner; + private NetworkObject m_NewClientPlayer; + + protected override void OnServerAndClientsCreated() + { + m_PlayerSpawnerPrefab = CreateNetworkObjectPrefab("Parent"); + var parentPlayerSpawner = m_PlayerSpawnerPrefab.AddComponent(); + m_PlayerSpawnerPrefab.AddComponent(); + + var playerPrefab = CreateNetworkObjectPrefab("Child"); + var childNetworkTransform = playerPrefab.AddComponent(); + childNetworkTransform.InLocalSpace = true; + + parentPlayerSpawner.PlayerPrefab = playerPrefab.GetComponent(); + + base.OnServerAndClientsCreated(); + } + + private bool NewPlayerObjectSpawned() + { + return m_ServerPlayerSpawner.SpawnedPlayer && + m_ClientNetworkManagers[0].SpawnManager.SpawnedObjects.ContainsKey(m_ServerPlayerSpawner.SpawnedPlayer.NetworkObjectId); + } + + private bool HasServerInstanceReachedPeakPoint() + { + VerboseDebug($"Client Local: {m_NewClientPlayer.transform.localPosition} Server Local: {m_ServerPlayerSpawner.SpawnedPlayer.transform.localPosition}"); + return m_ServerPlayerSpawner.State == PlayerSpawner.MoveState.ReachedPeak; + } + + private bool ServerClientPositionMatches() + { + return Approximately(m_NewClientPlayer.transform.localPosition, m_ServerPlayerSpawner.SpawnedPlayer.transform.localPosition) && + Approximately(m_NewClientPlayer.transform.position, m_ServerPlayerSpawner.SpawnedPlayer.transform.position); + } + + [UnityTest] + public IEnumerator TestParentedPlayerUsingLocalSpace() + { + // Spawn the PlayerSpawner object and save the instantiated component + // The PlayerSpawner object will start moving. + m_ServerPlayerSpawner = SpawnObject(m_PlayerSpawnerPrefab, m_ServerNetworkManager).GetComponent(); + + // Create a new client and connect to the server + // The client will prompt the server to spawn a player object and parent it to the PlayerSpawner object. + yield return CreateAndStartNewClient(); + + yield return WaitForConditionOrTimeOut(NewPlayerObjectSpawned); + AssertOnTimeout($"Client did not spawn new player object!"); + + // Save the spawned player object + m_NewClientPlayer = m_ClientNetworkManagers[0].SpawnManager.SpawnedObjects[m_ServerPlayerSpawner.SpawnedPlayer.NetworkObjectId]; + + // Let the parent PlayerSpawner move for several ticks to get an offset + yield return WaitForConditionOrTimeOut(HasServerInstanceReachedPeakPoint); + AssertOnTimeout($"Server instance never reached peak point!"); + + // Check that the client and server local positions match (they should both be at {0,0,0} local space) + yield return WaitForConditionOrTimeOut(ServerClientPositionMatches); + AssertOnTimeout($"Client local position {m_NewClientPlayer.transform.localPosition} does not match" + + $" server local position {m_ServerPlayerSpawner.SpawnedPlayer.transform.localPosition}"); + } + } +} diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformParentingTests.cs.meta b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformParentingTests.cs.meta new file mode 100644 index 0000000000..29bf9919de --- /dev/null +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformParentingTests.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 51591ff70c654563a1d8aa2f83bc023f +timeCreated: 1743177289 \ No newline at end of file diff --git a/testproject/Assets/Tests/Runtime/Animation/NetworkAnimatorTests.cs b/testproject/Assets/Tests/Runtime/Animation/NetworkAnimatorTests.cs index c9d47c8237..0da96aa45e 100644 --- a/testproject/Assets/Tests/Runtime/Animation/NetworkAnimatorTests.cs +++ b/testproject/Assets/Tests/Runtime/Animation/NetworkAnimatorTests.cs @@ -626,19 +626,6 @@ public IEnumerator TriggerUpdateTests([Values] OwnerShipMode ownerShipMode, [Val VerboseDebug($" ------------------ Trigger Test [{TriggerTest.Iteration}][{ownerShipMode}] Stopping ------------------ "); } - protected override void OnNewClientCreated(NetworkManager networkManager) - { - var networkPrefab = new NetworkPrefab() { Prefab = m_AnimationTestPrefab }; - networkManager.NetworkConfig.Prefabs.Add(networkPrefab); - networkPrefab = new NetworkPrefab() { Prefab = m_AnimationOwnerTestPrefab }; - networkManager.NetworkConfig.Prefabs.Add(networkPrefab); - - networkPrefab = new NetworkPrefab() { Prefab = m_AnimationCheerTestPrefab }; - networkManager.NetworkConfig.Prefabs.Add(networkPrefab); - networkPrefab = new NetworkPrefab() { Prefab = m_AnimationCheerOwnerTestPrefab }; - networkManager.NetworkConfig.Prefabs.Add(networkPrefab); - } - /// /// Verifies that triggers are synchronized with currently connected clients /// diff --git a/testproject/Assets/Tests/Runtime/DontDestroyOnLoadTests.cs b/testproject/Assets/Tests/Runtime/DontDestroyOnLoadTests.cs index f3794d46b5..dcea70efdd 100644 --- a/testproject/Assets/Tests/Runtime/DontDestroyOnLoadTests.cs +++ b/testproject/Assets/Tests/Runtime/DontDestroyOnLoadTests.cs @@ -22,12 +22,6 @@ protected override void OnServerAndClientsCreated() base.OnServerAndClientsCreated(); } - protected override void OnNewClientCreated(NetworkManager networkManager) - { - networkManager.NetworkConfig.Prefabs = m_ServerNetworkManager.NetworkConfig.Prefabs; - base.OnNewClientCreated(networkManager); - } - private ulong m_SpawnedNetworkObjectId; private StringBuilder m_ErrorLog = new StringBuilder(); diff --git a/testproject/Assets/Tests/Runtime/NetworkManagerTests.cs b/testproject/Assets/Tests/Runtime/NetworkManagerTests.cs index b09dd5e291..5756f81b85 100644 --- a/testproject/Assets/Tests/Runtime/NetworkManagerTests.cs +++ b/testproject/Assets/Tests/Runtime/NetworkManagerTests.cs @@ -108,16 +108,12 @@ public enum ShutdownChecks protected override void OnNewClientCreated(NetworkManager networkManager) { networkManager.NetworkConfig.EnableSceneManagement = m_UseSceneManagement; - foreach (var prefab in m_ServerNetworkManager.NetworkConfig.Prefabs.Prefabs) - { - networkManager.NetworkConfig.Prefabs.Add(prefab); - } base.OnNewClientCreated(networkManager); } /// /// Validate shutting down a second time does not cause an exception. - /// + /// [UnityTest] public IEnumerator ValidateShutdown([Values] ShutdownChecks shutdownCheck) { @@ -132,7 +128,7 @@ public IEnumerator ValidateShutdown([Values] ShutdownChecks shutdownCheck) } else { - // For this test (simplify the complexity) with a late joining client, just remove the + // For this test (simplify the complexity) with a late joining client, just remove the // in-scene placed NetworkObject prior to the client connecting // (We are testing the shutdown sequence) var spawnedObjects = m_ServerNetworkManager.SpawnManager.SpawnedObjectsList.ToList(); diff --git a/testproject/Assets/Tests/Runtime/NetworkSceneManager/NetworkObjectSceneMigrationTests.cs b/testproject/Assets/Tests/Runtime/NetworkSceneManager/NetworkObjectSceneMigrationTests.cs index ccfbf25b05..d5eb5f427c 100644 --- a/testproject/Assets/Tests/Runtime/NetworkSceneManager/NetworkObjectSceneMigrationTests.cs +++ b/testproject/Assets/Tests/Runtime/NetworkSceneManager/NetworkObjectSceneMigrationTests.cs @@ -59,19 +59,6 @@ protected override void OnServerAndClientsCreated() base.OnServerAndClientsCreated(); } - protected override void OnNewClientCreated(NetworkManager networkManager) - { - foreach (var networkPrfab in m_ServerNetworkManager.NetworkConfig.Prefabs.Prefabs) - { - if (networkPrfab.Prefab == null) - { - continue; - } - networkManager.NetworkConfig.Prefabs.Add(networkPrfab); - } - base.OnNewClientCreated(networkManager); - } - private bool DidClientsSpawnInstance(NetworkObject serverObject, bool checkDestroyWithScene = false) { foreach (var networkManager in m_ClientNetworkManagers) diff --git a/testproject/Assets/Tests/Runtime/ObjectParenting/ParentDynamicUnderInScenePlaced.cs b/testproject/Assets/Tests/Runtime/ObjectParenting/ParentDynamicUnderInScenePlaced.cs index 153dc285c9..8afc208779 100644 --- a/testproject/Assets/Tests/Runtime/ObjectParenting/ParentDynamicUnderInScenePlaced.cs +++ b/testproject/Assets/Tests/Runtime/ObjectParenting/ParentDynamicUnderInScenePlaced.cs @@ -46,15 +46,6 @@ protected override IEnumerator OnStartedServerAndClients() return base.OnStartedServerAndClients(); } - protected override void OnNewClientCreated(NetworkManager networkManager) - { - foreach (var networkPrefab in m_ServerNetworkManager.NetworkConfig.Prefabs.Prefabs) - { - networkManager.NetworkConfig.Prefabs.Add(networkPrefab); - } - base.OnNewClientCreated(networkManager); - } - protected override void OnNewClientStarted(NetworkManager networkManager) { m_ServerNetworkManager.SceneManager.SetClientSynchronizationMode(LoadSceneMode.Additive); diff --git a/testproject/Assets/Tests/Runtime/ObjectParenting/ParentingWorldPositionStaysTests.cs b/testproject/Assets/Tests/Runtime/ObjectParenting/ParentingWorldPositionStaysTests.cs index 6c6aa74f49..e0af30e731 100644 --- a/testproject/Assets/Tests/Runtime/ObjectParenting/ParentingWorldPositionStaysTests.cs +++ b/testproject/Assets/Tests/Runtime/ObjectParenting/ParentingWorldPositionStaysTests.cs @@ -218,14 +218,6 @@ protected override void OnServerAndClientsCreated() base.OnServerAndClientsCreated(); } - protected override void OnNewClientCreated(NetworkManager networkManager) - { - foreach (var networkPrefab in m_ServerNetworkManager.NetworkConfig.Prefabs.Prefabs) - { - networkManager.NetworkConfig.Prefabs.Add(networkPrefab); - } - } - private bool HaveAllClientsSpawnedObjects() { foreach (var client in m_ClientNetworkManagers) diff --git a/testproject/Assets/Tests/Runtime/PrefabExtendedTests.cs b/testproject/Assets/Tests/Runtime/PrefabExtendedTests.cs index 8b05791995..da513b74d4 100644 --- a/testproject/Assets/Tests/Runtime/PrefabExtendedTests.cs +++ b/testproject/Assets/Tests/Runtime/PrefabExtendedTests.cs @@ -129,11 +129,10 @@ protected override void OnNewClientCreated(NetworkManager networkManager) { networkManager.NetworkConfig.EnableSceneManagement = m_SceneManagementEnabled; networkManager.NetworkConfig.Prefabs.NetworkPrefabsLists.Add(PrefabTestConfig.Instance.TestPrefabs); - base.OnNewClientCreated(networkManager); } /// - /// Validates that all spawned NetworkObjects are present and their corresponding + /// Validates that all spawned NetworkObjects are present and their corresponding /// GlobalObjectIdHash values match /// private bool ValidateAllClientsSpawnedObjects() @@ -227,7 +226,7 @@ public IEnumerator TestPrefabsSpawning([Values] InstantiateAndSpawnMethods insta yield return CreateAndStartNewClient(); var spawnManager = m_ServerNetworkManager.SpawnManager; - // If scene management is enabled, then we want to verify against the editor + // If scene management is enabled, then we want to verify against the editor // assigned in-scene placed NetworkObjects if (m_SceneManagementEnabled) { @@ -303,7 +302,7 @@ public IEnumerator TestPrefabsSpawning([Values] InstantiateAndSpawnMethods insta [UnityTest] public IEnumerator TestsInstantiateAndSpawnErrors([Values] InstantiateAndSpawnMethods instantiateAndSpawnType) { - // If scene management is enabled, then we want to verify against the editor + // If scene management is enabled, then we want to verify against the editor // assigned in-scene placed NetworkObjects if (m_SceneManagementEnabled) { @@ -344,7 +343,7 @@ public IEnumerator TestsInstantiateAndSpawnErrors([Values] InstantiateAndSpawnMe m_ServerNetworkManager.Shutdown(); LogAssert.Expect(LogType.Warning, NetworkSpawnManager.InstantiateAndSpawnErrors[NetworkSpawnManager.InstantiateAndSpawnErrorTypes.InvokedWhenShuttingDown]); InstantiateAndSpawn(m_ObjectsToSpawn[0], instantiateAndSpawnType); - // The not listening error can only happen when trying to instantiate and spawn on a Network Prefab + // The not listening error can only happen when trying to instantiate and spawn on a Network Prefab if (instantiateAndSpawnType == InstantiateAndSpawnMethods.NetworkObject) { LogAssert.Expect(LogType.Error, NetworkSpawnManager.InstantiateAndSpawnErrors[NetworkSpawnManager.InstantiateAndSpawnErrorTypes.NoActiveSession]); From 7d20da43a64536fab1cc97baee3ec627991791ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Tue, 1 Apr 2025 10:38:26 +0200 Subject: [PATCH 11/23] chore: [1.X] Updated CODEOWNERS file (#3371) This PR updates CODEOWNERS file to mainly account for recent creation of netcode-qa group. The reasoning is: - @michalChrobot and @miniwolf were removed since they are part of @Unity-Technologies/netcode-qa group which was added - @fluong6 was removed since he's not focusing on NGO right now and we can lower the noise for him --------- Co-authored-by: Noel Stephens --- .github/CODEOWNERS | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a7cd830adc..905922d636 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,10 +2,10 @@ # Order is important; the last matching pattern takes the most precedence. * @Unity-Technologies/multiplayer-sdk -*.asmdef @miniwolf @NoelStephensUnity @fluong6 @michalChrobot @EmandM -package.json @miniwolf @NoelStephensUnity @fluong6 @michalChrobot @EmandM -AssemblyInfo.cs @miniwolf @NoelStephensUnity @fluong6 @michalChrobot @EmandM -.editorconfig @miniwolf @NoelStephensUnity @fluong6 @michalChrobot @EmandM -.gitignore @miniwolf @NoelStephensUnity @fluong6 @michalChrobot @EmandM -.github/ @miniwolf @NoelStephensUnity @fluong6 @michalChrobot @EmandM -.yamato/ @miniwolf @NoelStephensUnity @fluong6 @michalChrobot @EmandM +*.asmdef @NoelStephensUnity @EmandM @Unity-Technologies/netcode-qa +package.json @NoelStephensUnity @EmandM @Unity-Technologies/netcode-qa +AssemblyInfo.cs @NoelStephensUnity @EmandM @Unity-Technologies/netcode-qa +.editorconfig @NoelStephensUnity @EmandM @Unity-Technologies/netcode-qa +.gitignore @NoelStephensUnity @EmandM @Unity-Technologies/netcode-qa +.github/ @NoelStephensUnity @EmandM @Unity-Technologies/netcode-qa +.yamato/ @NoelStephensUnity @EmandM @Unity-Technologies/netcode-qa From b6d32f01e3b19d27d630e879e43541d0d2253bc0 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Tue, 1 Apr 2025 05:56:11 -0500 Subject: [PATCH 12/23] fix: network time system tests should use double fixed delta time (#3373) Adding the support to use a double delta time for NetworkTimeSystemTests. ## Changelog NA ## Testing and Documentation - Includes update to the `NetworkTimeSystemTests.CorrectAmountTicksTest` integration test. - No documentation changes or additions were necessary. --- .../Runtime/Timing/NetworkTime.cs | 5 +++++ .../Runtime/Timing/NetworkTimeSystemTests.cs | 19 +++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs b/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs index 916a35e6c4..b66ad3ef21 100644 --- a/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs +++ b/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs @@ -50,6 +50,11 @@ public struct NetworkTime /// public float FixedDeltaTime => (float)m_TickInterval; + /// + /// Gets the fixed delta time as a double. This value is calculated by dividing 1.0 by the and stays constant. + /// + public double FixedDeltaTimeAsDouble => m_TickInterval; + /// /// Gets the amount of network ticks which have passed until reaching the current time value. /// diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs index 992dbb2293..627fe8776a 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs @@ -62,7 +62,7 @@ public IEnumerator PlayerLoopTimeTest_WithDifferentTimeScale([Values(0.0f, 0.1f, public IEnumerator CorrectAmountTicksTest() { NetworkTickSystem tickSystem = NetworkManager.Singleton.NetworkTickSystem; - float delta = tickSystem.LocalTime.FixedDeltaTime; + double delta = tickSystem.LocalTime.FixedDeltaTimeAsDouble; int previous_localTickCalculated = 0; int previous_serverTickCalculated = 0; @@ -70,27 +70,26 @@ public IEnumerator CorrectAmountTicksTest() { yield return null; - var tickCalculated = tickSystem.LocalTime.Time / delta; - previous_localTickCalculated = (int)tickCalculated; + var localTickCalculated = tickSystem.LocalTime.Time / delta; + previous_localTickCalculated = (int)localTickCalculated; // This check is needed due to double division imprecision of large numbers - if ((tickCalculated - previous_localTickCalculated) >= 0.999999999999) + if ((localTickCalculated - previous_localTickCalculated) >= 0.999999999999) { previous_localTickCalculated++; } - - tickCalculated = NetworkManager.Singleton.ServerTime.Time / delta; - previous_serverTickCalculated = (int)tickCalculated; + var serverTickCalculated = tickSystem.ServerTime.Time / delta; + previous_serverTickCalculated = (int)serverTickCalculated; // This check is needed due to double division imprecision of large numbers - if ((tickCalculated - previous_serverTickCalculated) >= 0.999999999999) + if ((serverTickCalculated - previous_serverTickCalculated) >= 0.999999999999) { previous_serverTickCalculated++; } - Assert.AreEqual(previous_localTickCalculated, NetworkManager.Singleton.LocalTime.Tick, $"Calculated local tick {previous_localTickCalculated} does not match local tick {NetworkManager.Singleton.LocalTime.Tick}!"); - Assert.AreEqual(previous_serverTickCalculated, NetworkManager.Singleton.ServerTime.Tick, $"Calculated server tick {previous_serverTickCalculated} does not match server tick {NetworkManager.Singleton.ServerTime.Tick}!"); + Assert.AreEqual(previous_localTickCalculated, NetworkManager.Singleton.LocalTime.Tick, $"Calculated local tick {previous_localTickCalculated} does not match local tick {NetworkManager.Singleton.LocalTime.Tick}!]n Local Tick-Calc: {localTickCalculated} LocalTime: {tickSystem.LocalTime.Time} | Server Tick-Calc: {serverTickCalculated} ServerTime: {tickSystem.ServerTime.Time} | TickDelta: {delta}"); + Assert.AreEqual(previous_serverTickCalculated, NetworkManager.Singleton.ServerTime.Tick, $"Calculated server tick {previous_serverTickCalculated} does not match server tick {NetworkManager.Singleton.ServerTime.Tick}!\n Local Tick-Calc: {localTickCalculated} LocalTime: {tickSystem.LocalTime.Time} | Server Tick-Calc: {serverTickCalculated} ServerTime: {tickSystem.ServerTime.Time} | TickDelta: {delta}"); Assert.AreEqual((float)NetworkManager.Singleton.LocalTime.Time, (float)NetworkManager.Singleton.ServerTime.Time, $"Local time {(float)NetworkManager.Singleton.LocalTime.Time} is not approximately server time {(float)NetworkManager.Singleton.ServerTime.Time}!", FloatComparer.s_ComparerWithDefaultTolerance); } } From f2a9e9f5e05bc74f8adc3b34d9a01ffaaf5b3de2 Mon Sep 17 00:00:00 2001 From: Emma Date: Tue, 1 Apr 2025 11:24:24 -0400 Subject: [PATCH 13/23] chore: Add action to auto update labels on comments (#3194) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding Github action that will auto-update labels on Issues. --------- Co-authored-by: Noel Stephens Co-authored-by: michalChrobot Co-authored-by: Michał Chrobot <124174716+michalChrobot@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/rfc-tracking-issue.md | 10 --- .github/workflows/assignee-management.yaml | 70 +++++++++++++++++++ .github/workflows/conversation-labels.yaml | 51 ++++++++++++++ .github/workflows/mark-stale-issue.yaml | 38 ++++++++++ .../remove-labels-on-issue-close.yaml | 40 +++++++++++ 5 files changed, 199 insertions(+), 10 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/rfc-tracking-issue.md create mode 100644 .github/workflows/assignee-management.yaml create mode 100644 .github/workflows/conversation-labels.yaml create mode 100644 .github/workflows/mark-stale-issue.yaml create mode 100644 .github/workflows/remove-labels-on-issue-close.yaml diff --git a/.github/ISSUE_TEMPLATE/rfc-tracking-issue.md b/.github/ISSUE_TEMPLATE/rfc-tracking-issue.md deleted file mode 100644 index 3b112ff8bb..0000000000 --- a/.github/ISSUE_TEMPLATE/rfc-tracking-issue.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: RFC Tracking Issue -about: Track the development of a RFC -title: 'Track RFC #: ' -labels: stat:awaiting-triage, stat:reply-needed -assignees: '' - ---- - -Tracking issue for [RFC #: ](https://github.com/Unity-Technologies/com.unity.multiplayer.rfcs/pull/) diff --git a/.github/workflows/assignee-management.yaml b/.github/workflows/assignee-management.yaml new file mode 100644 index 0000000000..9c65e3338a --- /dev/null +++ b/.github/workflows/assignee-management.yaml @@ -0,0 +1,70 @@ +# This workflow manages issue assignments and related label changes: +# 1. When someone is assigned to an issue: +# - Removes "stat:awaiting-triage" label +# - Adds "stat:Investigating" label +# 2. When all assignees are removed from an issue: +# - Adds "stat:awaiting-triage" label +# - Removes "stat:Investigating" label +# 3. When "stat:Investigating" label is added: +# - Automatically assigns the issue to the person who added the label + +name: Handle Issue Assignment and Labels + +on: + issues: + types: [assigned, unassigned, labeled] + +env: + AWAITING-TRIAGE_LABEL: stat:awaiting-triage + INVESTIGATING_LABEL: stat:Investigating + +jobs: + handle_assignment: + name: Handle Issue Assignment Changes + if: ${{ !github.event.issue.pull_request }} && ${{ github.event.issue.state == 'open' }} + runs-on: ubuntu-latest + permissions: + issues: write + + steps: + - name: Handle Assignment Changes + run: | + if [[ "${{ github.event.action }}" == "assigned" ]]; then + # Someone was assigned - remove awaiting-triage, add investigating + echo "ADD=${{ env.INVESTIGATING_LABEL }}" >> $GITHUB_ENV + echo "REMOVE=${{ env.AWAITING-TRIAGE_LABEL }}" >> $GITHUB_ENV + elif [[ "${{ github.event.action }}" == "unassigned" ]]; then + # Check if there are any remaining assignees + ASSIGNEES=$(echo '${{ toJson(github.event.issue.assignees) }}' | jq length) + if [[ "$ASSIGNEES" == "0" ]]; then + # No assignees left - add awaiting-triage, remove investigating + echo "ADD=${{ env.AWAITING-TRIAGE_LABEL }}" >> $GITHUB_ENV + echo "REMOVE=${{ env.INVESTIGATING_LABEL }}" >> $GITHUB_ENV + fi + fi + + - name: Update Labels + if: env.ADD != '' || env.REMOVE != '' + run: gh issue edit "$NUMBER" --add-label "$ADD" --remove-label "$REMOVE" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} + + handle_investigating_label: + name: Handle Investigating Label Addition + if: ${{ github.event.action == 'labeled' && github.event.label.name == 'stat:Investigating' && !github.event.issue.pull_request && github.event.issue.state == 'open' }} + runs-on: ubuntu-latest + permissions: + issues: write + + steps: + - name: Assign Issue to person that added Investigating Label + run: | + # Assign the issue to the person who added the label + gh issue edit "$NUMBER" --add-assignee "$ACTOR" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} + ACTOR: ${{ github.actor }} diff --git a/.github/workflows/conversation-labels.yaml b/.github/workflows/conversation-labels.yaml new file mode 100644 index 0000000000..83eca10968 --- /dev/null +++ b/.github/workflows/conversation-labels.yaml @@ -0,0 +1,51 @@ +# This workflow will update issues with proper "conversation related" labels. This mean that stat:awaiting-repsonse label will be present after Unity account made comments and stat:reply-needed will be present when user made latest comment + +name: Update conversation labels of the issue + +# Trigger for the workflow +# This trigger will populate the github.event object +# Details on properties are here: https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=created#issue_comment +on: + issue_comment: + types: [created] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.issue.number }} + cancel-in-progress: true + +# Define labels here +env: + AWAITING_RESPONSE: stat:awaiting-response + REPLY_NEEDED: stat:reply-needed + +jobs: + conversation_labels: + name: Calculate and update conversation labels of the issue + if: ${{ !github.event.issue.pull_request }} && ${{ github.event.issue.state == 'open' }} + runs-on: ubuntu-latest + permissions: + issues: write + + steps: + - name: Calculate labels + run: | + + if [[ "${{ github.event.comment.author_association }}" == "MEMBER" ]]; then + # Unity member commented - add awaiting-response, remove reply-needed + echo "ADD=${{ env.AWAITING_RESPONSE }}" >> $GITHUB_ENV + echo "REMOVE=${{ env.REPLY_NEEDED }}" >> $GITHUB_ENV + else + # Non-Unity member commented - add reply-needed, remove awaiting-response + echo "ADD=${{ env.REPLY_NEEDED }}" >> $GITHUB_ENV + echo "REMOVE=${{ env.AWAITING_RESPONSE }}" >> $GITHUB_ENV + fi + + - name: Update labels + # This runs a command using the github cli: https://cli.github.com/manual/gh_issue_edit + # If $ADD is set, it will add the label, otherwise it will remove the label + # There is no need to check if $ADD or $REMOVE is set, as the command will ignore it if it is empty + run: gh issue edit "$NUMBER" --add-label "$ADD" --remove-label "$REMOVE" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} diff --git a/.github/workflows/mark-stale-issue.yaml b/.github/workflows/mark-stale-issue.yaml new file mode 100644 index 0000000000..4ca2b11948 --- /dev/null +++ b/.github/workflows/mark-stale-issue.yaml @@ -0,0 +1,38 @@ +# This workflow utilises an existing implementation (https://github.com/actions/stale) that performs the following actions: +# 1) Adds "stale" label to issues that have "stat:awaiting-response" for more than 30 days meaning that since we don't have enough information we may potentially close such issue +# 2) Closes issues that have been marked as "stale" for more than 30 days + +# This affects only Issues but at some point we may also consider rules for PRs + +name: Mark and Close Stale Issues + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' # Runs daily at midnight + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + + steps: + - uses: actions/stale@v9 + with: + # Only mark issues (not PRs) as stale + only-issue-labels: 'stat:awaiting-response' + days-before-stale: 30 + days-before-close: 30 + stale-issue-label: 'Stale' + stale-issue-message: > + This issue has been automatically marked as stale because it has been awaiting + response for over 30 days without any activity. + + Please update the issue with any new information or it may be closed in 30 days. + close-issue-message: > + This issue has been automatically closed because it has been stale for 30 days + without any activity. Feel free to reopen if you have new information to add. + # Prevent the action from marking/closing PRs + days-before-pr-stale: -1 + days-before-pr-close: -1 diff --git a/.github/workflows/remove-labels-on-issue-close.yaml b/.github/workflows/remove-labels-on-issue-close.yaml new file mode 100644 index 0000000000..2ac5145e16 --- /dev/null +++ b/.github/workflows/remove-labels-on-issue-close.yaml @@ -0,0 +1,40 @@ +# This workflow will remove almost all labels from closed issues beside ones that could be relevant for future tracking like: "port:", "type:", "priority:", "regression" and "stat:imported" + +name: Remove labels when issue is closed + +on: + issues: + types: [closed] # We want it to run on closed issues + +jobs: + remove_labels: + name: Calculate and remove issue labels + if: ${{ !github.event.issue.pull_request }} # This is needed to distinguish from PRs (which we don't want to affect) + runs-on: ubuntu-latest + permissions: + issues: write + + steps: + - name: Find labels to remove + id: data + run: | + # Convert labels to array and filter out type: labels + LABELS_TO_REMOVE=($(echo "$EXISTING_LABELS" | jq -r '.[] | select(startswith("type:") or startswith("port:") or startswith("priority:") or . == "regression" or . == "stat:imported" | not)')) + + # Only proceed if we have labels to remove + if [ ${#LABELS_TO_REMOVE[@]} -gt 0 ]; then + echo "REMOVE_LABELS=$(IFS=,; echo "${LABELS_TO_REMOVE[*]}")" >> $GITHUB_ENV + echo "HAS_LABELS=true" >> $GITHUB_ENV + else + echo "HAS_LABELS=false" >> $GITHUB_ENV + fi + env: + EXISTING_LABELS: ${{ toJson(github.event.issue.labels.*.name) }} + + - name: Remove labels + if: ${{ env.REMOVE_LABELS != '' }} + run: gh issue edit "$NUMBER" --remove-label "$REMOVE_LABELS" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} From d115d00c19675e7843408509cd11828facf36553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:57:24 +0200 Subject: [PATCH 14/23] chore: add small corrections to stale GitHub action (#3378) This PR corrects workflow name and corrects one of the parameter to check if this specific label is present versus checking that only those labels are present --- .github/workflows/mark-stale-issue.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mark-stale-issue.yaml b/.github/workflows/mark-stale-issue.yaml index 4ca2b11948..213ce2b613 100644 --- a/.github/workflows/mark-stale-issue.yaml +++ b/.github/workflows/mark-stale-issue.yaml @@ -4,7 +4,7 @@ # This affects only Issues but at some point we may also consider rules for PRs -name: Mark and Close Stale Issues +name: Mark or Close Stale Issues on: workflow_dispatch: @@ -21,7 +21,7 @@ jobs: - uses: actions/stale@v9 with: # Only mark issues (not PRs) as stale - only-issue-labels: 'stat:awaiting-response' + any-of-labels: 'stat:awaiting-response' days-before-stale: 30 days-before-close: 30 stale-issue-label: 'Stale' From f6d498dfeae41d0a9b85b26854c0d4ea501fcdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Wed, 2 Apr 2025 10:56:06 +0200 Subject: [PATCH 15/23] chore: corrected IF statement for conversation GitHub Action (#3379) This is a quick PR to correct IF statement in our github action because with current state it was called (and failed) when PR was commented --- .github/workflows/conversation-labels.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conversation-labels.yaml b/.github/workflows/conversation-labels.yaml index 83eca10968..0297464bc5 100644 --- a/.github/workflows/conversation-labels.yaml +++ b/.github/workflows/conversation-labels.yaml @@ -21,7 +21,7 @@ env: jobs: conversation_labels: name: Calculate and update conversation labels of the issue - if: ${{ !github.event.issue.pull_request }} && ${{ github.event.issue.state == 'open' }} + if: ${{ !github.event.issue.pull_request && github.event.issue.state == 'open' }} runs-on: ubuntu-latest permissions: issues: write From c7996c63b3164093eacb58f354763d936775a56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:54:21 +0200 Subject: [PATCH 16/23] fix: [BACKPORT] android time test failures due to edge case float precision errors (#3352) This PR is a backport of https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/3351 Some changes were not included because those were already present on develop branch. All Android tests passed before merging Co-authored-by: Noel Stephens --- .../Tests/Runtime/Timing/TimeInitializationTest.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs index 507fbafac4..85e7ecca4e 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs @@ -43,10 +43,11 @@ public IEnumerator TestClientTimeInitializationOnConnect([Values(0, 1f)] float s yield return new WaitUntil(() => server.NetworkTickSystem.ServerTime.Tick > 2); var serverTimePassed = server.NetworkTickSystem.ServerTime.Time; - var expectedServerTickCount = Mathf.FloorToInt((float)(serverTimePassed * 30)); + // Use FixedDeltaTimeAsDouble and divide the tick frequency into the time passed to get the accurate tick count + var expectedServerTickCount = (int)System.Math.Floor(serverTimePassed / server.ServerTime.FixedDeltaTimeAsDouble); var ticksPassed = server.NetworkTickSystem.ServerTime.Tick - serverTick; - Assert.AreEqual(expectedServerTickCount, ticksPassed); + Assert.AreEqual(expectedServerTickCount, ticksPassed, $"Calculated tick failed: Tick ({expectedServerTickCount}) TicksPassed ({ticksPassed}) Server Tick ({server.NetworkTickSystem.ServerTime.Tick}) Prev-Server Tick ({serverTick})"); yield return new WaitForSeconds(clientStartDelay); From 011bd55c1bf04353b15c8cbf26e3867ffddfc807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Thu, 3 Apr 2025 10:45:26 +0200 Subject: [PATCH 17/23] chore: Issues marked by "stat:import" OR "stat:imported" labels won't be marked as "Stale" by automation (#3380) This quick PR add labels that can be assigned to issues to exclude them from being marked as stale as per https://github.com/actions/stale?tab=readme-ov-file#exempt-issue-labels. We don't want imported issues to get Stale and potentially automatically closed --- .github/workflows/mark-stale-issue.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mark-stale-issue.yaml b/.github/workflows/mark-stale-issue.yaml index 213ce2b613..acab5867cc 100644 --- a/.github/workflows/mark-stale-issue.yaml +++ b/.github/workflows/mark-stale-issue.yaml @@ -25,6 +25,7 @@ jobs: days-before-stale: 30 days-before-close: 30 stale-issue-label: 'Stale' + exempt-issue-labels: 'stat:import', 'stat:imported' stale-issue-message: > This issue has been automatically marked as stale because it has been awaiting response for over 30 days without any activity. From 9728a78f228085a328c40830fe43ff7d2d6d0549 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Thu, 3 Apr 2025 10:54:45 +0200 Subject: [PATCH 18/23] Corrected github action syntax typo --- .github/workflows/mark-stale-issue.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mark-stale-issue.yaml b/.github/workflows/mark-stale-issue.yaml index acab5867cc..2e77192183 100644 --- a/.github/workflows/mark-stale-issue.yaml +++ b/.github/workflows/mark-stale-issue.yaml @@ -25,7 +25,7 @@ jobs: days-before-stale: 30 days-before-close: 30 stale-issue-label: 'Stale' - exempt-issue-labels: 'stat:import', 'stat:imported' + exempt-issue-labels: 'stat:import,stat:imported' stale-issue-message: > This issue has been automatically marked as stale because it has been awaiting response for over 30 days without any activity. From 56a2f20ee04fbdeaa8cb62bbc3d0d88f0946b32f Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 7 Apr 2025 13:14:18 -0500 Subject: [PATCH 19/23] fix: NetworkAnimator logging error when a state has no destination information (#3384) This PR remove the error log when a state has no transition information associated with it. [MTTB-1153](https://jira.unity3d.com/browse/MTTB-1153) ## Changelog - Fixed: Issue where `NetworkAnimator` would log an error if there was no destination transition information. ## Testing and Documentation - No tests have been added. - No documentation changes or additions were necessary. --- com.unity.netcode.gameobjects/CHANGELOG.md | 1 + .../Components/NetworkAnimator.cs | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 4ea3d7cb38..9f7ad08456 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -16,6 +16,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Fixed +- Fixed issue where `NetworkAnimator` would log an error if there was no destination transition information. (#3384) - Fixed initial `NetworkTransform` spawn, ensure it uses world space. (#3361) - Fixed issue where `AnticipatedNetworkVariable` previous value returned by `AnticipatedNetworkVariable.OnAuthoritativeValueChanged` is updated correctly on the non-authoritative side. (#3322) diff --git a/com.unity.netcode.gameobjects/Components/NetworkAnimator.cs b/com.unity.netcode.gameobjects/Components/NetworkAnimator.cs index f588f818d7..e4fee5fadf 100644 --- a/com.unity.netcode.gameobjects/Components/NetworkAnimator.cs +++ b/com.unity.netcode.gameobjects/Components/NetworkAnimator.cs @@ -1226,10 +1226,11 @@ internal void UpdateAnimationState(AnimationState animationState) NetworkLog.LogError($"[DestinationState To Transition Info] Layer ({animationState.Layer}) sub-table does not contain destination state ({animationState.DestinationStateHash})!"); } } - else if (NetworkManager.LogLevel == LogLevel.Developer) - { - NetworkLog.LogError($"[DestinationState To Transition Info] Layer ({animationState.Layer}) does not exist!"); - } + // For reference, it is valid to have no transition information + //else if (NetworkManager.LogLevel == LogLevel.Developer) + //{ + // NetworkLog.LogError($"[DestinationState To Transition Info] Layer ({animationState.Layer}) does not exist!"); + //} } else if (animationState.Transition && animationState.CrossFade) { From 24be0bb01bd57b7e4fd5405f0426b13a04899446 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 15:27:37 +0200 Subject: [PATCH 20/23] some changes --- .github/workflows/assignee-management.yaml | 70 ------------------- .github/workflows/conversation-labels.yaml | 51 -------------- .github/workflows/mark-stale-issue.yaml | 39 ----------- .../remove-labels-on-issue-close.yaml | 40 ----------- 4 files changed, 200 deletions(-) delete mode 100644 .github/workflows/assignee-management.yaml delete mode 100644 .github/workflows/conversation-labels.yaml delete mode 100644 .github/workflows/mark-stale-issue.yaml delete mode 100644 .github/workflows/remove-labels-on-issue-close.yaml diff --git a/.github/workflows/assignee-management.yaml b/.github/workflows/assignee-management.yaml deleted file mode 100644 index 9c65e3338a..0000000000 --- a/.github/workflows/assignee-management.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# This workflow manages issue assignments and related label changes: -# 1. When someone is assigned to an issue: -# - Removes "stat:awaiting-triage" label -# - Adds "stat:Investigating" label -# 2. When all assignees are removed from an issue: -# - Adds "stat:awaiting-triage" label -# - Removes "stat:Investigating" label -# 3. When "stat:Investigating" label is added: -# - Automatically assigns the issue to the person who added the label - -name: Handle Issue Assignment and Labels - -on: - issues: - types: [assigned, unassigned, labeled] - -env: - AWAITING-TRIAGE_LABEL: stat:awaiting-triage - INVESTIGATING_LABEL: stat:Investigating - -jobs: - handle_assignment: - name: Handle Issue Assignment Changes - if: ${{ !github.event.issue.pull_request }} && ${{ github.event.issue.state == 'open' }} - runs-on: ubuntu-latest - permissions: - issues: write - - steps: - - name: Handle Assignment Changes - run: | - if [[ "${{ github.event.action }}" == "assigned" ]]; then - # Someone was assigned - remove awaiting-triage, add investigating - echo "ADD=${{ env.INVESTIGATING_LABEL }}" >> $GITHUB_ENV - echo "REMOVE=${{ env.AWAITING-TRIAGE_LABEL }}" >> $GITHUB_ENV - elif [[ "${{ github.event.action }}" == "unassigned" ]]; then - # Check if there are any remaining assignees - ASSIGNEES=$(echo '${{ toJson(github.event.issue.assignees) }}' | jq length) - if [[ "$ASSIGNEES" == "0" ]]; then - # No assignees left - add awaiting-triage, remove investigating - echo "ADD=${{ env.AWAITING-TRIAGE_LABEL }}" >> $GITHUB_ENV - echo "REMOVE=${{ env.INVESTIGATING_LABEL }}" >> $GITHUB_ENV - fi - fi - - - name: Update Labels - if: env.ADD != '' || env.REMOVE != '' - run: gh issue edit "$NUMBER" --add-label "$ADD" --remove-label "$REMOVE" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - NUMBER: ${{ github.event.issue.number }} - - handle_investigating_label: - name: Handle Investigating Label Addition - if: ${{ github.event.action == 'labeled' && github.event.label.name == 'stat:Investigating' && !github.event.issue.pull_request && github.event.issue.state == 'open' }} - runs-on: ubuntu-latest - permissions: - issues: write - - steps: - - name: Assign Issue to person that added Investigating Label - run: | - # Assign the issue to the person who added the label - gh issue edit "$NUMBER" --add-assignee "$ACTOR" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - NUMBER: ${{ github.event.issue.number }} - ACTOR: ${{ github.actor }} diff --git a/.github/workflows/conversation-labels.yaml b/.github/workflows/conversation-labels.yaml deleted file mode 100644 index 0297464bc5..0000000000 --- a/.github/workflows/conversation-labels.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# This workflow will update issues with proper "conversation related" labels. This mean that stat:awaiting-repsonse label will be present after Unity account made comments and stat:reply-needed will be present when user made latest comment - -name: Update conversation labels of the issue - -# Trigger for the workflow -# This trigger will populate the github.event object -# Details on properties are here: https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=created#issue_comment -on: - issue_comment: - types: [created] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.issue.number }} - cancel-in-progress: true - -# Define labels here -env: - AWAITING_RESPONSE: stat:awaiting-response - REPLY_NEEDED: stat:reply-needed - -jobs: - conversation_labels: - name: Calculate and update conversation labels of the issue - if: ${{ !github.event.issue.pull_request && github.event.issue.state == 'open' }} - runs-on: ubuntu-latest - permissions: - issues: write - - steps: - - name: Calculate labels - run: | - - if [[ "${{ github.event.comment.author_association }}" == "MEMBER" ]]; then - # Unity member commented - add awaiting-response, remove reply-needed - echo "ADD=${{ env.AWAITING_RESPONSE }}" >> $GITHUB_ENV - echo "REMOVE=${{ env.REPLY_NEEDED }}" >> $GITHUB_ENV - else - # Non-Unity member commented - add reply-needed, remove awaiting-response - echo "ADD=${{ env.REPLY_NEEDED }}" >> $GITHUB_ENV - echo "REMOVE=${{ env.AWAITING_RESPONSE }}" >> $GITHUB_ENV - fi - - - name: Update labels - # This runs a command using the github cli: https://cli.github.com/manual/gh_issue_edit - # If $ADD is set, it will add the label, otherwise it will remove the label - # There is no need to check if $ADD or $REMOVE is set, as the command will ignore it if it is empty - run: gh issue edit "$NUMBER" --add-label "$ADD" --remove-label "$REMOVE" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - NUMBER: ${{ github.event.issue.number }} diff --git a/.github/workflows/mark-stale-issue.yaml b/.github/workflows/mark-stale-issue.yaml deleted file mode 100644 index 2e77192183..0000000000 --- a/.github/workflows/mark-stale-issue.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# This workflow utilises an existing implementation (https://github.com/actions/stale) that performs the following actions: -# 1) Adds "stale" label to issues that have "stat:awaiting-response" for more than 30 days meaning that since we don't have enough information we may potentially close such issue -# 2) Closes issues that have been marked as "stale" for more than 30 days - -# This affects only Issues but at some point we may also consider rules for PRs - -name: Mark or Close Stale Issues - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' # Runs daily at midnight - -jobs: - stale: - runs-on: ubuntu-latest - permissions: - issues: write - - steps: - - uses: actions/stale@v9 - with: - # Only mark issues (not PRs) as stale - any-of-labels: 'stat:awaiting-response' - days-before-stale: 30 - days-before-close: 30 - stale-issue-label: 'Stale' - exempt-issue-labels: 'stat:import,stat:imported' - stale-issue-message: > - This issue has been automatically marked as stale because it has been awaiting - response for over 30 days without any activity. - - Please update the issue with any new information or it may be closed in 30 days. - close-issue-message: > - This issue has been automatically closed because it has been stale for 30 days - without any activity. Feel free to reopen if you have new information to add. - # Prevent the action from marking/closing PRs - days-before-pr-stale: -1 - days-before-pr-close: -1 diff --git a/.github/workflows/remove-labels-on-issue-close.yaml b/.github/workflows/remove-labels-on-issue-close.yaml deleted file mode 100644 index 2ac5145e16..0000000000 --- a/.github/workflows/remove-labels-on-issue-close.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow will remove almost all labels from closed issues beside ones that could be relevant for future tracking like: "port:", "type:", "priority:", "regression" and "stat:imported" - -name: Remove labels when issue is closed - -on: - issues: - types: [closed] # We want it to run on closed issues - -jobs: - remove_labels: - name: Calculate and remove issue labels - if: ${{ !github.event.issue.pull_request }} # This is needed to distinguish from PRs (which we don't want to affect) - runs-on: ubuntu-latest - permissions: - issues: write - - steps: - - name: Find labels to remove - id: data - run: | - # Convert labels to array and filter out type: labels - LABELS_TO_REMOVE=($(echo "$EXISTING_LABELS" | jq -r '.[] | select(startswith("type:") or startswith("port:") or startswith("priority:") or . == "regression" or . == "stat:imported" | not)')) - - # Only proceed if we have labels to remove - if [ ${#LABELS_TO_REMOVE[@]} -gt 0 ]; then - echo "REMOVE_LABELS=$(IFS=,; echo "${LABELS_TO_REMOVE[*]}")" >> $GITHUB_ENV - echo "HAS_LABELS=true" >> $GITHUB_ENV - else - echo "HAS_LABELS=false" >> $GITHUB_ENV - fi - env: - EXISTING_LABELS: ${{ toJson(github.event.issue.labels.*.name) }} - - - name: Remove labels - if: ${{ env.REMOVE_LABELS != '' }} - run: gh issue edit "$NUMBER" --remove-label "$REMOVE_LABELS" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - NUMBER: ${{ github.event.issue.number }} From 83322e80f8171a7d5707f06c0b67965e93a910bb Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 15:41:50 +0200 Subject: [PATCH 21/23] bacport-verification --- .github/workflows/backport-verification.yml | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/backport-verification.yml diff --git a/.github/workflows/backport-verification.yml b/.github/workflows/backport-verification.yml new file mode 100644 index 0000000000..17b02ba6c0 --- /dev/null +++ b/.github/workflows/backport-verification.yml @@ -0,0 +1,25 @@ +name: "NGO - Backport Verification" + +on: + pull_request: + branches: + - develop + - develop-2.0.0 + +jobs: + backport-verification: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check PR description + uses: actions/github-script@v6 + with: + script: | + const pr = context.payload.pull_request; + const body = pr.body || ''; + + if (!body.includes('## Backports')) { + core.setFailed('PR description must include a "## Backports" section. Please add this section and provide appropriate information or explain why backports are not needed.'); + } \ No newline at end of file From de8ccaf22dc1004639aad0fffb1e77d666b66851 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 15:44:50 +0200 Subject: [PATCH 22/23] corrected message --- .github/workflows/backport-verification.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backport-verification.yml b/.github/workflows/backport-verification.yml index 17b02ba6c0..f10f0cce8b 100644 --- a/.github/workflows/backport-verification.yml +++ b/.github/workflows/backport-verification.yml @@ -20,6 +20,6 @@ jobs: const pr = context.payload.pull_request; const body = pr.body || ''; - if (!body.includes('## Backports')) { - core.setFailed('PR description must include a "## Backports" section. Please add this section and provide appropriate information or explain why backports are not needed.'); + if (!body.includes('## Backport')) { + core.setFailed('PR description must include a "## Backport" section. Please add this section and provide information about this PR backport to develop or develop-2.0.0 branch or explain why backport is not needed.'); } \ No newline at end of file From 4d80ab0a56070357145473e275d1bc6fea480ddb Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 15:49:28 +0200 Subject: [PATCH 23/23] Running test on edited PRs --- .github/workflows/backport-verification.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/backport-verification.yml b/.github/workflows/backport-verification.yml index f10f0cce8b..2ce2b645ed 100644 --- a/.github/workflows/backport-verification.yml +++ b/.github/workflows/backport-verification.yml @@ -2,6 +2,7 @@ on: pull_request: + types: [opened, edited] branches: - develop - develop-2.0.0