Hello,
it seems I accidentally created an invalid unit test. Shortly after I realized that and fixed it.
From this moment on I get each frame a recurring error and the TestRunner does not show any tests anymore.
The error completely prevents me from using the TestRunner:
ArgumentException: An item with the same key has already been added. Key: DeviceObject-UnitTests.dll/SitePlanner/ComponentParts_uTest/GetPartIDString_ShouldReturnCorrect_WhenDeviceIsCustom/[DeviceObject-UnitTests][SitePlanner.ComponentParts_uTest.GetPartIDString_ShouldReturnCorrect_WhenDeviceIsCustom(“Name”,“Name”)]
System.Collections.Generic.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <252f5a151e57406087568ebdeb88d5fe>:0) System.Collections.Generic.Dictionary
2[TKey,TValue].Add (TKey key, TValue value) (at <252f5a151e57406087568ebdeb88d5fe>:0)
System.Linq.Enumerable.ToDictionary[TSource,TKey] (System.Collections.Generic.List1[T] source, System.Func
2[T,TResult] keySelector, System.Collections.Generic.IEqualityComparer1[T] comparer) (at <5daa034a65ef4e92beb94b6ef26af36a>:0) System.Linq.Enumerable.ToDictionary[TSource,TKey] (System.Collections.Generic.IEnumerable
1[T] source, System.Func2[T,TResult] keySelector, System.Collections.Generic.IEqualityComparer
1[T] comparer) (at <5daa034a65ef4e92beb94b6ef26af36a>:0)
System.Linq.Enumerable.ToDictionary[TSource,TKey] (System.Collections.Generic.IEnumerable1[T] source, System.Func
2[T,TResult] keySelector) (at <5daa034a65ef4e92beb94b6ef26af36a>:0)
UnityEditor.TestTools.TestRunner.GUI.TestListGUI.get_ResultsByKey () (at Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/GUI/Views/TestListGUIBase.cs:44)
UnityEditor.TestTools.TestRunner.GUI.TestListTreeViewDataSource.FetchData () (at Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/GUI/TestListTreeView/TestListTreeViewDataSource.cs:35)
UnityEditor.IMGUI.Controls.TreeViewDataSource.ReloadData () (at <2adcb7d86536472884d6a11c9ab8e115>:0)
UnityEditor.IMGUI.Controls.TreeViewController.ReloadData () (at <2adcb7d86536472884d6a11c9ab8e115>:0)
UnityEditor.TestTools.TestRunner.GUI.TestListGUI.Reload () (at Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/GUI/Views/TestListGUIBase.cs:202)
UnityEditor.TestTools.TestRunner.TestRunnerWindow+<>c__DisplayClass27_0.b__0 (UnityEditor.TestTools.TestRunner.Api.ITestAdaptor rootTest) (at Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/TestRunnerWindow.cs:162)
UnityEditor.TestTools.TestRunner.Api.TestRunnerApi+<>c__DisplayClass8_0.b__0 (UnityEditor.TestTools.TestRunner.Api.ITestAdaptor testRoot) (at Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/Api/TestRunnerApi.cs:143)
UnityEditor.TestTools.TestRunner.TestListJob.EditorUpdate () (at Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/TestRunner/Utils/TestListJob.cs:31)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <2adcb7d86536472884d6a11c9ab8e115>:0)
Things I tried:
Changing the code in the test class
Deleting code in the test class
Deleting the test class/file
Deleting the assembly
Deleting library caches
(Of course) restarting Unity and my PC
Removing Test Framework in PackageManager and reinstalling it
Reinstalling Unity
Somehow I’m at a loss of what to do. I guess there is something in a some global cache that I can’t find.
Does someone have an idea?
Were you able to find a fix for this? I’m running into the exact same issue.
Well, not really.
I managed to get around for now with a pre test-framework version.
Edit in manifest.json:
"com.unity.test-framework": "2.0.1-pre.18",
At least it works somehow with this.
I was able to reproduce this bug and did bug report . Please vote