Hi,
Wondering if anyone has had any experience of DbUp and tSQLt and whether they can sanity check what I'm thinking about at 2am in the morning.
I've previously created a DbUp project for my Db schema, with additional seed data for test purposes. I'm about ready to add an automated step to teamcity to deploy this db to a test environment.
I'm now looking at setting up another step in teamcity to run some sort of validation to prove the few stored procedures and functions present are returning expected seed data. I initially thought I might just run a sqlcmd to call the SPs with params and then compare the outputs to a csv or similar. I've also considered using something like specflow to write tests against the db.
Having then actually googled for possbible options, I've come across tSQLt, which could provide a good base for writing these tests, but in addition, having installed via Redgate tools I've been demoing, it has also generated additional SQLCop tests which could be very useful.
My plan:
Keep the tSQLt framework and tests in a separate dbUp project, so that I can run the main deploy project on all environments, and only deploy the tSQLt framework in test environments. (Arguably the seed data should also be moved into this project as well, but the intention was to use that seed data for other tests such as UI regression testing)
Given I have already generated the framework on a local db server, I'm thinking I need to export everything into scripts to be added to a new DbUp project, then automate this deployment to the same DB as my main DB project when in a test environment.
Does this sound sensible? Anyone done something similar?