roslyn-sdk icon indicating copy to clipboard operation
roslyn-sdk copied to clipboard

Update Testing README to add best practice for caching ReferenceAssemblies

Open MattKotsenas opened this issue 1 year ago • 1 comments

Add a "best practice" and example of caching ReferenceAssemblies between tests. New users of the testing infrastructure often set the reference assemblies in a constructor, but don't use static or another method to share the instance between tests resulting in a lot of re-resolution and slow tests. As best I can tell this guidance isn't documented anywhere, but all the tests seem to do it.

MattKotsenas avatar Jun 07 '24 20:06 MattKotsenas

@sharwell, this PR has some documentation changes that are also related to #1162.

Feel free to either take this PR as-is, or if you want the test framework stuff as part of your change I can rebase away that part and make this reference assembly specific.

Edit: I rebased away the XUnit stuff since that's already merged.

MattKotsenas avatar Jun 14 '24 13:06 MattKotsenas

Hi @MattKotsenas,

Can you review #1176 to see if it meets your needs in a (hopefully) simpler fashion?

Thanks!

sharwell avatar Aug 13 '24 16:08 sharwell

@MattKotsenas I believe this should no longer be necessary (per the previous comment). Please feel free to reopen if you find otherwise.

sharwell avatar Aug 26 '24 15:08 sharwell

Sorry, this fell down my TODO list. This works for me! Thanks!

MattKotsenas avatar Aug 26 '24 17:08 MattKotsenas