Skip to content

Commit 71af832

Browse files
committed
AIRO-405 Adding Yamato boilerplate to Robotics Hub (#144)
* Adding testing boilerplate * Adding tests to run after message generation * Tweaks to ensure run works in Bokken image * Enabling audio by default, but disabling it in yamato config
1 parent e9f67e0 commit 71af832

19 files changed

+306
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
2+
.swp
23
.idea
34
.vscode/
45
tutorials/pick_and_place/PickAndPlaceProject/Packages/packages-lock.json

.yamato/yamato-config.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Robotics Hub Tests
2+
agent:
3+
type: Unity::VM
4+
image: robotics/ci-ubuntu20:latest
5+
flavor: i1.large
6+
variables:
7+
PATH: /root/.local/bin:/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
8+
commands:
9+
- git submodule update --init --recursive
10+
# TODO: Fix this hack - our bokken image is missing a .NET dependency (System.CodeDom) without which causes compilation to fail
11+
- rm ./tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/Demo.*
12+
# This is another hack to ensure audio is disabled. Unity built-in audio fails to initialize in our Bokken image.
13+
- "sed -i -e '/m_DisableAudio/ s/: .*/: 1/' ./tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/AudioManager.asset"
14+
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
15+
- unity-downloader-cli -u 2020.2.0b9 -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
16+
- git clone git@github.cds.internal.unity3d.com:unity/utr.git utr
17+
- utr/utr --testproject=./tutorials/pick_and_place/PickAndPlaceProject --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor --editorTestsCategories MessageGeneration
18+
- mkdir -p ./tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts && cp ./tutorials/pick_and_place/Scripts/*.cs ./tutorials/pick_and_place/PickAndPlaceProject/Assets
19+
- utr/utr --testproject=./tutorials/pick_and_place/PickAndPlaceProject --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor --editorTestsCategories BuildTests
20+
triggers:
21+
cancel_old_ci: true
22+
expression: |
23+
(pull_request.target eq "main" AND
24+
NOT pull_request.push.changes.all match ["**/*.md","**/*.jpg","**/*.jpeg","**/*.gif","**/*.pdf"]) OR
25+
(push.branch eq "dev" AND
26+
NOT push.changes.all match ["**/*.md","**/*.jpg","**/*.jpeg","**/*.gif","**/*.pdf"])
27+
artifacts:
28+
logs:
29+
paths:
30+
- "test-results/**/*"

tutorials/pick_and_place/PickAndPlaceProject/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/[Bb]uilds/
1010
/[Ll]ogs/
1111
/[Uu]ser[Ss]ettings/
12+
/[Aa]ssets/[Rr]os[Mm]essages/
13+
/[Aa]ssets/[Rr]os[Mm]essages.meta
1214

1315
# MemoryCaptures can get excessive in size.
1416
# They also could contain extremely sensitive data

tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/Demo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#if UNITY_EDITOR
22
using Microsoft.CSharp;
3-
using RosSharp;
4-
using RosSharp.Control;
5-
using RosSharp.Urdf.Editor;
63
using System;
74
using System.CodeDom.Compiler;
85
using System.Collections.Generic;
96
using System.IO;
107
using System.Reflection;
118
using System.Text;
9+
using RosSharp;
10+
using RosSharp.Control;
11+
using RosSharp.Urdf.Editor;
1212
using UnityEditor;
1313
using UnityEngine;
1414
using Unity.Robotics.ROSTCPConnector;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "DemoScripts",
3+
"rootNamespace": "",
4+
"references": [
5+
"GUID:625bfc588fb96c74696858f2c467e978",
6+
"GUID:b1ef917f7a8a86a4eb639ec2352edbf8",
7+
"GUID:465c1207fffb96245a352265e7622205"
8+
],
9+
"includePlatforms": [
10+
"Editor"
11+
],
12+
"excludePlatforms": [],
13+
"allowUnsafeCode": false,
14+
"overrideReferences": false,
15+
"precompiledReferences": [],
16+
"autoReferenced": true,
17+
"defineConstraints": [],
18+
"versionDefines": [],
19+
"noEngineReferences": false
20+
}

tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/DemoScripts.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "EditMode",
3+
"rootNamespace": "",
4+
"references": [
5+
"UnityEngine.TestRunner",
6+
"UnityEditor.TestRunner",
7+
"Unity.Robotics.ROSTCPConnector.Editor",
8+
"Unity.Robotics.ROSTCPConnector"
9+
],
10+
"includePlatforms": [
11+
"Editor"
12+
],
13+
"excludePlatforms": [],
14+
"allowUnsafeCode": false,
15+
"overrideReferences": true,
16+
"precompiledReferences": [
17+
"nunit.framework.dll"
18+
],
19+
"autoReferenced": false,
20+
"defineConstraints": [
21+
"UNITY_INCLUDE_TESTS"
22+
],
23+
"versionDefines": [],
24+
"noEngineReferences": false
25+
}

tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/EditMode.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)