libpalaso icon indicating copy to clipboard operation
libpalaso copied to clipboard

FileLocationUtilities.GetFileDistributedWithApplication does not work when running tests under Visual Studio Test Platform

Open tombogle opened this issue 5 years ago • 2 comments

If we can figure out an appropriate way in ReflectionHelper to detect that we're running under Visual Studio Test Platform, it should be possible to change the logic to return the executing assembly. Then maybe in FileLocationUtilities.GetFileDistributedWithApplication, we could note that we're running from inside a package location and search within the package contents to find the desired "distfile." This issue came up because required distfiles were added to GlyssenEngine (for use in Vessel), but when running unit tests using microsoft.testplatform.testhost, it works very differently from nunit, and it cannot locate those files.

tombogle avatar Jul 24 '20 17:07 tombogle

@tombogle Is this still an issue for you with Visual Studio 2022? All the FileLocationUtilitiesTests non-Linux tests pass for me in the Visual Studio 2022 (17.13.0) Text Explorer. (... though I'm not sure about trying different test platforms.)

imnasnainaec avatar Feb 13 '25 15:02 imnasnainaec

I haven't tried it, but I would assume so, unless the VS Test Platform radically changed. I really don't much remember what this was all about, and I sort of suspect it isn't particularly mission critical. it may be that the Vessel devs were using VS Test Platform instead of NUnit. I haven't heard anything from the gang at FCBH for a couple years and I don't know if Vessel still even uses GlyssenEngine.

tombogle avatar Feb 13 '25 21:02 tombogle