Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by anngo · May 20, 2017 at 09:20 AM · testingtest

TeamCity XML Report Processing can not parse Unity 5.6 test results

I am using TeamCity to automate build and test Unity project. For testing I use the command

Unity.exe -runTests -projectPath PATH_TO_YOUR_PROJECT -testResults C:\temp\results.xml -testPlatform editmode

The test result schema is not parse-able by TeamCity XML Report Processing, the error is

Builds/Android/BuildLogs/editmode-results.xml: must contain "test-results", "test-run" or "stack-trace" root element. Please check the NUnit sources for the supported XML Schema.

The actual root element Unity generates is

test-suite not test-run

so TeamCity can not parse it.

Anyone has this problem with TeamCity and Unity ?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Tomek-Paszek · May 29, 2017 at 09:47 AM

Hi @anngo, I believe it's an oversite from our side. We will try to fix it. For now I can recommend you wrapping the result xml in before it's parsed by TeamCity

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by spav5 · Aug 09, 2017 at 12:43 PM

Hi, I am from TeamCity team.

What is the status of this problem in Unity?

At the moment, we expect test results in the following format: http://nunit.org/files/testresult_30.txt

Of course we could provide a workaround and treat root element similar to <test-run/> but since the format is vague enough we'd rather wait for you guys to fix this problem, especially if you plan to do that in the nearest future.

Comment
Add comment · Show 10 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HaraldNielsen · Aug 09, 2017 at 02:05 PM 0
Share

Hi @spav5

Thanks for your interest.

We are fixing this atm so no workaround should hopefully be needed.

Until the fix are out, wrapping the result file with the missing node should solve the issue

avatar image HaraldNielsen HaraldNielsen · Aug 09, 2017 at 02:12 PM 0
Share

We will write here what patch the fix will be in when I know. But we will be backporting it to 5.6 where the issue started.

avatar image Stormy102 HaraldNielsen · Sep 21, 2017 at 05:17 PM 0
Share

Any updates and idea when this will be fixed? $$anonymous$$aybe adding a parameter to select the type of output would help?

Show more comments
avatar image
0

Answer by Kleptine · Oct 01, 2017 at 05:58 AM

I've written a quick Powershell script to fix the file for the time being. Seems to work well enough:

 # Windows Only
 # Runs automated tests through the headless Unity runner, and then transforms the output file to 
 # proper NUnit scheme (or at least the one TeamCity accepts)
 
 # Uncomment to print each command as we go
 #Set-PSDebug -Step
 
 try {
 
 # Find our project path
 $tools_dir = Split-Path $MyInvocation.MyCommand.Path
 $project_dir = Join-Path $tools_dir "/../" -resolve
 $results_file = Join-Path $project_dir "results.xml"
 
 # Query the assembly function to generate the project
 $exitCode = [Diagnostics.Process]::Start("C:\Program Files\Unity\Editor\Unity.exe", 
     "-batchmode -runTests -logFile ./logfile.txt -projectPath $project_dir -testResults $results_file -testPlatform playmode").WaitForExit(60000) # Wait for 60 seconds    
 
 [xml]$xml = (Get-Content $results_file)
 
 $test_suite = $xml."test-suite"
 $wrapper = $xml.CreateElement("test-run")
 
 foreach($attr in $test_suite.Attributes)
 {
    $wrapper.SetAttribute($attr.Name, $attr.Value)
 }
 
 $wrapper.AppendChild($test_suite)
 $xml.RemoveAll()
 $xml.AppendChild($wrapper)
 $xml.Save($results_file)
 
 } Catch {
   $ErrorMessage = $_.Exception.Message
   Write-Output $ErrorMessage
   exit(1)
 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Testing Network Code in Unity 4 Answers

Unity Test Runner - How do I create two game instances in a PlayMode test? 1 Answer

Unit Test EditorTestResults 1 Answer

Testing editor scripting 1 Answer

How can I keep my project buildable without deleting my playmode tests? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges