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

Notification

Icon
Error

v1.37b failing to build project that v1.26 did
AlSki
#1 Posted : Friday, March 16, 2012 2:12:12 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/28/2012(UTC)
Posts: 17
Location: London

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
After upgrading I'm now getting a build error for an older set of nUnit tests. Thought it might be nUnit related but the stack suggests otherwise. Just reply if you need more info.


(0): System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
at nCrunch.TestExecution.Frameworks.NUnit.NUnitStaticTestFinder.#=qcZoEwtZzNT7qowYAiu0_LQtAWBD5NxsIm3BsVzMC15I=(CustomAttributeArgument #=qv26JRc$JR$ubKs5SiY4Cng==)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitStaticTestFinder.#=q8zkb7vIWkmvA7a8BzrWgmg$uUk$QGQGH7xw4oFb3u80=(ReflectedAttribute #=q66GMCPRu_EJYc_rlkr66ig==)
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at nCrunch.Reflection.ReflectedMember.GetValuesFromNamedAttributes[T](String[] attributeTypeNames, Func`2 getValueFunc)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitStaticTestFinder.#=qBVL7ssp8YI_d7L9Civ6qC0K8NkmsL3zVXsKnatc$lkw=(ReflectedType #=qnlf7ifaj0Kt6rwSKE_8KZQ==, ReflectedMethod #=qPsHRCgE8STtzsBcdKQGqkA==)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitStaticTestFinder.FindFrameworkTestsUsingMetadata(ReflectedAssembly assembly, ILogger logger, List`1 tests)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, String assemblyFilePath, String[] referencedAssemblyFilePaths)
at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, String assemblyFilePath, String[] referencedAssemblyFilePaths, TestFrameworkDescription[] frameworks)
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.DiscoverTests(TestFrameworkDescription[] applicableTestFrameworks)
at nCrunch.Compiler.RemoteBuildRunner.#=qf1DXtmueU7rKBM3BJfWCTxN4dqT$SOvGigw13ohpFlw=(ComponentBuildParameters #=qcgUd2jsLlMF20Loqliojlg==, String #=qfPmFBR$rF5avJc8X7omGHHCMwIUhzr7lJ_vrteyqq5o=, BuildOutput #=qAwclHBGlkcRS$29VHUsH1A==, String #=qsH4f0XOWFakXCcgPJwDNhdKpHhrOCktXOUDyRaaQPuY=)
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)
AlSki
#2 Posted : Friday, March 16, 2012 2:18:30 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/28/2012(UTC)
Posts: 17
Location: London

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Intruigingly, it looks as if 1.38.17b is lableed in the about box as 1.37b. Attempting to upgrade simply gives me repair/remove.
Remco
#3 Posted : Friday, March 16, 2012 9:10:50 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,140

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting!

From what you've described, I think you may have a botched install.

What happens if you run the uninstaller, then redownload and reinstall the latest version of 1.38b?
AlSki
#4 Posted : Monday, March 19, 2012 11:32:21 AM(UTC)
Rank: Member

Groups: Registered
Joined: 2/28/2012(UTC)
Posts: 17
Location: London

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Uninstall - Reboot - Download - Install

And still I get the following on ONE of the two different Test projects, the other is fine.

(0): System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
at nCrunch.TestExecution.Frameworks.NUnit.NUnitStaticTestFinder.#=qcZoEwtZzNT7qowYAiu0_LQtAWBD5NxsIm3BsVzMC15I=(CustomAttributeArgument #=qv26JRc$JR$ubKs5SiY4Cng==)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitStaticTestFinder.#=q8zkb7vIWkmvA7a8BzrWgmg$uUk$QGQGH7xw4oFb3u80=(ReflectedAttribute #=q66GMCPRu_EJYc_rlkr66ig==)
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at nCrunch.Reflection.ReflectedMember.GetValuesFromNamedAttributes[T](String[] attributeTypeNames, Func`2 getValueFunc)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitStaticTestFinder.#=qBVL7ssp8YI_d7L9Civ6qC0K8NkmsL3zVXsKnatc$lkw=(ReflectedType #=qnlf7ifaj0Kt6rwSKE_8KZQ==, ReflectedMethod #=qPsHRCgE8STtzsBcdKQGqkA==)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitStaticTestFinder.FindFrameworkTestsUsingMetadata(ReflectedAssembly assembly, ILogger logger, List`1 tests)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, String assemblyFilePath, String[] referencedAssemblyFilePaths)
at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, String assemblyFilePath, String[] referencedAssemblyFilePaths, TestFrameworkDescription[] frameworks)
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.DiscoverTests(TestFrameworkDescription[] applicableTestFrameworks)
at nCrunch.Compiler.RemoteBuildRunner.#=qf1DXtmueU7rKBM3BJfWCTxN4dqT$SOvGigw13ohpFlw=(ComponentBuildParameters #=qcgUd2jsLlMF20Loqliojlg==, String #=qfPmFBR$rF5avJc8X7omGHHCMwIUhzr7lJ_vrteyqq5o=, BuildOutput #=qAwclHBGlkcRS$29VHUsH1A==, String #=qsH4f0XOWFakXCcgPJwDNhdKpHhrOCktXOUDyRaaQPuY=)
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)
AlSki
#5 Posted : Monday, March 19, 2012 11:52:26 AM(UTC)
Rank: Member

Groups: Registered
Joined: 2/28/2012(UTC)
Posts: 17
Location: London

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
About is now showing correctly though.
Remco
#6 Posted : Monday, March 19, 2012 8:50:59 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,140

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
It looks to me as though you have a derivative of NUnit.Framework.CategoryAttribute that takes an integer value in its constructor? What happens if you change your 'Framework utilisation type for NUnit' NCrunch solution setting to 'UseDynamicAnalysis' ?
AlSki
#7 Posted : Tuesday, March 20, 2012 10:27:47 AM(UTC)
Rank: Member

Groups: Registered
Joined: 2/28/2012(UTC)
Posts: 17
Location: London

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Moving to dynamic analysis does correctly solve the problem.

The offending code is
Quote:
public enum TestCategory
{
FAST_RUNNING_TESTS,
SLOW_RUNNING_TESTS
}

[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public class XXXXTestCategoryAttribute : NUnit.Framework.CategoryAttribute
{
public XXXXTestCategoryAttribute(TestCategory category) : base(Enum.GetName(typeof(TestCategory), category)) {}
}

It looks as somebody wanted a way to differentiate an integration level test that takes a couple of minutes to run
Remco
#8 Posted : Tuesday, March 20, 2012 9:40:26 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,140

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks, this makes good sense. I'll see what I can do about implementing a fix.
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.057 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download