This commit is contained in:
Sophia 2020-09-16 16:30:40 +02:00
Родитель 2475066cd8
Коммит 8f6b3f173a
11 изменённых файлов: 283 добавлений и 3 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -5,4 +5,6 @@ test-compilation-project/
.download/
utr.bat
run-tests.bat
build/
build/
.yamato/.DS_Store
.DS_Store

145
.yamato/upm-ci.yml Normal file
Просмотреть файл

@ -0,0 +1,145 @@
editors:
- version: trunk
- version: 2020.1
- version: 2019.3
platforms:
- name: Windows64
os: windows
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
- name: OSX_OpenGLCore
os: macos
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: m1.mac
packages:
- name: MetaDataManager
id: mdm
packagename: com.unity.test.metadata-manager
dependencies:
- .yamato/upm-ci.yml#pack_mdm
---
{% for package in packages %}
pack_{{ package.id }}:
name: z_(do not use) Pack {{ package.name }}
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package pack
artifacts:
packages:
paths:
- "upm-ci~/packages/**/*"
{% endfor %}
{% for editor in editors %}
{% for platform in platforms %}
{% for package in packages %}
test_{{ package.id }}_{{ platform.name }}_{{ editor.version }}:
name: Test {{ package.name }} {{ platform.name }} {{ editor.version }}
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
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
- unity-downloader-cli --source-file unity_revision.txt -c editor --wait --published-only
- upm-ci package test -u .Editor
artifacts:
logs:
paths:
- "**/upm-ci~/test-results/**/*"
dependencies:
- .yamato/z_editor.yml#editor:priming:{{ editor.version }}:{{ platform.os }}
{% for dep in package.dependencies %}
- {{ dep }}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
all_package_ci:
name: Pack and test all packages
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package izon -t
- upm-ci package izon -d
dependencies:
{% for editor in editors %}
{% for platform in platforms %}
{% for package in packages %}
- path: .yamato/upm-ci.yml#test_{{ package.id}}_{{ platform.name }}_{{ editor.version }}
rerun: always
{% endfor %}
{% endfor %}
{% endfor %}
triggers:
recurring:
- branch: master
frequency: daily
expression: pull_request.target eq "master" AND NOT pull_request.draft AND NOT pull_request.push.changes.all match ["**/*.md", "doc/**/*", "**/Documentation*/**/*"]
{% for package in packages %}
publish_{{ package.id }}:
name: Publish {{ package.name }}
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package publish
artifacts:
packages:
paths:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/upm-ci.yml#pack_{{ package.id }}
{% for editor in editors %}
{% for platform in platforms %}
- .yamato/upm-ci.yml#test_{{ package.id}}_{{ platform.name }}_{{ editor.version }}
{% endfor %}
{% endfor %}
{% endfor %}
publish_all:
name: Publish all packages
dependencies:
{% for package in packages %}
- .yamato/upm-ci.yml#publish_{{ package.id }}
{% endfor %}
{% for package in packages %}
promote_{{ package.id }}:
name: promote {{ package.name }}
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
variables:
UPMCI_PROMOTION: 1
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package promote
artifacts:
packages:
paths:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/upm-ci.yml#pack_{{ package.id }}
{% for editor in editors %}
{% for platform in platforms %}
- .yamato/upm-ci.yml#test_{{ package.id}}_{{ platform.name }}_{{ editor.version }}
{% endfor %}
{% endfor %}
- .yamato/upm-ci.yml#publish_{{ package.id }}
{% endfor %}

56
.yamato/z_editor.yml Normal file
Просмотреть файл

@ -0,0 +1,56 @@
editors:
- version: trunk
cmd: -u trunk
- version: 2020.1
cmd: -u 2020.1/staging
- version: 2019.3
cmd: -u 2019.3/staging
platforms:
# Exhaustive list of operating systems and editor components used by all jobs so the preparation jobs
# can make sure all editors are cached on cheap vms before starting the heavy duty machines for running tests
- os: macos
components:
- editor
- il2cpp
- os: android
components:
- editor
- il2cpp
- android
- os: windows
components:
- editor
- il2cpp
- os: linux
components:
- editor
- il2cpp
---
{% for platform in platforms %}
{% for editor in editors %}
editor:priming:{{ editor.version }}:{{ platform.os }}:
name: "[{{ editor.version }},{{ platform.os }}] Editor priming"
agent:
type: Unity::VM
image: 'cds-ops/ubuntu-16.04-base:stable'
flavor: b1.small
skip_checkout: true
variables:
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
UPM_REGISTRY: https://artifactory-slo.bf.unity3d.com/artifactory/api/npm/upm-candidates
# {% if editor.version == 'CUSTOM-REVISION' %}
# CUSTOM_REVISION: custom_revision_not_set
# {% endif %}
commands:
- pip install unity-downloader-cli --user --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
- >
unity-downloader-cli {{ editor.cmd }} {% if platform.os == "android" %} -o windows {% else %} -o {{ platform.os }} {% endif %} --wait --skip-download {% for component in platform.components -%} -c {{ component }} {% endfor -%}
> unity_revision.txt
artifacts:
unity_revision.zip:
paths:
- "unity_revision.txt"
{% endfor -%}
{% endfor %}

Просмотреть файл

@ -0,0 +1,2 @@
# com.unity.test.metadata-manager
Used to manage custom metadata for Unity performance tests.

Просмотреть файл

@ -4,7 +4,9 @@
"references": [
"com.unity.tests.performance.runtimesettings"
],
"includePlatforms": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,

8
Tests.meta Normal file
Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 609f36b4c5f374c298606749bb74d3cd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,21 @@
{
"name": "MetaDataManagerTests",
"rootNamespace": "",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
}

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: baa728ba392f4417a8b6da282ae2086f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
public class MetaDataManagerTests
{
// A Test behaves as an ordinary method
[Test]
public void MetaDataManagerTestsSimplePasses()
{
// Use the Assert class to test conditions
Assert.True(true);
}
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
// `yield return null;` to skip a frame.
[UnityTest]
public IEnumerator MetaDataManagerTestsWithEnumeratorPasses()
{
// Use the Assert class to test conditions.
// Use yield to skip a frame.
yield return null;
}
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8bd3ecbf8700a4807982eea3838c761a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -3,5 +3,5 @@
"displayName": "Unity Tests Metadata Manager",
"version": "0.1.0-preview",
"unity": "2018.1",
"description": "Used to manage metadata for Unity tests."
"description": "Used to manage custom metadata for Unity performance tests."
}