浏览代码

remove trunk tests, fix version parsing in unit test

/tag-com.unity.ml-agents_1.0.8
Chris Elion 3 年前
当前提交
208bea12
共有 2 个文件被更改,包括 9 次插入40 次删除
  1. 39
      .yamato/com.unity.ml-agents-test.yml
  2. 10
      com.unity.ml-agents/Tests/Editor/TensorUtilsTest.cs

39
.yamato/com.unity.ml-agents-test.yml


coverageOptions: --enable-code-coverage --code-coverage-options 'generateHtmlReport;assemblyFilters:+Unity.ML-Agents'
minCoveragePct: 72
testProject: DevProject
trunk_editor:
- version: trunk
coverageOptions: --enable-code-coverage --code-coverage-options 'generateHtmlReport;assemblyFilters:+Unity.ML-Agents'
minCoveragePct: 72
testProject: DevProject
test_platforms:
- name: win
type: Unity::VM

{% endfor %}
{% endfor %}
{% for editor in trunk_editor %}
{% for platform in test_platforms %}
- .yamato/com.unity.ml-agents-test.yml#test_{{ platform.name }}_{{ editor.version }}
{% endfor %}
{% endfor %}
triggers:
cancel_old_ci: true
recurring:

{% endif %}
{% endfor %}
{% endfor %}
{% for editor in trunk_editor %}
{% for platform in test_platforms %}
test_{{ platform.name }}_trunk:
name : com.unity.ml-agents 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 {{ editor.version }} -c editor --wait --fast
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
{% if platform.name == "win" %}
- upm-ci package test -u "C:\build\output\Unity-Technologies\ml-agents\.Editor" --package-path com.unity.ml-agents {{ editor.coverageOptions }}
{% else %}
- upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} {{ editor.coverageOptions }} --extra-utr-arg "reruncount=2"
{% endif %}
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ editor.minCoveragePct }}
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/com.unity.ml-agents-pack.yml#pack
triggers:
cancel_old_ci: true
{% endfor %}
{% endfor %}

10
com.unity.ml-agents/Tests/Editor/TensorUtilsTest.cs


using System;
using System.Text.RegularExpressions;
using Unity.MLAgents.Inference;
using Unity.MLAgents.Inference.Utils;
using Unity.Barracuda;

var packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssembly(typeof(Tensor).Assembly);
Assert.AreEqual("com.unity.barracuda", packageInfo.name);
var barracuda8DSupport = new Version(1, 1, 0);
var strippedBarracudaVersion = packageInfo.version.Replace("-preview", "");
var versionMatch = Regex.Match(packageInfo.version, @"[0-9]+\.[0-9]+\.[0-9]");
if (!versionMatch.Success)
{
// Couldn't parse barracuda version
return;
}
var strippedBarracudaVersion = versionMatch.Value;
var version = new Version(strippedBarracudaVersion);
if (version <= barracuda8DSupport)
{

正在加载...
取消
保存