Using MSBuild and the build machine for integration testing
My build machine has been very useful in running unit tests for the various components of the project I'm working on, but having recently spent several days trying to integrate a couple of components to run on a clean machine, I realised that unit testing isn't enough. There were three components that I wanted to use on a clean machine:
The MSBuild task took about 3 hours to write and perfect, and in order:
I then created a new MSBuild project file, which:
- the file watcher service, that monitors a directory for XML files and kicks off...
- the XSLT engine, which converts the XML into a different format and
- the import component, which reads the converted XML and inserts the data into SQL Server
The MSBuild task took about 3 hours to write and perfect, and in order:
- Checks that the relevant directories exist, and test files are present
- Counts the rows in the destination SQL Server table
- Copies some test files in the watched directory
- Waits a few seconds
- Counts the rows in the destination table again
- Makes sure that the correct number of rows have been inserted
I then created a new MSBuild project file, which:
- Runs the installer (silently)
- Starts the file watcher service
- Runs the integration test task
- Stops the file watcher service
- Uninstalls it all again