Executing tests outside SQL Test
We recently had a situation where a user executed a test through a regular execute statement instead of working through the SQL Test UI. The test involved faking tables. The test threw an error and the tables being faked were left in a state where they did not have their original name, forcing us to restore from a backup. The test itself looks ok. The big question here is whether it is expected unit tests always be run through the UI.
0 · Share on Twitter
Thank you for your forum post.
SQL Test is just a UI wrapper for the tSQLt unit test framework. The actual tests created are Stored Procedures created in the database that a user adds to SQL Test.
There is nothing in place to prevent the Stored Procedures from being executed outside of SQL Test. Ideally you would want to run the tests with SQL Test / tSQLt framework, as each test within the tool will drop any objects it creates.
Senior Product Support Engineer
Redgate Software Ltd
Email: [email protected]