question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running tests via Unity pending/inconclusive

See original GitHub issue

After updgrading to Rider 2018.1 and running unit tests without starting Unity on my Mac give me ‘inconclusive’ result. If I start Unity, then tests stay in pending mode without any response…

Rider EAP Build #RD-181.4379.1196
Unity: 2018.1.0b12
JRE: 1.8.0_152-release-1136-b23 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.12.6

a part of stacktrace:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Specified cast is not valid.
  at NUnit.Framework.Api.FrameworkController+LoadTestsAction..ctor (NUnit.Framework.Api.FrameworkController controller, System.Object handler) [0x00008] in <d9eafad60e01411f9e6f726dccd715f8>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:661 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:50 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
van800commented, May 30, 2019

We had a chat with @lordlycastle about his case with TestCaseSource.

		public struct MultiplyTestCase
		{
			public int result;
			public (int, int) input;
		}

		public int Multiply(int x, int y) => x * y;

		private static readonly List<MultiplyTestCase> _testCases =
				new List<MultiplyTestCase>
				{
						new MultiplyTestCase {result = 4, input = (2, 2),},
						// Fail test case.
						new MultiplyTestCase {result = 5, input = (2, 3),},
						// Success test case.
						new MultiplyTestCase {result = 9, input = (3, 3),}
				};

		[Test, TestCaseSource(nameof(_testCases))]
		public void TestMultiply(MultiplyTestCase testCase)
		{
			Assert.AreEqual(testCase.result, Multiply(testCase.input.Item1, testCase.input.Item2));
		}

In Unity it produces 3 tests with similar names: image But for Rider it displays only one test. Workaround is to override a ToString() in MultiplyTestCase:

public override string ToString()
{
   return input + "=" + result;
}

In general I believe we can’t do much with it from Rider side, it requires a fix in Unity.

1reaction
trondtactilecommented, May 17, 2018

I can confirm this now works for me. Thanks! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test method is inconclusive: Test wasn't run. Error?
In my case i got this error because of 'Release' mode where build of UnitTests project was simply switched off. Switching back to...
Read more >
Unity Test Coverage always fails with 'Inconclusive: Test not run'
Tests run fine when launched normally. Running them with coverage always results in 'Inconclusive: Test not run' immediately.
Read more >
Debug test results in 'Inconclusive: Test not run'
Looking at the resharper log it looks like an Access Denied Exception attempting to start the tests so the tests never finish and...
Read more >
Unity Test Framework 2.0 ready for feedback | Page 2
CurrentContext.Random from NUnit is null when running tests with Unity Test Framework (because UnityTestExecutionContext.RandomGenerator
Read more >
Palestinian leaders hold inconclusive unity talks
Palestinian President Mahmoud Abbas held inconclusive talks on forming a unity government with Prime Minister Ismail Haniyeh on Sunday and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found