Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch cannot discover tests due to serialization issues
zvirja
#1 Posted : Wednesday, October 18, 2017 7:58:00 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/23/2017(UTC)
Posts: 3
Location: Ukraine

Thanks: 1 times
Steps to reproduce:
1. Checkout the AutoFixture repo: https://github.com/AutoFixture/AutoFixture
2. Open the Src/AutoFixture.sln project.
3. Try to discover all the tests.

Result:
Discovery fails for .NET Core App framework. Here are examples of errors:

Quote:

An error occurred while analysing this project after it was built: System.Exception: Error while discovering test 'AutoFixtureUnitTest.RandomRangedNumberGeneratorTest.CreationOnFullRangeShouldntFail("System.SByte", "-128", "127")':System.Runtime.Serialization.SerializationException: Unknown primitive type: System.SByte
at nCrunch.Common.Serialization.BinarySerializer.writePrimitiveType(BinaryWriter writer, Object value)
at nCrunch.Common.Serialization.BinarySerializer.WriteInstance(SerializationContext context, Object instance, Type knownInstanceType, Boolean cacheCollectionContents)
at nCrunch.Common.Serialization.BinarySerializer.Serialize(SerializationContext context, Object instance, Type knownInstanceType, Boolean cacheInstance, Boolean cacheCollectionContents)
at nCrunch.Common.Serialization.CustomTypeSerializers.ObjectArraySerializer.Serialize(SerializationContext context, SerializationContractType type, Object value, Boolean cacheCollectionContents)
at nCrunch.Common.Serialization.BinarySerializer.WriteInstance(SerializationContext context, Object instance, Type knownInstanceType, Boolean cacheCollectionContents)
at nCrunch.Common.Serialization.BinarySerializer.Serialize(SerializationContext context, Object instance, Type knownInstanceType, Boolean cacheInstance, Boolean cacheCollectionContents)
at nCrunch.Module.XUnit2.XUnitBinarySerializer.Serialize(Stream stream, Object graph)
at nCrunch.TestExecution.Frameworks.XUnit2.TestCaseArgumentData.StoreInTest(FrameworkTest test)
at nCrunch.Module.XUnit2.Integration.XUnitNCrunchDiscoveredTestContainer.StoreDiscoveredTest(ITestCase testCase, TestName testName)
at nCrunch.Module.XUnit2.Integration.XUnitDiscoveryMessageSink.discoverTest(ITestCase testCase)


Quote:

Error while discovering test 'AutoFixtureUnitTest.Kernel.MultidimensionalArrayRelayTest.Create3DimensionalArrayReturnsCorrectResult([[["12"]]], ["12"])':System.Runtime.Serialization.SerializationException: Cannot find serialization contract for type: System.Int32[][]


Expected result:
Discovery should pass successfully.

Notes:
For history: current SHA1 of the master is c7a27680155bcaf22dc1f6e6d62f14cc8614217c.

It seems you cannot serialize SByte and multi-dimensional arrays.

Thank you!
Remco
#2 Posted : Wednesday, October 18, 2017 10:49:04 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for sharing this problem.

It looks like we are missing a type in our binary serializer. From what I can determine, this will affect .NET Core projects (not .NET Framework ones).

I'll make sure this gets fixed in the next release. Thanks for bringing it to my attention!
1 user thanked Remco for this useful post.
zvirja on 10/25/2017(UTC)
zvirja
#3 Posted : Wednesday, October 25, 2017 4:04:06 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/23/2017(UTC)
Posts: 3
Location: Ukraine

Thanks: 1 times
Thank for your the confirmation! Will be nice to have it working ;-)

P.S. Thank you for the great product you are making. It totally changed my coding experience and now it's hard to imagine my life without this tool.
Remco
#4 Posted : Wednesday, October 25, 2017 8:43:02 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
zvirja;11418 wrote:

P.S. Thank you for the great product you are making. It totally changed my coding experience and now it's hard to imagine my life without this tool.


Thank you for your efforts on AutoFixture! :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.046 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download