Ruo-Ping Dong
4 年前
当前提交
deeea398
共有 74 个文件被更改,包括 870 次插入 和 686 次删除
-
100.yamato/com.unity.ml-agents-optional-dep-tests.yml
-
263.yamato/com.unity.ml-agents-test.yml
-
6Project/Assets/ML-Agents/Examples/Basic/Scripts/BasicSensorComponent.cs
-
8Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/SensorBase.cs
-
4Project/Assets/ML-Agents/TestScenes/TestCompressedTexture/TestTextureSensor.cs
-
16Project/Assets/ML-Agents/TestScenes/TestCompressedTexture/TestTextureSensorComponent.cs
-
14com.unity.ml-agents.extensions/Runtime/Match3/Match3Sensor.cs
-
14com.unity.ml-agents.extensions/Runtime/Match3/Match3SensorComponent.cs
-
20com.unity.ml-agents.extensions/Runtime/Sensors/ArticulationBodySensorComponent.cs
-
11com.unity.ml-agents.extensions/Runtime/Sensors/GridSensor.cs
-
10com.unity.ml-agents.extensions/Runtime/Sensors/PhysicsBodySensor.cs
-
20com.unity.ml-agents.extensions/Runtime/Sensors/RigidBodySensorComponent.cs
-
43com.unity.ml-agents.extensions/Tests/Editor/Match3/Match3SensorTests.cs
-
19com.unity.ml-agents.extensions/Tests/Editor/Sensors/ChannelHotShapeTests.cs
-
15com.unity.ml-agents.extensions/Tests/Editor/Sensors/ChannelShapeTests.cs
-
27com.unity.ml-agents.extensions/Tests/Editor/Sensors/GridSensorTestUtils.cs
-
6com.unity.ml-agents.extensions/Tests/Runtime/Sensors/ArticulationBodySensorTests.cs
-
6com.unity.ml-agents.extensions/Tests/Runtime/Sensors/RigidBodySensorTests.cs
-
3com.unity.ml-agents.extensions/package.json
-
8com.unity.ml-agents/CHANGELOG.md
-
16com.unity.ml-agents/Editor/RayPerceptionSensorComponentBaseEditor.cs
-
14com.unity.ml-agents/Editor/Unity.ML-Agents.Editor.asmdef
-
14com.unity.ml-agents/Runtime/Agent.cs
-
2com.unity.ml-agents/Runtime/Analytics/Events.cs
-
18com.unity.ml-agents/Runtime/Analytics/InferenceAnalytics.cs
-
29com.unity.ml-agents/Runtime/Analytics/TrainingAnalytics.cs
-
44com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs
-
20com.unity.ml-agents/Runtime/Policies/BarracudaPolicy.cs
-
4com.unity.ml-agents/Runtime/Policies/HeuristicPolicy.cs
-
14com.unity.ml-agents/Runtime/Policies/RemotePolicy.cs
-
6com.unity.ml-agents/Runtime/Sensors/BufferSensor.cs
-
6com.unity.ml-agents/Runtime/Sensors/BufferSensorComponent.cs
-
5com.unity.ml-agents/Runtime/Sensors/CameraSensor.cs
-
15com.unity.ml-agents/Runtime/Sensors/CameraSensorComponent.cs
-
24com.unity.ml-agents/Runtime/Sensors/ISensor.cs
-
14com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensor.cs
-
2com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensorComponent2D.cs
-
18com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensorComponentBase.cs
-
5com.unity.ml-agents/Runtime/Sensors/Reflection/ReflectionSensorBase.cs
-
5com.unity.ml-agents/Runtime/Sensors/RenderTextureSensor.cs
-
16com.unity.ml-agents/Runtime/Sensors/RenderTextureSensorComponent.cs
-
7com.unity.ml-agents/Runtime/Sensors/SensorComponent.cs
-
27com.unity.ml-agents/Runtime/Sensors/StackingSensor.cs
-
6com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs
-
10com.unity.ml-agents/Runtime/Unity.ML-Agents.asmdef
-
7com.unity.ml-agents/Runtime/Utilities.cs
-
12com.unity.ml-agents/Tests/Editor/Analytics/TrainingAnalyticsTest.cs
-
137com.unity.ml-agents/Tests/Editor/Communicator/GrpcExtensionsTests.cs
-
11com.unity.ml-agents/Tests/Editor/Inference/ParameterLoaderTest.cs
-
40com.unity.ml-agents/Tests/Editor/MLAgentsEditModeTest.cs
-
2com.unity.ml-agents/Tests/Editor/PublicAPI/PublicApiValidation.cs
-
10com.unity.ml-agents/Tests/Editor/Unity.ML-Agents.Editor.Tests.asmdef
-
24com.unity.ml-agents/Tests/Runtime/RuntimeAPITest.cs
-
4com.unity.ml-agents/Tests/Runtime/Sensor/BufferSensorTest.cs
-
7com.unity.ml-agents/Tests/Runtime/Sensor/CameraSensorComponentTest.cs
-
4com.unity.ml-agents/Tests/Runtime/Sensor/FloatVisualSensorTests.cs
-
16com.unity.ml-agents/Tests/Runtime/Sensor/RayPerceptionSensorTests.cs
-
5com.unity.ml-agents/Tests/Runtime/Sensor/RenderTextureSensorComponentTests.cs
-
6com.unity.ml-agents/Tests/Runtime/Sensor/SensorShapeValidatorTests.cs
-
20com.unity.ml-agents/Tests/Runtime/Sensor/StackingSensorTests.cs
-
12com.unity.ml-agents/Tests/Runtime/Sensor/Unity.ML-Agents.Runtime.Sensor.Tests.asmdef
-
12com.unity.ml-agents/Tests/Runtime/Unity.ML-Agents.Runtime.Tests.asmdef
-
5com.unity.ml-agents/Tests/Runtime/Utils/TestClasses.cs
-
4com.unity.ml-agents/package.json
-
27docs/Migrating.md
-
4markdown-link-check.full.json
-
40.yamato/com.unity.ml-agents-coverage.yml
-
17.yamato/coverage_tests.metafile
-
109com.unity.ml-agents/Runtime/Sensors/CompressionSpec.cs
-
3com.unity.ml-agents/Runtime/Sensors/CompressionSpec.cs.meta
-
30com.unity.ml-agents/Tests/Runtime/Sensor/CompressionSpecTests.cs
-
3com.unity.ml-agents/Tests/Runtime/Sensor/CompressionSpecTests.cs.meta
-
20com.unity.ml-agents/Runtime/Sensors/ISparseChannelSensor.cs
-
11com.unity.ml-agents/Runtime/Sensors/ISparseChannelSensor.cs.meta
|
|||
OptionalDependencyTestsLinux: |
|||
name : LinuxOptionalDependenciesTests |
|||
agent: |
|||
type: Unity::VM |
|||
image: package-ci/ubuntu:stable |
|||
flavor: b1.medium |
|||
commands: |
|||
- | |
|||
curl -L https://artifactory.prd.it.unity3d.com/artifactory/api/gpg/key/public | sudo apt-key add - |
|||
sudo sh -c "echo 'deb https://artifactory.prd.it.unity3d.com/artifactory/unity-apt-local bionic main' > /etc/apt/sources.list.d/unity.list" |
|||
sudo apt update |
|||
sudo apt install -y unity-config |
|||
npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
unity-config settings editor-path ./.Editor |
|||
unity-config project create opt-deps-test |
|||
unity-config project add dependency com.unity.ml-agents/ |
|||
unity-config project add testable com.unity.ml-agents |
|||
unity-config project add dependency com.unity.modules.imageconversion@1.0.0 |
|||
unity-config project add dependency com.unity.modules.jsonserialize@1.0.0 |
|||
unity-config project add dependency com.unity.modules.physics@1.0.0 |
|||
unity-config project add dependency com.unity.modules.physics2d@1.0.0 |
|||
upm-ci project test -u 2019.4 --type project-tests --project-path opt-deps-test --package-filter com.unity.ml-agents |
|||
artifacts: |
|||
logs: |
|||
paths: |
|||
- "upm-ci~/test-results/**/*" |
|||
dependencies: |
|||
- .yamato/com.unity.ml-agents-pack.yml#pack |
|||
triggers: |
|||
cancel_old_ci: true |
|||
expression: | |
|||
(pull_request.target eq "main" OR |
|||
pull_request.target match "release.+") AND |
|||
NOT pull_request.draft AND |
|||
(pull_request.changes.any match "com.unity.ml-agents/**" OR |
|||
pull_request.changes.any match ".yamato/com.unity.ml-agents-test.yml") |
|||
optional_deps: |
|||
- name: Analytics |
|||
project: "OptionalDepedencyTests/NoAnalyticsModule" |
|||
version: 2020.2 |
|||
- name: Physics |
|||
project: OptionalDepedencyTests/NoPhysicsModule |
|||
version: 2020.2 |
|||
- name: Physics2D |
|||
project: OptionalDepedencyTests/NoPhysics2DModule |
|||
version: 2020.2 |
|||
--- |
|||
|
|||
{% for optional_dep in optional_deps %} |
|||
OptionalDependencyTests_{{ optional_dep.name }}: |
|||
name : Test Optional Package Dependencies {{ optional_dep.name }} |
|||
agent: |
|||
type: Unity::VM |
|||
image: package-ci/ubuntu:stable |
|||
flavor: b1.medium |
|||
commands: |
|||
- | |
|||
curl -L https://artifactory.prd.it.unity3d.com/artifactory/api/gpg/key/public | sudo apt-key add - |
|||
sudo sh -c "echo 'deb https://artifactory.prd.it.unity3d.com/artifactory/unity-apt-local bionic main' > /etc/apt/sources.list.d/unity.list" |
|||
sudo apt update |
|||
sudo apt install -y unity-config |
|||
npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
unity-config settings editor-path ./.Editor |
|||
unity-config project create opt-deps-test |
|||
unity-config project add dependency com.unity.ml-agents/ |
|||
unity-config project add testable com.unity.ml-agents |
|||
unity-config project add dependency com.unity.modules.imageconversion@1.0.0 |
|||
unity-config project add dependency com.unity.modules.jsonserialize@1.0.0 |
|||
{% unless optional_dep.name == "Physics" %} |
|||
unity-config project add dependency com.unity.modules.physics@1.0.0 |
|||
{% endunless %} |
|||
{% unless optional_dep.name == "Physics2D" %} |
|||
unity-config project add dependency com.unity.modules.physics2d@1.0.0 |
|||
{% endunless %} |
|||
{% unless optional_dep.name == "Analytics" %} |
|||
unity-config project add dependency com.unity.modules.unityanalytics@1.0.0 |
|||
{% endunless %} |
|||
upm-ci project test -u {{ optional_dep.version }} --type project-tests --project-path opt-deps-test --package-filter com.unity.ml-agents |
|||
artifacts: |
|||
logs: |
|||
paths: |
|||
- "upm-ci~/test-results/**/*" |
|||
dependencies: |
|||
- .yamato/com.unity.ml-agents-pack.yml#pack |
|||
{% for coverage_editor in coverage_test_editors %} |
|||
{% for coverage_plathform in coverage_test_platforms %} |
|||
{% for coverage_package in coverage_test_packages %} |
|||
- .yamato/com.unity.ml-agents-coverage.yml#test_coverage_{{ coverage_package.name }}_{{ coverage_platform.name }}_{{ coverage_editor.version }} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
triggers: |
|||
cancel_old_ci: true |
|||
expression: | |
|||
(pull_request.target eq "main" OR |
|||
pull_request.target match "release.+") AND |
|||
NOT pull_request.draft AND |
|||
(pull_request.changes.any match "com.unity.ml-agents/**" OR |
|||
pull_request.changes.any match ".yamato/com.unity.ml-agents-test.yml") |
|||
{% endfor %} |
|||
|
|
|||
{% metadata_file .yamato/coverage_tests.metafile %} |
|||
- version: 2019.4 |
|||
enableCodeCoverage: !!bool true |
|||
# We want some scene tests to run in the DevProject, but packages there only support 2020+ |
|||
testProject: Project |
|||
enableNoDefaultPackages: !!bool true |
|||
- version: 2020.2 |
|||
enableCodeCoverage: !!bool true |
|||
testProject: DevProject |
|||
enableNoDefaultPackages: !!bool true |
|||
- version: 2021.1 |
|||
enableCodeCoverage: !!bool true |
|||
testProject: DevProject |
|||
enableNoDefaultPackages: !!bool true |
|||
- version: 2019.4 |
|||
enableCodeCoverage: !!bool true |
|||
# We want some scene tests to run in the DevProject, but packages there only support 2020+ |
|||
testProject: Project |
|||
enableNoDefaultPackages: !!bool true |
|||
- version: 2020.2 |
|||
enableCodeCoverage: !!bool true |
|||
testProject: DevProject |
|||
enableNoDefaultPackages: !!bool true |
|||
- version: 2021.1 |
|||
enableCodeCoverage: !!bool true |
|||
testProject: DevProject |
|||
enableNoDefaultPackages: !!bool true |
|||
- version: trunk |
|||
# Workaround for MLA-1596 - need to make sure we load the right results. |
|||
enableCodeCoverage: !!bool false |
|||
testProject: DevProject |
|||
- version: trunk |
|||
# Workaround for MLA-1596 - need to make sure we load the right results. |
|||
enableCodeCoverage: !!bool false |
|||
testProject: DevProject |
|||
- name: win |
|||
type: Unity::VM |
|||
image: package-ci/win10:stable |
|||
flavor: b1.large |
|||
- name: mac |
|||
type: Unity::VM::osx |
|||
image: package-ci/mac:stable |
|||
flavor: b1.small |
|||
- name: linux |
|||
type: Unity::VM |
|||
image: package-ci/ubuntu:stable |
|||
flavor: b1.medium |
|||
- name: win |
|||
type: Unity::VM |
|||
image: package-ci/win10:stable |
|||
flavor: b1.large |
|||
- name: mac |
|||
type: Unity::VM::osx |
|||
image: package-ci/mac:stable |
|||
flavor: b1.small |
|||
- name: linux |
|||
type: Unity::VM |
|||
image: package-ci/ubuntu:stable |
|||
flavor: b1.medium |
|||
- name: com.unity.ml-agents |
|||
assembly: Unity.ML-Agents |
|||
minCoveragePct: 72 |
|||
- name: com.unity.ml-agents.extensions |
|||
assembly: Unity.ML-Agents.Extensions* |
|||
minCoveragePct: 75 |
|||
- name: com.unity.ml-agents |
|||
assembly: Unity.ML-Agents |
|||
minCoveragePct: 72 |
|||
- name: com.unity.ml-agents.extensions |
|||
assembly: Unity.ML-Agents.Extensions* |
|||
minCoveragePct: 75 |
|||
name: Run All Combinations of Editors/Platforms Tests |
|||
dependencies: |
|||
{% for editor in test_editors %} |
|||
{% for platform in test_platforms %} |
|||
- .yamato/com.unity.ml-agents-test.yml#test_com.unity.ml-agents_{{ platform.name }}_{{ editor.version }} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
|
|||
{% for editor in trunk_editor %} |
|||
{% for platform in test_platforms %} |
|||
- .yamato/com.unity.ml-agents-test.yml#test_com.unity.ml-agents_{{ platform.name }}_{{ editor.version }} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
triggers: |
|||
cancel_old_ci: true |
|||
recurring: |
|||
- branch: main |
|||
frequency: daily |
|||
name: Run All Combinations of Editors/Platforms Tests |
|||
dependencies: |
|||
{% for coverage_editor in coverage_test_editors %} |
|||
{% for coverage_plathform in coverage_test_platforms %} |
|||
{% for coverage_package in coverage_test_packages %} |
|||
- .yamato/com.unity.ml-agents-coverage.yml#test_coverage_{{ coverage_package.name }}_{{ coverage_platform.name }}_{{ coverage_editor.version }} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% for editor in test_editors %} |
|||
{% for platform in test_platforms %} |
|||
- .yamato/com.unity.ml-agents-test.yml#test_com.unity.ml-agents_{{ platform.name }}_{{ editor.version }} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% for editor in trunk_editor %} |
|||
{% for platform in test_platforms %} |
|||
- .yamato/com.unity.ml-agents-test.yml#test_com.unity.ml-agents_{{ platform.name }}_{{ editor.version }} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
triggers: |
|||
cancel_old_ci: true |
|||
recurring: |
|||
- branch: main |
|||
frequency: daily |
|||
{% for package in packages %} |
|||
{% for package in packages %} |
|||
{% for platform in test_platforms %} |
|||
{% for platform in test_platforms %} |
|||
{% if editor.enableCodeCoverage %} |
|||
{% capture coverageOptions %} --enable-code-coverage --code-coverage-options 'generateHtmlReport;assemblyFilters:+{{ package.assembly }}'{% endcapture %} |
|||
{% else %} |
|||
{% assign coverageOptions = "" %} |
|||
{% endif %} |
|||
|
|||
{% if editor.enableNoDefaultPackages %} |
|||
{% if editor.enableNoDefaultPackages %} |
|||
{% else %} |
|||
{% else %} |
|||
{% endif %} |
|||
{% endif %} |
|||
name : {{ package.name }} test {{ editor.version }} on {{ platform.name }} |
|||
agent: |
|||
type: {{ platform.type }} |
|||
image: {{ platform.image }} |
|||
flavor: {{ platform.flavor}} |
|||
commands: |
|||
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
- upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} {{ noDefaultPackagesOptions }} --extra-utr-arg "reruncount=2" |
|||
{% if editor.enableCodeCoverage %} |
|||
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }} |
|||
{% endif %} |
|||
artifacts: |
|||
logs: |
|||
paths: |
|||
- "upm-ci~/test-results/**/*" |
|||
dependencies: |
|||
- .yamato/com.unity.ml-agents-pack.yml#pack |
|||
triggers: |
|||
cancel_old_ci: true |
|||
{% if platform.name == "linux" %} |
|||
expression: | |
|||
(pull_request.target eq "main" OR |
|||
pull_request.target match "release.+") AND |
|||
NOT pull_request.draft AND |
|||
(pull_request.changes.any match "com.unity.ml-agents/**" OR |
|||
pull_request.changes.any match " {{ editor.testProject }}/**" OR |
|||
{% if package.name == "com.unity.ml-agents.extensions" %} |
|||
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR |
|||
name : {{ package.name }} test {{ editor.version }} on {{ platform.name }} |
|||
agent: |
|||
type: {{ platform.type }} |
|||
image: {{ platform.image }} |
|||
flavor: {{ platform.flavor}} |
|||
commands: |
|||
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
- upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ noDefaultPackagesOptions }} --extra-utr-arg "reruncount=2" |
|||
artifacts: |
|||
logs: |
|||
paths: |
|||
- "upm-ci~/test-results/**/*" |
|||
dependencies: |
|||
- .yamato/com.unity.ml-agents-pack.yml#pack |
|||
{% for coverage_editor in coverage_test_editors %} |
|||
{% for coverage_plathform in coverage_test_platforms %} |
|||
{% for coverage_package in coverage_test_packages %} |
|||
- .yamato/com.unity.ml-agents-coverage.yml#test_coverage_{{ coverage_package.name }}_{{ coverage_platform.name }}_{{ coverage_editor.version }} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
triggers: |
|||
cancel_old_ci: true |
|||
{% if platform.name == "linux" %} |
|||
expression: | |
|||
(pull_request.target eq "main" OR |
|||
pull_request.target match "release.+") AND |
|||
NOT pull_request.draft AND |
|||
(pull_request.changes.any match "com.unity.ml-agents/**" OR |
|||
pull_request.changes.any match " {{ editor.testProject }}/**" OR |
|||
{% if package.name == "com.unity.ml-agents.extensions" %} |
|||
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR |
|||
{% endif %} |
|||
pull_request.changes.any match ".yamato/com.unity.ml-agents-test.yml") |
|||
pull_request.changes.any match ".yamato/com.unity.ml-agents-test.yml") |
|||
{% endif %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% for package in packages %} |
|||
{% for package in packages %} |
|||
{% for platform in test_platforms %} |
|||
{% for platform in test_platforms %} |
|||
{% if editor.enableCodeCoverage %} |
|||
{% if editor.enableCodeCoverage %} |
|||
{% else %} |
|||
{% assign coverageOptions = "" %} |
|||
{% endif %} |
|||
{% else %} |
|||
{% assign coverageOptions = "" %} |
|||
{% endif %} |
|||
name : {{ package.name }} test {{ editor.version }} on {{ platform.name }} |
|||
agent: |
|||
type: {{ platform.type }} |
|||
image: {{ platform.image }} |
|||
flavor: {{ platform.flavor}} |
|||
commands: |
|||
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade |
|||
- unity-downloader-cli -u trunk -c editor --wait --fast |
|||
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
- upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} --extra-create-project-arg="-upmNoDefaultPackages" --extra-utr-arg "reruncount=2" |
|||
{% if editor.enableCodeCoverage %} |
|||
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }} |
|||
{% endif %} |
|||
artifacts: |
|||
logs: |
|||
paths: |
|||
- "upm-ci~/test-results/**/*" |
|||
dependencies: |
|||
- .yamato/com.unity.ml-agents-pack.yml#pack |
|||
triggers: |
|||
cancel_old_ci: true |
|||
{% endfor %} |
|||
name : {{ package.name }} test {{ editor.version }} on {{ platform.name }} |
|||
agent: |
|||
type: {{ platform.type }} |
|||
image: {{ platform.image }} |
|||
flavor: {{ platform.flavor}} |
|||
commands: |
|||
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade |
|||
- unity-downloader-cli -u trunk -c editor --wait --fast |
|||
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
- upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} --extra-create-project-arg="-upmNoDefaultPackages" --extra-utr-arg "reruncount=2" |
|||
{% if editor.enableCodeCoverage %} |
|||
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }} |
|||
{% endif %} |
|||
artifacts: |
|||
logs: |
|||
paths: |
|||
- "upm-ci~/test-results/**/*" |
|||
dependencies: |
|||
- .yamato/com.unity.ml-agents-pack.yml#pack |
|||
{% for coverage_editor in coverage_test_editors %} |
|||
{% for coverage_plathform in coverage_test_platforms %} |
|||
{% for coverage_package in coverage_test_packages %} |
|||
- .yamato/com.unity.ml-agents-coverage.yml#test_coverage_{{ coverage_package.name }}_{{ coverage_platform.name }}_{{ coverage_editor.version }} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
triggers: |
|||
cancel_old_ci: true |
|||
{% endfor %} |
|||
{% endfor %} |
|||
|
|||
{% endfor %} |
|
|||
{% metadata_file .yamato/coverage_tests.metafile %} |
|||
--- |
|||
{% for package in coverage_test_packages %} |
|||
{% for editor in coverage_test_editors %} |
|||
{% for platform in coverage_test_platforms %} |
|||
{% capture coverageOptions %} --enable-code-coverage --code-coverage-options 'generateHtmlReport;assemblyFilters:+{{ package.assembly }}'{% endcapture %} |
|||
|
|||
test_coverage_{{ package.name }}_{{ platform.name }}_{{ editor.version }}: |
|||
name : Coverage {{ package.name }} test {{ editor.version }} on {{ platform.name }} |
|||
agent: |
|||
type: {{ platform.type }} |
|||
image: {{ platform.image }} |
|||
flavor: {{ platform.flavor}} |
|||
commands: |
|||
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
- upm-ci project test -u {{ editor.version }} --type project-tests --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} --extra-utr-arg "reruncount=2" |
|||
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }} |
|||
artifacts: |
|||
logs: |
|||
paths: |
|||
- "upm-ci~/test-results/**/*" |
|||
dependencies: |
|||
- .yamato/com.unity.ml-agents-pack.yml#pack |
|||
triggers: |
|||
cancel_old_ci: true |
|||
{% if platform.name == "linux" %} |
|||
expression: | |
|||
(pull_request.target eq "main" OR |
|||
pull_request.target match "release.+") AND |
|||
NOT pull_request.draft AND |
|||
(pull_request.changes.any match "com.unity.ml-agents/**" OR |
|||
pull_request.changes.any match " {{ editor.testProject }}/**" OR |
|||
{% if package.name == "com.unity.ml-agents.extensions" %} |
|||
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR |
|||
{% endif %} |
|||
pull_request.changes.any match ".yamato/com.unity.ml-agents-test.yml") |
|||
{% endif %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endfor %} |
|
|||
coverage_test_editors: |
|||
- version: 2020.2 |
|||
testProject: DevProject |
|||
|
|||
coverage_test_platforms: |
|||
- name: linux |
|||
type: Unity::VM |
|||
image: package-ci/ubuntu:stable |
|||
flavor: b1.medium |
|||
|
|||
coverage_test_packages: |
|||
- name: com.unity.ml-agents |
|||
assembly: Unity.ML-Agents |
|||
minCoveragePct: 72 |
|||
- name: com.unity.ml-agents.extensions |
|||
assembly: Unity.ML-Agents.Extensions* |
|||
minCoveragePct: 75 |
|
|||
using System.Linq; |
|||
namespace Unity.MLAgents.Sensors |
|||
{ |
|||
/// <summary>
|
|||
/// The compression setting for visual/camera observations.
|
|||
/// </summary>
|
|||
public enum SensorCompressionType |
|||
{ |
|||
/// <summary>
|
|||
/// No compression. Data is preserved as float arrays.
|
|||
/// </summary>
|
|||
None, |
|||
|
|||
/// <summary>
|
|||
/// PNG format. Data will be stored in binary format.
|
|||
/// </summary>
|
|||
PNG |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// A description of the compression used for observations.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// Most ISensor implementations can't take advantage of compression,
|
|||
/// and should return CompressionSpec.Default() from their ISensor.GetCompressionSpec() methods.
|
|||
/// Visual observations, or mulitdimensional categorical observations (for example, image segmentation
|
|||
/// or the piece types in a match-3 game board) can use PNG compression reduce the amount of
|
|||
/// data transferred between Unity and the trainer.
|
|||
/// </remarks>
|
|||
public struct CompressionSpec |
|||
{ |
|||
internal SensorCompressionType m_SensorCompressionType; |
|||
|
|||
/// <summary>
|
|||
/// The compression type that the sensor will use for its observations.
|
|||
/// </summary>
|
|||
public SensorCompressionType SensorCompressionType |
|||
{ |
|||
get => m_SensorCompressionType; |
|||
} |
|||
|
|||
internal int[] m_CompressedChannelMapping; |
|||
|
|||
/// The mapping of the channels in compressed data to the actual channel after decompression.
|
|||
/// The mapping is a list of integer index with the same length as
|
|||
/// the number of output observation layers (channels), including padding if there's any.
|
|||
/// Each index indicates the actual channel the layer will go into.
|
|||
/// Layers with the same index will be averaged, and layers with negative index will be dropped.
|
|||
/// For example, mapping for CameraSensor using grayscale and stacking of two: [0, 0, 0, 1, 1, 1]
|
|||
/// Mapping for GridSensor of 4 channels and stacking of two: [0, 1, 2, 3, -1, -1, 4, 5, 6, 7, -1, -1]
|
|||
public int[] CompressedChannelMapping |
|||
{ |
|||
get => m_CompressedChannelMapping; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Return a CompressionSpec indicating possible compression.
|
|||
/// </summary>
|
|||
/// <param name="sensorCompressionType">The compression type to use.</param>
|
|||
/// <param name="compressedChannelMapping">Optional mapping mapping of the channels in compressed data to the
|
|||
/// actual channel after decompression.</param>
|
|||
public CompressionSpec(SensorCompressionType sensorCompressionType, int[] compressedChannelMapping = null) |
|||
{ |
|||
m_SensorCompressionType = sensorCompressionType; |
|||
m_CompressedChannelMapping = compressedChannelMapping; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Return a CompressionSpec indicating no compression. This is recommended for most sensors.
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
public static CompressionSpec Default() |
|||
{ |
|||
return new CompressionSpec |
|||
{ |
|||
m_SensorCompressionType = SensorCompressionType.None, |
|||
m_CompressedChannelMapping = null |
|||
}; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Return whether the compressed channel mapping is "trivial"; if so it doesn't need to be sent to the
|
|||
/// trainer.
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
internal bool IsTrivialMapping() |
|||
{ |
|||
var mapping = CompressedChannelMapping; |
|||
if (mapping == null) |
|||
{ |
|||
return true; |
|||
} |
|||
// check if mapping equals zero mapping
|
|||
if (mapping.Length == 3 && mapping.All(m => m == 0)) |
|||
{ |
|||
return true; |
|||
} |
|||
// check if mapping equals identity mapping
|
|||
for (var i = 0; i < mapping.Length; i++) |
|||
{ |
|||
if (mapping[i] != i) |
|||
{ |
|||
return false; |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0ddff1d1b7ad4170acb1a10272d4a8c2 |
|||
timeCreated: 1616006929 |
|
|||
using NUnit.Framework; |
|||
using Unity.MLAgents.Sensors; |
|||
|
|||
namespace Unity.MLAgents.Tests |
|||
{ |
|||
[TestFixture] |
|||
public class CompressionSpecTests |
|||
{ |
|||
[Test] |
|||
public void TestIsTrivialMapping() |
|||
{ |
|||
Assert.IsTrue(CompressionSpec.Default().IsTrivialMapping()); |
|||
|
|||
var spec = new CompressionSpec(SensorCompressionType.PNG, null); |
|||
Assert.AreEqual(spec.IsTrivialMapping(), true); |
|||
|
|||
spec = new CompressionSpec(SensorCompressionType.PNG, new[] { 0, 0, 0 }); |
|||
Assert.AreEqual(spec.IsTrivialMapping(), true); |
|||
|
|||
spec = new CompressionSpec(SensorCompressionType.PNG, new[] { 0, 1, 2, 3, 4 }); |
|||
Assert.AreEqual(spec.IsTrivialMapping(), true); |
|||
|
|||
spec = new CompressionSpec(SensorCompressionType.PNG, new[] { 1, 2, 3, 4, -1, -1 }); |
|||
Assert.AreEqual(spec.IsTrivialMapping(), false); |
|||
|
|||
spec = new CompressionSpec(SensorCompressionType.PNG, new[] { 0, 0, 0, 1, 1, 1 }); |
|||
Assert.AreEqual(spec.IsTrivialMapping(), false); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: cd0990de0eb646b0b0531b91c840c9da |
|||
timeCreated: 1616030728 |
|
|||
namespace Unity.MLAgents.Sensors |
|||
{ |
|||
/// <summary>
|
|||
/// Sensor interface for sparse channel sensor which requires a compressed channel mapping.
|
|||
/// </summary>
|
|||
public interface ISparseChannelSensor : ISensor |
|||
{ |
|||
/// <summary>
|
|||
/// Returns the mapping of the channels in compressed data to the actual channel after decompression.
|
|||
/// The mapping is a list of interger index with the same length as
|
|||
/// the number of output observation layers (channels), including padding if there's any.
|
|||
/// Each index indicates the actual channel the layer will go into.
|
|||
/// Layers with the same index will be averaged, and layers with negative index will be dropped.
|
|||
/// For example, mapping for CameraSensor using grayscale and stacking of two: [0, 0, 0, 1, 1, 1]
|
|||
/// Mapping for GridSensor of 4 channels and stacking of two: [0, 1, 2, 3, -1, -1, 4, 5, 6, 7, -1, -1]
|
|||
/// </summary>
|
|||
/// <returns>Mapping of the compressed data</returns>
|
|||
int[] GetCompressedChannelMapping(); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 63bb76c1e31c24fa5b4a384ea0edbfb0 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue