Can you prevent the Invoke-DatabaseTests cmdlet from rebuilding the target database?
evans_pb
Posts: 3 New member
I am currently using the SQL Change Automation 3.0 and the SQL Change Automation Powershell 3.0 tools. I am using TFS Version 16.122.27102.1. We are using the Invoke-DatabaseBuild and Invoke-DatabaseTests cmdlets in order to validate the schema and run tSQLt tests, respectively. We will always run the tests after the schema has been validated. We noticed that both the Build and Test cmdlet "clean" the database and then rebuild the database from scratch. Is there a way to prevent the Invoke-DatabaseTests cmdlet from doing this? Since the Build cmdlet has already created and validated the schema, I would rather not have the build waste time by rebuilding it again the next step. I just want the Test cmdlet to run the tests and output the results. Thank you for your help.
Best Answer
-
Andrea_Angella Posts: 66 Silver 4Unfortunately, at the moment there is not a way to do it.
Running Invoke-DatabaseTests always does a build before running the tests.Andrea Angella
Lead Software Engineer | Red Gate
Website: www.productivecsharp.com
Twitter: @angella_andrea
Answers
Now, we can just run the test step and skip the build step, since the test step validates the schema and runs tests. But it would nice to have them be separate steps within our build process.