nunit build step

I'm trying to add nunit running as part of my build.  the assembly containing the tests is found, but it errors running the tests because one of the rojects referenced assemblies is not found.  the tests run fine locally and the needed assembly ends up in the bin\release folder, its just the agent runner that fails to load it for some reason.

3 comments
Comment actions Permalink

Could you please provide complete error message that you see in build log?

Also it makes sense to look at this list:
http://confluence.jetbrains.com/display/TCD8/Common+Problems#CommonProblems-BuildfailsorbehavesdifferentlyinTeamCitybutnotlocally

0
Comment actions Permalink

This is the full error details:

NUnit error running tests in 'C:\TeamCity\buildAgent\work\e8bfc1f02feb788a\test\productname.Test\obj\Release\companyname.productname.Test.dll' assembly
Loading assembly is compiled for v4.0.30319, MSIL
NUnit runner runtime is v4.0.30319, x64
System.IO.FileNotFoundException: Could not load file or assembly 'mycompanyname.Test, Version=1.0.0.2368, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'mycompanyname.Test, Version=1.0.0.2368, Culture=neutral, PublicKeyToken=null'
Server stack trace:
   at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
   at System.Reflection.RuntimeAssembly.GetExportedTypes()
   at NUnit.Core.CoreExtensions.InstallAdhocExtensions(Assembly assembly)
   at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path)
   at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
   at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
   at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
   at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
   at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandlproductnameMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at NUnit.Core.TestRunner.Load(TestPackage package)
   at JetBrains.TeamCity.NUnitLauncher.NUnitRunner.LoadTest(String testAssembly, String testName, TestRunner runner) in c:\BuildAgent\work\a29c4c32f4df4c1d\src\NUnitLauncher\src\NUnit-2.6\NUnitRunner.cs:line 53
   at JetBrains.TeamCity.NUnitLauncher.AssemblyTest.LoadTestDomain() in c:\BuildAgent\work\a29c4c32f4df4c1d\src\NUnitLauncher\src\AssemblyTest.cs:line 74
   at JetBrains.TeamCity.NUnitLauncher.LoadTestDomainAction.Action(AssemblyTest test) in c:\BuildAgent\work\a29c4c32f4df4c1d\src\NUnitLauncher\src\LoadTestDomainAction.cs:line 15
   at JetBrains.TeamCity.NUnitLauncher.TryOneAssemblyTest.Action() in c:\BuildAgent\work\a29c4c32f4df4c1d\src\NUnitLauncher\src\TryOneAssemblyTest.cs:line 18
   at JetBrains.TeamCity.NUnitLauncher.TryOneAssembly.Do() in c:\BuildAgent\work\a29c4c32f4df4c1d\src\NUnitLauncher\src\TryOneAssembly.cs:line 36
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Check correct .NET Framework version and process platform (x64, x86, MSIL) are used both in the test runner settings and involved assemblies on this machine.




I'll try logging on to the team city server to see if I can figure things out there.  I do have this project building under CCNet, so I do know the tests can run.

0
Comment actions Permalink

I figured out the issue.  My pattern was finding the assembly in the obj folder as well as the bin folder.  Once I updated the pattern to only find the assembly in the bin\release folder everything was fine.

0

Please sign in to leave a comment.