-
Notifications
You must be signed in to change notification settings - Fork 899
[WIP] Migrate to Xunit 2.0 #895
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
@@ -106,7 +106,7 @@ public void CanUnstageUnknownPathsWithLaxUnmatchedExplicitPathsValidation(string | |||
{ | |||
Assert.Equal(currentStatus, repo.RetrieveStatus(relativePath)); | |||
|
|||
Assert.DoesNotThrow(() => repo.Unstage(relativePath, new ExplicitPathsOptions() { ShouldFailOnUnmatchedPath = false })); | |||
repo.Unstage(relativePath, new ExplicitPathsOptions() { ShouldFailOnUnmatchedPath = false }); |
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.
Eh?
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.
Assert.DoesNotThrow
disappeared from Xunit 2.0. The rationale behind this being "No line line should throw, otherwise the test would fail". More details at xunit/xunit#188
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.
What @nulltoken said - just let the test fail, don't wrap it...
Hmmm... I haven't updated the AppVeyor build script yet which explains the failure. However, the Travis CI failure looks more suspicious. @Therzok Any idea? |
FWIW, regarding the (current) lack of |
Yeah, it's pretty simple. It's a reflection resolution issue. You need to copy the xunit dlls in the output directory of the tests. |
@@ -0,0 +1,4 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
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.
What's this file doing here?
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.
It's installed by the test runner NuGet package
Also, the travis failure seems related to this. |
Good 👀! From his last comment @bradwilson seems a little bit lost regarding how to fix this issue. Do you think you could lend him a hand? |
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="xunit" publicKeyToken="8d05b1bb7a6fdb6c" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-1.9.2.1705" newVersion="1.9.2.1705" /> |
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.
Hmmm... This redirect looks fishy.
The typeload exception can occur for a variety of reasons:
It's most likely something in the deployment step of XUnit that changed between v1 and v2. |
<HintPath>..\Lib\xUnit\xunit.extensions.dll</HintPath> | ||
<Reference Include="xunit.assert"> | ||
<HintPath>..\packages\xunit.assert.2.0.0-beta5-build2785\lib\portable-net45+aspnetcore50+win+wpa81+wp80+monoandroid+monotouch10\xunit.assert.dll</HintPath> | ||
<Private>True</Private> |
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.
Why is this private and the rest are not?
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.
I'm not sure... I'm going to drop this and see if that fails.
I've opened an issue in the Xunit.Net repository: How can one reimplement [SkippableFact] and [SkippableTheory] in Xunit2.0? |
68560fd
to
df6f3e4
Compare
Yeah! I've succeeded in making Xunit 2.0 run on AppVeyor |
4e439e6
to
c2b0385
Compare
@FeodorFitsner Thanks a lot for making xUnit on AppVeyor such a nice experience with xunit/xunit#117 ! Running #894 (with xUnit 1.9.x) produces this build log and run in Whereas, running this WIP PR (built-on top on the previous one and only making the necessary changes to switch to xUnit 2.0) produces this build log and run in However, I'm slightly puzzled regarding the difference in run times. I was (foolishly?) expecting xUnit 2.0 to be actually faster, not slower. Any idea? |
@nulltoken That's a really good question. It could have been communication lags of pushing test results to real-time build console. However, I ran simple tests for xUnit 1.9.2 and 2.0.0 and they seem to be approx. equal: Build workers have the same |
I've started hacking around at a replacement for |
@dahlbyk 😻 |
63f6aa7
to
68f035a
Compare
@nulltoken any way to trigger a master build of mono to test xunit 2 with it? |
@Therzok Would there a way to do this by patching https://github.com/libgit2/libgit2sharp/blob/vNext/CI/travis.osx.install.deps.sh ? If you find out, feel free to push to this branch. |
Temporarily requires https://www.myget.org/F/xunit/ as an additional NuGet feed. (cf. xunit/samples.xunit@70bc7e0#commitcomment-12022759) |
you could add a NuGet.config to the project root to codify this requirement e.g. https://github.com/xunit/xunit/blob/master/NuGet.Config |
@shiftkey Inetresting! Any example how I could pass this config to the |
@nulltoken if you're launching it from the repository root, it should work fine as per the docs
But I haven't verified this behaviour so perhaps it's incorrect. Otherwise, you can pass in the config file explicitly:
|
FYI, when I was first getting the native binaries nuget package stuff going, I had tried to add a temporary myget feed via the nuget.config, and for some reason I ran into problems getting it to restore properly on Travis builds. Instead of investigating why it wasn't working, I just put the temp package directly on nuget,org. Anyway, it's still worth giving it a try to see if it works correctly this time. |
@bording interesting. Was this with or without specifying the |
I didn't try the |
@bording @nulltoken I think we've got enough impetus to try both options again - we should be able to see if it succeeds with either option. |
Yes, we definitely should be able to get it working, especially since it makes sense to spend the time now. Just wanted to make sure people were aware that it might require some tweaking to make everything play nicely together! |
@bording 👍 |
@bording said:
Note that the file name is case sensitive on Unix systems, but not on Windows systems. It should always be named |
That has to be the issue I ran into then, because I doubt I named it that way when I tried it! |
I've added a However, we hit a failure on Travis
AppVeyor is also complaing, but I'm unsure why
When locally ran, one of the tests started to crash. This last issue seems unrelated to this PR and may awfully reminds me of #1091
|
@nulltoken Looks like that People are reporting still running into it on 4.0.2 😦 |
@bording You're right. I've seen this and (sneakily 😉) left this out for @Therzok to see. However, I'm a bit puzzled by the AppVeyor failure... The Coverity build has never caused any issue before. Disabling it seems to resolve the issue, but I'm not sure to understand what the relation with xUnit 2.0 is. /cc @FeodorFitsner @dakshesh-coverity Any idea? |
59535a7
to
886ca8f
Compare
Temporarily disables Coverity analysis to troubleshoot AppVeyor issues - See https://ci.appveyor.com/project/libgit2/libgit2sharp/build/1156/job/sh3k52999pllnoic
@Therzok ^^
@bradwilson f017882 passes on Windows. It's parent doesn't. Any idea? |
@nulltoken I think mono 4.3 with -noappdomain should work. |
@Therzok Mono >= 4.2 should work even with appdomain as afaik all the bugs where fixed. You can try the weekly builds. |
Right, |
We've gone with 1.9 and a 2.0 runner which works everywhere. Maybe eventually we'll want to move to 2.0 for everything, but that'd mean dropping older mono support. |
Changes Unknown when pulling 35d6833 on ntk/xunit20 into ** on vNext**. |
This depends on #894.
Some things are still missing (eg.
[SkippableFact]
), but this reduced the time to run the full test suite from 01.41 down to 00:32 on my box. Promising!