Test discovery errors in VSTS

90 views
Skip to first unread message

Matt

unread,
Jul 24, 2018, 3:39:17 PM7/24/18
to NUnit-Discuss
When I'm running tests in VSTS on a build agent I get the following warnings logged to the test step;

2018-07-24T19:30:32.5960412Z DiscoveryMessage : NUnit Adapter 3.10.0.21: Test discovery starting
2018-07-24T19:30:49.7813438Z ##[warning]DiscoveryMessage : Exception NUnit.Engine.NUnitEngineException, Exception thrown discovering tests in C:\nwautomation\_work\1\s\Netwealth.AutomatedTests\Netwealth.AutomatedTests\obj\Debug\Netwealth.AutomatedTests.dll
2018-07-24T19:30:49.7823149Z ##[warning]DiscoveryMessage : An exception occurred in the driver while loading tests.
2018-07-24T19:30:49.7823659Z ##[warning]DiscoveryMessage :    at NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)
2018-07-24T19:30:49.7823904Z    at NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
2018-07-24T19:30:49.7824013Z    at NUnit.Engine.Runners.TestDomainRunner.LoadPackage()
2018-07-24T19:30:49.7824137Z    at NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded()
2018-07-24T19:30:49.7824251Z    at NUnit.Engine.Runners.DirectTestRunner.Explore(TestFilter filter)
2018-07-24T19:30:49.7824391Z    at NUnit.Engine.Runners.MasterTestRunner.Explore(TestFilter filter)
2018-07-24T19:30:49.7824580Z    at NUnit.VisualStudio.TestAdapter.NUnit3TestDiscoverer.DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger messageLogger, ITestCaseDiscoverySink discoverySink)
2018-07-24T19:30:49.7824959Z ##[warning]DiscoveryMessage : Innerexception: System.IO.FileNotFoundException: Could not load file or assembly 'nunit.framework' or one of its dependencies. The system cannot find the file specified.
2018-07-24T19:30:49.7825183Z File name: 'nunit.framework'
2018-07-24T19:30:49.7825380Z    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
2018-07-24T19:30:49.7825652Z    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
2018-07-24T19:30:49.7826115Z    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
2018-07-24T19:30:49.7826376Z    at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
2018-07-24T19:30:49.7826616Z    at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
2018-07-24T19:30:49.7826916Z    at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
2018-07-24T19:30:49.7827157Z    at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
2018-07-24T19:30:49.7827394Z    at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
2018-07-24T19:30:49.7827583Z    at NUnit.Engine.Drivers.NUnit3FrameworkDriver.CreateObject(String typeName, Object[] args)
2018-07-24T19:30:49.7827720Z    at NUnit.Engine.Drivers.NUnit3FrameworkDriver.Load(String testAssemblyPath, IDictionary`2 settings)
2018-07-24T19:30:49.7827891Z    at NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)
2018-07-24T19:30:49.7827976Z

The tests go on to be discovered and run OK, but I'm wondering about the nature of these messages. My app and tests are written in 4.5.2 and I don't get these errors locally in VS.

Rob Prouse

unread,
Jul 26, 2018, 8:53:38 AM7/26/18
to NUnit-Discuss
How are you running the tests on the build agent? It looks like you are attempting to run tests on non-test projects? Maybe running on the whole solution?

--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to nunit-...@googlegroups.com.
Visit this group at https://groups.google.com/group/nunit-discuss.
For more options, visit https://groups.google.com/d/optout.

Matt

unread,
Jul 27, 2018, 8:31:42 AM7/27/18
to NUnit-Discuss
Yep, that was it. I wasn't specific enough in the path to the test project.

Thanks for your assistance :)
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages