-
Notifications
You must be signed in to change notification settings - Fork 899
Tests don't run from command-line or VSCode #1629
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
Comments
lupino3
added a commit
to lupino3/libgit2sharp
that referenced
this issue
Nov 2, 2018
The resources path is set based on the path of the current assembly. The problem is that the assembly directory has a different number of components, depending on whether the Configuration environment variable is set or not. Therefore, the previous code, that depended on the number of subdirs, would fail if there is no value for the Configuration environment variable. The new code looks for the occurrence of a well-known string in the path and bases the path of the test resources off that position. It is still pretty sub-optimal, but I think it's a bit less sub-optimal than it was. Tested in the following ways: - run dotnet test on one test from the command line on Windows; - click on "Run Test" from Visual Studio Code. Fixes libgit2#1629.
alex-weaver
pushed a commit
to alex-weaver/libgit2sharp
that referenced
this issue
Mar 23, 2023
The resources path is set based on the path of the current assembly. The problem is that the assembly directory has a different number of components, depending on whether the Configuration environment variable is set or not. Therefore, the previous code, that depended on the number of subdirs, would fail if there is no value for the Configuration environment variable. The new code looks for the occurrence of a well-known string in the path and bases the path of the test resources off that position. It is still pretty sub-optimal, but I think it's a bit less sub-optimal than it was. Tested in the following ways: - run dotnet test on one test from the command line on Windows; - click on "Run Test" from Visual Studio Code. Fixes libgit2#1629.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction steps
Alternatively, after cloning, run
dotnet restore
and run any test withdotnet test
, for example:Expected behavior
The test runs, and either passes or fails.
Actual behavior
The test always fails, cannot open the
testrepo_wd
directory. Example:The directory is not found because the path is wrong. It is missing the git repo name. The correct one would be:
Note that this is fixed if the environment variable
Configuration
is set torelease
, for some reason.Version of LibGit2Sharp (release number or SHA1)
0a9c84d (current HEAD)
Operating system(s) tested; .NET runtime tested
Windows 10 Enterprise 1803
.NET Core 2.1.403
The text was updated successfully, but these errors were encountered: