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 /
  • Help Room /
avatar image
0
Question by jwallra · Aug 25, 2017 at 11:37 PM · playerwindowsplatformtestingtest

Why do tests run from the command line in player claim they aren't on the same platform as when run from player in editor?

I am running my unit tests in unity using the following command:

 .\Unity.exe -runTests -projectPath path\to\project -testResults path\to\results.xml -testPlatform StandaloneWindows64

This successfully opens unity and the StandaloneWindows64 player, and claims the tests are being run successfully. However, the results.xml file claims that all the tests were skipped because they are not being run on the supported platform. When I run the tests from the Unity test runner, they are run successfully. I verified by adding failing unit tests and observing that they are run and reported as failing.

Each test uses this line (or similar) to restrict the platforms it can be run on:

 [UnityPlatform(include = new[] {RuntimePlatform.WSAPlayerARM, RuntimePlatform.WSAPlayerX64, RuntimePlatform.WSAPlayerX86, RuntimePlatform.OSXPlayer, RuntimePlatform.Android})]

The Unity manual doesn't include platforms like WSAPlatformX64or similar in its documentation here, in the section "Running from the Command Line".

Why does running tests from the command line as above not follow the same behavior as the "Run all in Player" button in Unity? How do I get the tests to run on the platform(s) I want to from the command line?


EDIT: (More information)

I'm running on Unity 2017.1.0p4. Here's a section from the results.xml saying the test was skipped:

           <test-case id="1005" ...(omitted)>
             <properties>
               <property name="_SKIPREASON" value="Only supported on WSAPlayerARM, WSAPlayerX64, WSAPlayerX86, OSXPlayer, Android" />
             </properties>
             <reason>
               <message><![CDATA[Only supported on WSAPlayerARM, WSAPlayerX64, WSAPlayerX86, OSXPlayer, Android]]></message>
             </reason>
           </test-case>

When using "Run all in Player", the platform is StandaloneWindows.

EDIT 2:

Digging a little more, it seems I had my build settings wrong. The tests weren't running. Now they are, but the command line tests still won't. Basically I just want to use -testPlatform WSAPlayer*, but according to the documentation it doesn't seem like that's possible.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by HaraldNielsen · Aug 28, 2017 at 03:14 PM

Hi @jwallra

Your arguments to Unity looks correctly, what version of Unity do you run?

UnityPlatform basically matches the include with Application.platform, and if that is not in the include list, it will be skipped.

Can you post an example of a test that gets skipped, with the Skip reason from the result.xml ? If your UnityPlatform is as you wrote above, and -testPlatform StandaloneWindows64 the tests would be skipped.

When running tests in Unity by "Run all in Player", what platform are you targeting, set in the Build settings?

Comment
Add comment · Show 6 · 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 jwallra · Aug 28, 2017 at 04:50 PM 0
Share

I've updated my question with the details you asked about.

avatar image jwallra · Aug 28, 2017 at 09:08 PM 0
Share

@HaraldNielsen - Do my edits make the problem more clear?

avatar image HaraldNielsen jwallra · Aug 29, 2017 at 09:08 AM 0
Share

Hi @jwallra

How do your Test runner windows look like after run tests? They should be marked as skipped.

I just got the version you are running to test out the same setup as you where seeing.

This is my test: https://pastebin.com/PcyPZF8x

This is the test runner windows, displaying the tests skipped: http://imgur.com/doFhaA7

This is what is expected output. If you don't get the same result, let me know.

avatar image jwallra HaraldNielsen · Aug 29, 2017 at 05:01 PM 0
Share

I'm not running them from the in-editor test runner. I'm running them in the player, which only displays results from failing tests, and says that all tests succeed if they're skipped (without any other diagnostic information). For example, with failing tests, run on WSAPlayer: http://imgur.com/y5vwJdq

I want to run on WSAPlayer, not the in-editor test runner, but from the command line. Is this possible?

Show more comments
avatar image
0

Answer by jwallra · Aug 30, 2017 at 12:05 AM

According to @HaraldNielsen's comment, this isn't currently possible with the recommended set of arguments:

When using WSAPlayer you should get notified that it's not supported yet and the player build is terminated, so you can not, im sorry to say, run tests for that platform. Im currently adding WSA (and other platforms) support, so you would be able in a near future.

However, I've found that using this set of arguments sort of works:

 .\Unity.exe -runTests -projectPath path\to\project -testResults path\to\results.xml -testPlatform WSAPlayer -batchmode

That command runs the tests in the WSAPlayer, which isn't in the list of available PlatformAttributes, but doesn't output the results to the specified file, so it's still a bit difficult to verify if the tests passed outside of using the -logFile, which doesn't have individual test results.

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

124 People are following this question.

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

Related Questions

Does '-testPlatform WSAPlayer' not create a results.xml file because it's not in the list of supported platforms for Unity tests? 1 Answer

Player Can Not get off platform 1 Answer

[UWP]WebRTC issue - Hololens unable to send video offer 1 Answer

weird player movement when parented to moving platform 1 Answer

How can i rotate a 3D platform and fix a little problem?... 2 Answers


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