OrleansContrib / orleans.storageprovider.ravendb

Orleans StorageProvider for RavenDB
Apache License 2.0
11 stars 8 forks source link

Turning tests that were buried in client into unit tests and added test ... #1

Closed CameronVetter closed 10 years ago

CameronVetter commented 10 years ago

Turning tests that were buried in client into unit tests and added test showing problem with grain reference in grain state. I ended up creating these while chasing a different bug, and thought you might want the unit tests contributed as a starting point. Basically this gets you this:

image

Hope you don't mind if I contribute...

danielmarbach commented 10 years ago

Hy Cameron I feel guilty. Plesae don't be offended when I leave this PR a few more days open. I really appreciate your effort and want to incorporate it. But currently I'm preparing for two presentation and also my birthday party on saturday. I can start looking into it on monday I think. Sorry for the delay.

Daniel

CameronVetter commented 10 years ago

Daniel,

No problem, I've been working on other stuff too... Any thoughts on turning this into a nuget package? For now I've made it into a nuget package on my private repo (just for internal use), but it would be great to get this setup as a package on nuget.org.

Cameron

On Wed, Jun 4, 2014 at 3:33 AM, danielmarbach notifications@github.com wrote:

Hy Cameron I feel guilty. Plesae don't be offended when I leave this PR a few more days open. I really appreciate your effort and want to incorporate it. But currently I'm preparing for two presentation and also my birthday party on saturday. I can start looking into it on monday I think. Sorry for the delay.

Daniel

— Reply to this email directly or view it on GitHub https://github.com/danielmarbach/orleans.storageprovider.ravendb/pull/1#issuecomment-45065251 .

danielmarbach commented 10 years ago

Hy cameron I started digging into this. Is a bit more complex than I thought. I need to hook in several custom serializer routines into ravendb. I started using the new UnitTestSiloHost provided by the samples but apparently I stumbled over several bugs which delayed my work significantly. I'll keep you up to date. Daniel

danielmarbach commented 10 years ago

I got it into Raven like this:

{
  "Email": "asdf@gmail.bs",
  "SentAt": "2014-06-15T13:39:27.9698012+00:00",
  "Person": "YWI+AAAAT3JsZWFucy5TdG9yYWdlUHJvdmlkZXIuUmF2ZW5EQi5UZXN0SW50ZXJmYWNlcy5QZXJzb25SZWZlcmVuY2UAAAAAAAAAAAABAAAAAAAAAHq8EdT///8DAA=="
}

Kinda ugly. All providers out there except the Azure don't support grain references. But I really want this achieved. I'm thinking about storing the KeyString only and then dynamically get it over the factory. But this makes everything more complicated. The above document shows a path I'm currently tracking where the GrainReference is serialized by using the SerializationManager.

danielmarbach commented 10 years ago

Got it working. I try to push tomorrow

CameronVetter commented 10 years ago

Glad to see you got it to work. It does make sense to me to do it as a reference. I look forward to seeing the implementation after you push it.

danielmarbach commented 10 years ago

Hy cameron, Everything is pushed. It required me to do a bit heavy lifting inside Json.NET but I think the code is now extremely simply and good to maintain. The next task will be the nuget stuff. I'll open up an issue so that we can discuss possible approaches. Closing this pull because I got some rough Test infrastructure (which isn't yet complet). Keep the good pulls coming! Daniel

danielmarbach commented 10 years ago

Yeah even collections as state work!

{
  "Email": "asdf@gmail.bs",
  "SentAt": "2014-06-17T21:43:30.5257186+00:00",
  "Person": [
    {
      "Key": "0000000000000000000000000000000203ffffffd411bc7a",
      "Data": "YWI+AAAAT3JsZWFucy5TdG9yYWdlUHJvdmlkZXIuUmF2ZW5EQi5UZXN0SW50ZXJmYWNlcy5QZXJzb25SZWZlcmVuY2UAAAAAAAAAAAACAAAAAAAAAHq8EdT///8DAA=="
    },
    {
      "Key": "0000000000000000000000000000000203ffffffd411bc7a",
      "Data": "YWI+AAAAT3JsZWFucy5TdG9yYWdlUHJvdmlkZXIuUmF2ZW5EQi5UZXN0SW50ZXJmYWNlcy5QZXJzb25SZWZlcmVuY2UAAAAAAAAAAAACAAAAAAAAAHq8EdT///8DAA=="
    }
  ]
}