OrleansContrib / OrleansTestKit

Unit Test Toolkit for Microsoft Orleans
http://dotnet.github.io/orleans
MIT License
78 stars 43 forks source link

Added support of GetPrimaryKey #74

Closed Ilchert closed 9 months ago

Ilchert commented 5 years ago

Added support of GetPrimaryKey in GrainReference and IAddressable. #47, #73

seniorquico commented 5 years ago

It might take me a bit to review this. Off the cuff... I'm a bit concerned about the long-term maintenance of all the reflection magic. This library originally used lots of reflection magic to make things work (I don't recall if that was published to NuGet, it may have been our internally used bits before we were able to open source the library).

@dsarfati Do you recall injecting the IActivationData? What do you think of this reflection-based approach?

Ilchert commented 5 years ago

There is the only way to support Grain.GrainReference via reflection. We have already had some reflection and in short, this pull request just sets Grain.Data filed to properly configured IActivationData instance.

I did it to test my custom GrainStorage. It receives GrainReference as a parameter, but test grain hasn't set up Grain.GrainReference properly.

Ilchert commented 5 years ago

@seniorquico Any update here?

Ilchert commented 5 years ago

@seniorquico I am still here :)

codecov[bot] commented 3 years ago

Codecov Report

Merging #74 (3639658) into master (bc1b86b) will decrease coverage by 1.39%. The diff coverage is 69.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #74      +/-   ##
==========================================
- Coverage   80.71%   79.31%   -1.40%     
==========================================
  Files          29       29              
  Lines         420      469      +49     
  Branches       45       58      +13     
==========================================
+ Hits          339      372      +33     
- Misses         69       77       +8     
- Partials       12       20       +8     
Impacted Files Coverage Δ
src/OrleansTestKit/TestGrainCreator.cs 72.13% <68.62%> (-19.54%) :arrow_down:
src/OrleansTestKit/TestGrainIdentity.cs 84.37% <75.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bc1b86b...3639658. Read the comment docs.

seniorquico commented 9 months ago

This PR needs to be rebased and reopened against the 3.x branch. Note- this issue has been fixed in version 4 and above the Orleans TestKit (which support Orleans 7+).