Yep. It’s xunitcontrib release time again, and this one’s a pretty major one. If you use the ReSharper runner, you really want to download this one.
(If you want to cut to the chase and just get the binaries and install instructions, then check out the release page on CodePlex.)
As usual, it’s a ReSharper focussed release, with improvements to the test runner and the addition of External Annotations and Live Templates. I’ll look at these last two in another post, because I want to focus on the big ticket item today – the runner.
So what’s the big news?
Well, if you’ll forgive a little enthusiastic hyperbole:
Version independence.
Finally.
Up until now, the ReSharper test runner would run your tests with the 1.1 released version of xunit.dll only. If your test project is using a different version, such as the new CTP of 1.5, you’ll get a cryptic error message, and no tests would run.
One significant rewrite later, and it’s now using the same version independent runner API that the console and msbuild runners use.
In short, you can now use any version of xunit you like.
Cool, and very much a big deal.
But rather embarrassingly, the bit which pleases me most is a simple side effect.
One of the nice things that xunit does is randomise the order in which tests are run. And because I’m now letting xunit handle everything, we get that for free:
(I really should have done that as an animated gif; it’s nice to see in action.)
So that’s the Big New Feature. What else is there? This is a small one, but I like it. Nested exceptions are now formatted nicer. Before:
After:
And give or take a couple of things, that’s pretty much it for user-visible changes. But there are a couple of other things I want to point out though.
Firstly, that breathless Twitter post above came from a deep dive into the ReSharper test runner framework. Amusingly (after having worked on this project for the past 4 or 5 months) I finally understand how all of this works. And I’ve been heavily commenting the code to explain what’s going on. I hope it can be of use to someone else who wants to write a test runner.
(Yes, that’s right, I just made code comments a feature.)
I also have another post brewing about my developer conscience kicking in and pointing out that I could actually write unit tests for the newly restructured code. (Short version: TDD rocks + I finally get BDD.)
But it’s not all roses. There’s still no installer, and there’s truly terrible support for theory style tests (and I mean terrible. You’ll see output and exceptions, but not together. And you won’t know which test row caused the output, especially since they’re now run in random order too)
So what’s next?
Well, in part, that’s up to you. Check out the Issues on CodePlex and vote for what you want. Leave a comment here or on Twitter (via @citizenmatt or #xunitcontrib). But I really want to do something about those theory tests. I’m not sure what yet, though.
Right, that’s enough. Go and download it already.