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
1
Question by Nerull22 · Apr 05, 2017 at 04:18 PM · testingtestnunitunittest

Unity 5.6 Unit Testing

I noticed that there have been some changes in the Unit Testing framework inside Unity. The only change that I saw documented (even though it was difficult to find) was that NUnit was updated to version 3.6. I updated and some of our Unit/Integration tests are now failing. We have some failing because calls are being made not on the main thread, and I've also noticed the new "PlayMode" in the test runner which I can find 0 information on it seems.

Can someone please either point me in a direction to see the update changes or explain what the PlayMode is and perhaps what core changes beyond the NUnit update have been made? I would greatly appreciate this, thank you.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Tomek-Paszek · Apr 06, 2017 at 12:36 PM

Hi!

The docs are taking a little linger to update then expected. Sorry about that. In the meantime here are the draft docs for the new test runner: https://docs.google.com/document/d/1SeNOAVYaq9HUjsKAC2ZvRwKLD2MCNyV4LwcsP3BXm0s/edit

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 Tomek-Paszek ♦♦ · Apr 06, 2017 at 12:37 PM 0
Share

In this version NUnit got updated from 2.6 to 3.5-based version. Update guide can be found here https://github.com/nunit/docs/wiki/Upgrading

avatar image Tomek-Paszek ♦♦ · Apr 06, 2017 at 12:45 PM 1
Share

Also feel free to write feedback for the docs. Let us know what is unclear, what could be improved, etc.

avatar image ludiq · Apr 28, 2017 at 07:03 PM 0
Share

Hi $$anonymous$$ek! Is there still a way to run tests from custom assemblies (DLLs)? I have [Test] attributes in my classes, but since 5.6, they don't show up in the test runner anymore. I'm referencing Nunit Framework 3.5.0, as per your earlier comment.

The previous documentation stated:

The runner will scan the assemblies (including external assemblies included in the project that reference nunit.framework library)

But now that part seems to be gone in your Google Doc. Has that feature been removed?!

avatar image Tomek-Paszek ♦♦ ludiq · May 02, 2017 at 03:11 PM 0
Share

Hi ludiq. Unfortunatelly this wasn't implement in the new runner. It's a regerssion but we'll try to fix it.

avatar image ludiq Tomek-Paszek ♦♦ · May 02, 2017 at 03:13 PM 0
Share

Thanks for the clarification. That's disappointing, though... I'm developing a very complex asset store plugin that depends strongly on unit testing for quality assurance. Any rough ETA on the fix?

Show more comments
avatar image robertstoettner · May 18, 2017 at 11:19 AM 0
Share

Hi, regarding the "Example in Edit mode": What should RunEditorUtilityInTheBackgroud look like? Is it possible to instantiate a class extending $$anonymous$$onoBehaviour inside a test in Edit$$anonymous$$ode? Will Awake() be called during the test?

I tried the following, where LateUpdate is called, Awake isn't:

 GameObject gameObject = new GameObject();
 $$anonymous$$yObject = gameObject.AddComponent (typeof($$anonymous$$yObject)) as $$anonymous$$yObject;
 
 EditorApplication.update += Update;
 // yield to skip a frame
 yield return null;

When I try to run the example "$$anonymous$$onoBehaviourTest" from the draft docs in Edit$$anonymous$$ode I get the message "Edit$$anonymous$$ode test can only yield null" Is there any how-to for integration tests?

Thanks in advance.

avatar image Tomek-Paszek ♦♦ robertstoettner · Jun 12, 2017 at 11:25 AM 0
Share

It's because $$anonymous$$B require playmode to execute. You can use ExecuteInEdit$$anonymous$$odeAttrbute but it has it's limitations (you can find more about that in the docs).

avatar image CanisLupus · Jun 14, 2017 at 09:18 PM 0
Share

$$anonymous$$ek, I'm really sorry to hijack these comments, but could we have someone from Unity comment in this thread?

It's about several regressions to the Test Runner in Unity 5.6. Performance issues and missing features from 5.5. I believe it's really important. Thanks!

Show more comments

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

87 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

Related Questions

Unit Testing Rigidbody2D without polluting scene with gameobjects 1 Answer

How to import plugins inside tests in Unity Test Runner 1 Answer

MSTools instead of NUnit 0 Answers

How to Run Editor Test Runner test from editor script in 5.6? 4 Answers

How to load a scene in PlayMode tests 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