Option to exclude tSQLt dependencies?
mfearby
Posts: 24
I've just started looking into SQL Test, and have included my SetUp test script in the same source control repository as the database it's supposed to test, but I don't want to check-in the 15 dependencies that are all tSQLt-related (e.g., FakeTable, Private_ValidateFakeTableParameters, etc).
Is there a way to configure SQL Source Control to never recommend the inclusion of dependencies for any stored procedure in my test schema?
Is there a way to configure SQL Source Control to never recommend the inclusion of dependencies for any stored procedure in my test schema?
I don't always test my code, but when I do, I do it in production :-p
Comments
One option that may help is to ignore the tSQLt objects. SQL Source Control has an option to exclude these, in amongst the Compare Engine settings. You can amend them as described here - look for one called IgnoreTSQLT
Redgate Software
Unfortunately setting IgnoreTSQLT to True excludes my test cases, and not just the tSQLt objects that my test cases depend on. It seems silly to be committing those to source control.
So I guess I should just commit all the tSQLt dependencies and move on? It would be nice if you had an IgnoreTSQLTDependencies option.
Redgate Software
Yes, that would be simplest. When you need to deploy from SQL Compare using SQL Source Control as a data source, and if you don't want to include tSQLt or your tests, you can use the SQL Compare option to exclude them.
Product Manager
Redgate Software
You need those objects (the tSQLt objects as well as your own) there if you want to run the unit tests, so it makes sense that you would always want one with the other.
I'll just commit them, then. Thanks.
Product Manager
Redgate Software
Thanks David. I am currently the only developer, but that might change one day, I guess.
Schema:
Exclude if ( schema name beings with 'tSQLt' ) OR (object name begins with 'SQLCop' )
Stored Procedure:
Exclude if ( schema name beings with 'tSQLt' )
After removing them, they're appearing as things to commit in their own right, not as dependencies. But my filter didn't seem to prevent them being offered as dependencies until today, where I couldn't get it to nag me about dependencies if my life depended on it. Very strange.