0

I am testing SQL scripts deployment automation using VSTS, the cycle I am following to test if my release cycle is working for different scenarios is as follow,

  • Make changes to SQL Project in VS, build and push to VSTS repo
  • Make changes to release steps for deploy dacpac if required
  • Create a new release
  • Deploy and repeat for redeploy

I have to test lots of scenarios including but not limited to followings,

  • Add a new table to sql project and test if it works
  • Delete a column and rollback changes if something goes wrong
  • Modify column and check if any data loss happens...
  • etc..
Mathematics
  • 7,314
  • 25
  • 77
  • 152
  • What do you think of my suggestion? Regarding schema changes, it will throw exception if you want to retrieve the data from a non-existing table or column and the test will be fail (https://stackoverflow.com/questions/741029/best-way-to-test-exceptions-with-assert-to-ensure-they-will-be-thrown). If I misunderstand, let me know. – starian chen-MSFT Jun 16 '17 at 01:35

1 Answers1

-1

Refer to these steps:

  1. Create database unit test project to do test with database: Walkthrough: Creating and Running a SQL Server Unit Test
  2. Refer to this article to deploy Database: Deploy your database to Azure SQL Database using DACPACs (If you are not using azure DB, using WinRM - SQL Server Database Deployment instead)
  3. Add Visual Studio Test to run database unit test
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • This does not answer the question. The person was not asking about deploying database changes or how to test stored procedures; the question was about **testing deployment of schema changes**. – Daniel Mann Jun 15 '17 at 13:51