Ayende @ Rahien

Hi!
My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 5,972 | Comments: 44,508

filter by tags archive

More xUnit tweaks, dynamic test skipping


For a long time, xUnit’s dev has resisted adding support for skipping a test dynamically. You could create your own Fact class and handle that yourself, but that was quite a lot of work, for something very specific.

In RavenDB, we had the need to dynamically decide whatever the test can run based on the actual test situation, so I decided to add this to our xUnit fork. This turned out to be really simple to do. Just three lines of code Smile

https://github.com/ayende/xunit/commit/82accb4c850a3938187ac334fb73d6e81dc921e3#diff-3c2b9f2cb8392f32456d0bf81151b59fR57


Comments

Chris Marisic

I really like xUnit, but some of their dogmatic choices really irritate me. This is one of those times they choose to be dogmatic over actually getting shit done.

They make users jump through hoops just so they can stay on their high and mighty horse.

I wonder how many contributors to xUnit have all built the very same things they refuse to allow into the project in their own real systems. I suspect it would be more than half.

chris mckelt

I went the attribute based approach inheriting from [Fact].

This way I had a global setting to run/ignore tests marked with the [OptionallyIgnoreTestFact] attribute at run-time.
https://github.com/chrismckelt/XUnit.OptionallyIgnore

Scooletz

@ChrisMarisic, +1 against xUnit dogmatism. For example, Assert with a message http://xunit.codeplex.com/workitem/4638 That's why I prefer to stick to NUnit. It's simple and let's you express in your own way.

Chris Marisic

@Scooletz it's crazy to me to see the xUnit official response was basically "you suck". Providing additional context is ALWAYS A win. Boggles my mind to see people opposed to additional context. Everything is meaningless without context.

Chris Marisic

edit if slorion isn't your codeplex account, replace "you" with "slorion"

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

  1. Paying the rent online - 15 hours from now
  2. Reducing parsing costs in RavenDB - about one day from now

There are posts all the way to Aug 04, 2015

RECENT SERIES

  1. Production postmortem (5):
    29 Jul 2015 - The evil licensing code
  2. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
  3. API Design (7):
    20 Jul 2015 - We’ll let the users sort it out
  4. What is new in RavenDB 3.5 (3):
    15 Jul 2015 - Exploring data in the dark
  5. The RavenDB Comic Strip (3):
    28 May 2015 - Part III – High availability & sleeping soundly
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats