views:

40

answers:

2

What approach would you take while developing a custom MSBuild Task in a test driven way?

Are there any available test harnesses suitable for test drive development of a Microsoft.Build.Utilities.ToolTask extension?

I was considering attempting to use NUnit or MSUnit and check files generated and where they are placed, though this I forsee this as being a little clunky.

A: 

Hi,

it's not really TDD way but look at the Tool MS Build Sidekicks

This tool really helps us to develop our nightly/daily builds (with database creation, structure compare, CodeAnalysis, test execution, clickonce deployment ...)

You can analyse and debug the build types on the build machine and on the local development machine.

K.Hoffmann
Yeah it's not really answering the question, but it is an an interesting look tool, thanks!I've also seen (but not yet tried) this freebie tool: http://www.msbuildexplorer.com/
paulecoyote
Oh sry, my answer should be a comment or?Thanks for the link, i put it into our wiki.
K.Hoffmann
*shrugs* I don't use this site enough to know proper etiquette. I still think your info is potentially useful.
paulecoyote
A: 

Build scripts are not designed to be tested.. but

You can create some SmokeTests of your build to see if everything went ok. If you are deploying a website you can have some smoke tests to see:

  1. Login page could be opened
  2. Login page works (You can make a correct login and a failed one)
  3. Core funcionality works (Once you accessed to your site you can perform some basic action like opening product page or similar)

Those smoke test should be able to be called from command line, so you can call them from task AfterDropBuild to see the result of smoke tests just after build was created.

cad