Skip to content

Commit

Permalink
add test coverage (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
peifeng-unity committed Jul 15, 2021
1 parent 36fa70a commit 535b288
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .yamato/yamato-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ 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 2020.2.0b9 -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
- git clone [email protected]:unity/utr.git utr
- utr/utr --testproject=./TestRosTcpConnector --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor
- utr/utr --testproject=./TestRosTcpConnector --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.ROSTCPConnector,+Unity.Robotics.ROSTCPConnector.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%"
if (( $(echo "$linecoverage < 0" | bc -l) )); then exit 1; fi
triggers:
cancel_old_ci: true
expression: |
(pull_request.target eq "main" AND
NOT pull_request.push.changes.all match "**/*.md") OR
(push.branch eq "dev" AND
NOT push.changes.all match "**/*.md")
(pull_request.target eq "dev" AND
NOT pull_request.push.changes.all match "**/*.md")
artifacts:
logs:
paths:
Expand Down
3 changes: 2 additions & 1 deletion TestRosTcpConnector/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"com.unity.ide.vscode": "1.2.2",
"com.unity.render-pipelines.universal": "10.0.0-preview.26",
"com.unity.robotics.ros-tcp-connector": "file:../../com.unity.robotics.ros-tcp-connector",
"com.unity.test-framework": "1.1.18",
"com.unity.test-framework": "1.1.20",
"com.unity.testtools.codecoverage": "1.0.0",
"com.unity.textmeshpro": "3.0.1",
"com.unity.timeline": "1.4.3",
"com.unity.ugui": "1.0.0",
Expand Down

0 comments on commit 535b288

Please sign in to comment.