Dmitry Arestov
Dmitry Arestov

Reputation: 1668

CruiseControl.Net: Run NUnit task with parameters

My NUnit tests fail unless the nunit runner is launched with /noshadow parameter. But in CC.net, it seems to be impossible to supply this parameter in the <nunit> block.

I know I always can fall back to generic <exec> block, but is there really no way to configure the <nunit> block?

Upvotes: 0

Views: 219

Answers (1)

granadaCoder
granadaCoder

Reputation: 27852

I would surmise that if this switch/flag isn't documented, then it isn't available in the that you mention.

The thing to keep in mind with these custom tasks, is that usually they are just friendly-wrappers for what eventually becomes a command-line call.

The task-author is just making things simpler for you. They take on the onus of creating the correct commandline, and pass that to the original .exe.

Now, it looks like somebody did address the command line of your interest here:

https://github.com/loresoft/msbuildtasks/blob/master/Source/MSBuild.Community.Tasks/NUnit.cs

Note the code:

 if (DisableShadowCopy)
{
    builder.AppendSwitch(c+"noshadow");
}

So I would see if you can get this task working.

In fact, I barely use any of the built in CC.NET tasks, except for source-code download and starting up msbuild.exe...and then the publishing. I leave the hard stuff to msbuild.

Aka, I pull source-code, which includes a MyBuild.proj file. Then I have cc.net execute "msbuild.exe MyBuild.proj" Then I have cc.net do some of the publishing.

Why?

If most of my logic is in a msbuild .proj file, then if I ever switch to another CI tool, the transition is much less traumatic. In fact, I recently learned that an old job of mine went to TFS, and because I wrote most of the build logic in msbuild (and not a lot of cc.net tasks)....the transition to TFS was fairly painless. If I had used cc.net tasks instead......every single one of those would have had to been translated to a corresponding tfs task.... :<

Anyways. Back to your question. Keep in mind...that somebody is basically (via a task) is usually just writing up a nice way to wire up things, and doing the command line arguments/syntax sugar for you. So they sometimes miss a flag, or a flag gets added later, but the original task is not updated.

So you'll either need to modify the source code yourself........ :< Or pick a library that keeps more up to date.

Good luck.

Upvotes: 1

Related Questions