What are the challenges you face when working across database platforms? Take the survey

Source control tSQLt procs and tables but keep them from being deployed to higher environments

We're starting to use tSQLt for unit testing. Next, we want to source control those tests. The big question is, when we want to deploy changes to higher-than-dev environments, how can we simply keep those tests from being considered? Our challenge is that each test class is its own database schema. We're just getting started and are using this convention:

Stored Procedure to be tested: schema1.storedprocedure

tSQLt class: schema1_storedprocedure

With that convention, when it is time to deploy changes to higher environments (e.g. using SQL Compare), both the tSQLt schema and the class schema schema1_storedprocedure are offered for deployment. We don't want the framework or the tests promoted.

What are some strategies to keep unit tests from polluting higher environments?

Best Answer

Sign In or Register to comment.