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
1
Question by RadekOlenski · Nov 22, 2017 at 12:53 PM · errortestingtestrunner

Test runner errors InvalidOperationException and TreeView root item is null

Hi

I'm trying to use tests in my project. I'm working on newest Unity version - 2017.2.0f3. I've encountered some errors that I have no idea how to resolve. If someone could help me it would be really great. Basically every time I open Test Runner I get two errors:

 InvalidOperationException: Operation is not valid due to the current state of the object
 System.Linq.Enumerable.Single[PrecompiledAssembly] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
 System.Linq.Enumerable.SingleOrDefault[PrecompiledAssembly] (IEnumerable`1 source, System.Func`2 predicate)
 UnityEditor.TestTools.TestRunner.TestInEditorTestAssemblyProvider.AssemblySelector (System.String assemblyPath) (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunner/Utils/TestInEditorTestAssemblyProvider.cs:41)
 System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.String].MoveNext ()
 System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[System.String,System.String].MoveNext ()
 System.Collections.Generic.List`1[System.String].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
 System.Collections.Generic.List`1[System.String]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
 System.Linq.Enumerable.ToList[String] (IEnumerable`1 source)
 UnityEngine.TestTools.Utils.TestAssemblyProviderHelper.GetUserAssemblies (System.Func`2 assemblySelector, System.Func`2 selector) (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEngine.TestRunner/Utils/TestAssemblyProviderHelper.cs:45)
 UnityEditor.TestTools.TestRunner.TestInEditorTestAssemblyProvider.GetUserAssemblies () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunner/Utils/TestInEditorTestAssemblyProvider.cs:30)
 UnityEditor.TestTools.TestRunner.TestInEditorTestAssemblyProvider.GetTestsWithNUnit () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunner/Utils/TestInEditorTestAssemblyProvider.cs:23)
 UnityEditor.TestTools.TestRunner.GUI.PlayModeTestListGUI.GetTestListNUnit () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/GUI/Views/PlayModeTestListGUI.cs:86)
 UnityEditor.TestTools.TestRunner.GUI.TestListTreeViewDataSource.FetchData () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/GUI/TestListTreeView/TestListTreeViewDataSource.cs:27)
 UnityEditor.IMGUI.Controls.TreeViewDataSource.ReloadData () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewDataSource.cs:53)
 UnityEditor.IMGUI.Controls.TreeViewController.ReloadData () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:266)
 UnityEditor.TestTools.TestRunner.GUI.TestListGUI.Reload () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/GUI/Views/TestListGUIBase.cs:147)
 UnityEditor.TestTools.TestRunner.TestRunnerWindow.OnEnable () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunnerWindow.cs:113)

and the second one:

 TreeView root item is null. Ensure that your TreeViewDataSource sets up at least a root item.
 UnityEditor.TestTools.TestRunner.TestRunnerWindow:CompilationCallback()

I get these errors with or without any written tests in project. For the record the project is new and clean, I'm using some third party libraries: Entitas, FMOD, Firebase and Crashlytics.

If you can help me in any way I will really appreciate it, thanks!,

Comment
Add comment · Show 2
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 Warnecke · Nov 30, 2017 at 12:49 PM 1
Share

Hey. I have tried to reproduce the issue using Unity 2017.2.0f3 on a clean project, without any luck. Do you still get the error if you try to run without the mentioned third party libraries?

avatar image RadekOlenski Warnecke · Nov 30, 2017 at 01:50 PM 1
Share

Hi, thanks for an idea! I tried to remove libs from project and indeed - Entitas was the problem. I also tried to add Entitas to clean project and the same thing happened. So i guess I'm doing something wrong with Entitas config or there is a bug in latest release - i will report it on Entitas forum.

Thanks again for help

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ericksson · Nov 27, 2017 at 11:23 AM

Unity Test Tools are not officially supported anymore. Since Unity 5.6 or so, you can write unit tests in Unity directly using the Test Runner: https://docs.unity3d.com/Manual/testing-editortestsrunner.html

I suggest you stick with that. The tools have much improved in subsequent Unity versions, so going to the latest Unity release is probably best.

Comment
Add comment · Show 1 · 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 RadekOlenski · Nov 29, 2017 at 01:25 PM 0
Share

Sorry, my mistake, I was talking about Test Runner from newest Unity, that's where I get my errors.

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

146 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 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

Unity-iPhone has Conflicting Provisioning Settings? 4 Answers

Black Screen when I click to run the game project 0 Answers

Simulate InputSystem mouse events 0 Answers

PlayMode tests stop Unity Cloud Builds from working 1 Answer

Terrible Unity testing graphics quality,Terrible Graphics Quality When Testing Project 0 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