tSQLt is a Unit Test Framework for TSQL (the SQL dialect in SQL Server).
Most solutions to run tSQLt with TeamCity involves custom SQL and Powershell scripts and even RedGate has a tool for that (and a plugin for TeamCity as well). I needed something ever simpler, that can run tests already present in a database and report the results back. This is the result of that requirement.
An image says more than words:
I updated the project to use the amazing Gradle so it would be easy to build and do nice things (yay!). First, make sure of the following things:
In the project directory you will find a file named ``gradle.properties``` just open it and place the directory where your TeamCity development packages are installed, usually is the directory you installed TeamCity/devPackages. Alternatively, set the environment variable TeamCityDev to that directory.
No worries about dependencies, if everything is alright, Gradle will bootstrap and download all the dependencies from Maven (oh yes, you need an internet connection, of course!).
With Gradle you will have in the box a few commands to play with:
To run all the tests:
gradle test
To build the plugin (you will get the zip plugin file in the distributions directory):
gradle assemblePlugin
Easy, just open IntelliJ, select "Import project" and point to the project directory, make sure you select "Gradle" in the model selection and voila! you have IntelliJ running!
Hey, first, don't be ashamed, we all have issues. The procedure is very similar to IntelliJ. Open Eclipse and in File select Import, chose "Gradle project", and then import the model. Done.
You will need the Gradle plugin for Eclipse btw.
Hey, this is Github, the equivalent of Sparta in the coding world, just clone and send me a pull request, I am a nice person, I swear!