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

Notification

Icon
Error

Trouble running tests that use RavenDB 3.x embedded in memory with NCrunch 2.12.0.2
tcabanski
#1 Posted : Friday, February 13, 2015 2:44:30 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/13/2015(UTC)
Posts: 2
Location: United States of America

Project builds both in VS 2013 and from the command line. Tests pass from the command line. However, NCrunch fails the 3 tests currently using RavenDB embedded in memory with the following error:

SetUp : System.IO.FileLoadException : A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
at Raven.Database.Util.MetricsCountersManager..ctor()
at Raven.Database.Indexing.WorkContext..ctor() in c:\Builds\RavenDB-3.0-Unstable\Raven.Database\Indexing\WorkContext.cs:line 48
at Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration configuration, TransportState recievedTransportState) in c:\Builds\RavenDB-3.0-Unstable\Raven.Database\DocumentDatabase.cs:line 120
at Raven.Database.Server.RavenDBOptions..ctor(InMemoryRavenConfiguration configuration, DocumentDatabase db) in c:\Builds\RavenDB-3.0-Unstable\Raven.Database\Server\RavenDBOptions.cs:line 54
at Raven.Database.Server.OwinHttpServer..ctor(InMemoryRavenConfiguration config, DocumentDatabase db, Boolean useHttpServer, Action`1 configure) in c:\Builds\RavenDB-3.0-Unstable\Raven.Database\Server\OwinHttpServer.cs:line 24
at Raven.Server.RavenDbServer.Initialize(Action`1 configure) in c:\Builds\RavenDB-3.0-Unstable\Raven.Database\Server\RavenDbServer.cs:line 106
at Raven.Database.Client.EmbeddedDocumentStore.Initialize() in c:\Builds\RavenDB-3.0-Unstable\Raven.Database\Client\EmbeddedDocumentStore.cs:line 225
at Raven.Client.Embedded.EmbeddableDocumentStore.Initialize() in c:\Builds\RavenDB-3.0-Unstable\Raven.Database\Client\EmbeddableDocumentStore.cs:line 138
at SouthsideUtility.RavenDB.Testing.RavenTestDocumentStore..ctor(Boolean ravenInMemory) in c:\Users\tom\Documents\development\SouthsideUtility\app\SouthsideUtility.RavenDB\Testing\RavenTestDocumentStore.cs:line 26
at SouthsideUtility.RavenDB.Testing.RavenDbTest..ctor() in c:\Users\tom\Documents\development\SouthsideUtility\app\SouthsideUtility.RavenDB\Testing\RavenDbTest.cs:line 12
at RabbitOperations.Collector.Tests.Unit.Configuration.SettingsTests..ctor()

If I switch the tests to use an external RavenDB server, they work fine from NCrunch.

I followed the advice to set "prevent signing of output assembly" to true for all the projects without success.

This is happening in an open source project I am working on. Source code is available at https://github.com/South...ftware/RabbitOperations on the branch feature/signalr. It can be cloned and opened in VS 2013. Nuget packages should be downloaded automatically on build. Command line build uses powershell with this command:

> psake


Remco
#2 Posted : Friday, February 13, 2015 9:33:37 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Hi, thanks for sharing this issue.

I've tried cloning the source code you've described above, but all tests seem to be passing normally. Is it possible this is sequence-specific code?

I'm not sure exactly what the test is trying to do in this situation .. but it's possible that it's attempting to call into your assemblies from another strongly built assembly outside the solution. If this is indeed the case, the output assemblies must be signed and enabling the 'Prevent signing of output assembly' will likely give you problems.
tcabanski
#3 Posted : Friday, February 13, 2015 10:24:55 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/13/2015(UTC)
Posts: 2
Location: United States of America

You mean it works from within VS.NET using NCrunch? It works on my machine from the command line but not from NCrunch. Is there something I can do to reset NCrunch to the default state you are seeing?

There are no strongly named assemblies in my project. RavenDB does not use strong signing either.

There are no sequence issues in the tests. It's just any test that uses RavenDB embedded in memory (currently the 3 tests in SettingsTests).
Remco
#4 Posted : Friday, February 13, 2015 11:03:08 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Clearing out your NCrunch settings files and cache directory should give you the same behaviour .. otherwise you can try cloning the branch to a different location to see if this makes the tests pass.

I'll be honest and say that I know absolutely nothing about how RavenDB works, or how its tests behave. I did notice that the tests in your project are inheriting from a base test type in RavenDB, which does suggest RavenDB has some kind of framework-based testing environment using its own code to bootstrap the test. I cannot assume that this code has been written with NCrunch in mind, and it's possible that the code does some environment-specific or cross domain work that is beyond any control or understanding of NCrunch. I would suggest checking to see what the RavenDB code does and how it loads the assemblies into memory.
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.041 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download