use "which" to locate git installation#999
Conversation
|
Sweet! 👍 |
| [TestCase] | ||
| public void GetInstalledGitBinPathWorks() | ||
| { | ||
| string gitBinPath = new MacGitInstallation().GetInstalledGitBinPath(); |
There was a problem hiding this comment.
I added a test to exercise this -- it should pass on any VFSForGit running system as git should always be installed, but I have a feeling the unit test will run on Windows too and so will fail. How should I restrict a unit test to Mac(+Linux) only?
VFS4G unit tests should not require that Git be installed and they should be able to run on all platforms (with the exception of the Windows unit tests that require .NET Framework).
If we really wanted to unit test the Mac's GetInstalledGitBinPath implementation we'd need to mock out the call to which. However, GetInstalledGitBinPath is hit quite frequently when cloning/mounting and so I think we're getting sufficient coverage of the method from the functional tests.
wilbaker
left a comment
There was a problem hiding this comment.
Unit tests should not require that Git be installed and should run on all platform (except when they require .NET Framework).
|
For my WIP branch, I confess I just removed the unit tests but kept the code change in 215357a, because it was really useful to not have the hard-coded reliance on |
To make sure my earlier comments are clear, I think if the unit test is removed from this PR then it's good to go :) |
Thanks for this! The unit test has been removed. We presumably want some kind of exercise of the platform-specific functionality somewhere, though, I'd imagine. Where should those (eventually) go? |
52e9800 to
791459c
Compare
Match the changes for macOS from 112ce00 for Linux, but exclude the new unit test as it currently fails on Windows.
Currently the platform specific code (like |
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
|
@wilbaker Thanks for the review and clarification there! |
Address this TODO -- the same code will work for Linux later. I added a test to exercise this -- it should pass on any VFSForGit running system as git should always be installed, but I have a feeling the unit test will run on Windows too and so will fail. How should I restrict a unit test to Mac(+Linux) only?
/cc @chrisd8088
/cc github#10