-
Notifications
You must be signed in to change notification settings - Fork 899
Enable custom unit test location with standard location fallback #1035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if (Environment.GetEnvironmentVariables().Contains(LibGit2TestPath)) | ||
{ | ||
tempPath = Environment.GetEnvironmentVariables()[LibGit2TestPath] as String; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a new line after this brace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Added instructions to the README.md per @nulltoken |
1. Set the `LibGit2TestPath` environment variable to a path in your development environment. | ||
2. Set the Instruct your anti-virus software to ignore the `LibGit2TestPath` path. | ||
3. Install a RAM disk like [IMDisk](http://www.ltr-data.se/opencode.html/#ImDisk) and set `LibGit2TestPath` to use it. | ||
* Use `imdisk.exe -a -s 256M -m X: -p "/fs:fat /q /v:ramdisk /y` to create a RAM disk. This command can be placed into a scheduled task or run manually before you begin unit-testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a bullet point with a quick one liner (Powershell, maybe?) showing how to set the LibGit2TestPath
to the new mounted drive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also maybe should we adding a quick note explaining that if the path doesn't exist, the test repos will fallback to standard location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more nitpicks:
- Regarding the command line to imdisk.exe, I think a quote (") is missing at the end
- It may be worth it to specifiy that this command should be run with elevated privileges.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, missing quote on the command (copy/paste error there). Agreed, need to mention elevated privileges requirement.
I'll add the fallback note to reassure readers.
As for PowerShell, I've no PowerShell experience and would have no idea where to begin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for PowerShell, I've no PowerShell experience and would have no idea where to begin.
Ok. We'll update the doc if users struggle with this.
Enable custom unit test location with standard location fallback
Awesome feature Thanks! |
Published as NuGet pre-release package |
Enables developers of Libgit2Sharp to use a custom path for the temporary repositories used during unit testing. For example, I've setup a RAM disk on my development machine. While the RAM disk isn't suitable for all of operating system's
%TEMP%
needs, it's ideal for unit testing Libgit2Sharp.On my Surface Pro 3 (Core i5 version) unit tests are reduced from roughly 17 minute to around 2 minutes. Basically an order of magnitude improvement.
Of course, we should fallback to the traditional
%TEMP%
folder if the developer hasn't provided a viable alternative.This PR has no impact on non-Windows development environments.