Explicitly set xUnit MSBuild WorkingFolder property #1139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Looking at the Travis failure @nulltoken pointed out in #1138, I noticed that when it fails, it was looking for
/home/travis/build/libgit2/Resources/testrepo.git
which is not even in the same folder as the source code! It should be looking for
/home/travis/build/libgit2/libgit2sharp/LibGit2Sharp.Tests/Resources/testrepo.git
All of the test repo paths are build like this:
../../Resources/testrepo.git
so looks like xUnit is sometimes changing its working folder in the middle of testing?I could reproduce this on my local ubuntu VM, which is running mono 3.12.1, same as Travis.
However, on my mac, I have mono 4.0.2 and it ran perfectly. Same for Windows.
I have another VM running CentOS and mono 4.0.2, and after getting the tests running there... it also ran without errors!
It seems that the xUnit.net 2.0 MSBuild test runner does not play nicely with mono 3.12.1, which is being used on the linux Travis CI builds.
Looking through the xUnit docs, I saw that there is a WorkingFolder property that can be set explicitly instead of relying on the default value. After setting that value, the failures on mono 3.12.1 seem to have vanished.