2021-02-06 02:12:11 +03:00
|
|
|
name: URDF Importer Unit Tests
|
|
|
|
agent:
|
|
|
|
type: Unity::VM
|
2021-08-06 21:05:01 +03:00
|
|
|
image: robotics/ci-ubuntu20:v0.1.0-795910
|
2021-02-06 02:12:11 +03:00
|
|
|
flavor: i1.large
|
|
|
|
variables:
|
2021-11-11 02:30:51 +03:00
|
|
|
COVERAGE_EXPECTED: 35
|
2021-02-06 02:12:11 +03:00
|
|
|
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
|
|
|
|
commands:
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
|
2021-06-15 06:17:08 +03:00
|
|
|
- unity-downloader-cli -u 2020.3.11f1 -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
|
2021-02-06 02:12:11 +03:00
|
|
|
- git clone git@github.cds.internal.unity3d.com:unity/utr.git utr
|
2021-05-14 03:16:34 +03:00
|
|
|
- utr/utr --testproject=./TestUrdfImporter --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor --enable-code-coverage --coverage-results-path=../test-results --coverage-options="assemblyFilters:+Unity.Robotics.URDFImporter,+Unity.Robotics.URDFImporter.Editor;generateHtmlReport;generateBadgeReport;generateAdditionalMetrics"
|
|
|
|
# check test coverage
|
|
|
|
- command: |
|
|
|
|
linecoverage=$(cat test-results/Report/Summary.xml | grep Linecoverage | grep -Eo '[+-]?[0-9]+([.][0-9]+)?')
|
|
|
|
echo "Line coverage: $linecoverage%"
|
2021-11-11 02:30:51 +03:00
|
|
|
if (( $(echo "$linecoverage < $COVERAGE_EXPECTED" | bc -l) ))
|
|
|
|
then echo "ERROR: Code coverage is under threshold of $COVERAGE_EXPECTED%" && exit 1
|
|
|
|
fi
|
2021-02-06 02:12:11 +03:00
|
|
|
triggers:
|
|
|
|
cancel_old_ci: true
|
|
|
|
expression: |
|
2021-11-11 02:30:51 +03:00
|
|
|
((pull_request.target eq "main" OR pull_request.target eq "dev")
|
|
|
|
AND NOT pull_request.push.changes.all match "**/*.md") OR
|
|
|
|
(push.branch eq "main" OR push.branch eq "dev")
|
2021-02-06 02:12:11 +03:00
|
|
|
artifacts:
|
|
|
|
logs:
|
|
|
|
paths:
|
|
|
|
- "test-results/**/*"
|