@@ -37,7 +37,6 @@ Describe "<type> Install-DBOScript functional tests" -Tag FunctionalTests -ForEa
3737 if ($Type -in ' MySQL' , ' Oracle' ) {
3838 Set-ItResult - Skipped - Because " CREATE TABLE cannot be rolled back in $Type "
3939 }
40- # Running package
4140 {
4241 $null = Install-DBOScript - Path $tranFailScripts @dbConnectionParams - SchemaVersionTable $logTable - DeploymentMethod SingleTransaction
4342 } | Should - Throw (Get-TableExistsMessage " a" )
@@ -49,7 +48,6 @@ Describe "<type> Install-DBOScript functional tests" -Tag FunctionalTests -ForEa
4948 $null = Invoke-DBOQuery @dbConnectionParams - InputFile $cleanupScript
5049 }
5150 It " should throw an error and create one object" {
52- # Running package
5351 try {
5452 $null = Install-DBOScript - Path $tranFailScripts @dbConnectionParams - SchemaVersionTable $logTable - DeploymentMethod NoTransaction
5553 }
@@ -89,6 +87,23 @@ Describe "<type> Install-DBOScript functional tests" -Tag FunctionalTests -ForEa
8987 Test-DeploymentState - Script - Version 2 - HasJournal
9088 }
9189 }
90+ Context " testing rollback deployment" {
91+ BeforeAll {
92+ if ($Type -in ' MySQL' , ' Oracle' ) {
93+ Set-ItResult - Skipped - Because " CREATE TABLE cannot be rolled back in $Type "
94+ }
95+ Reset-TestDatabase
96+ }
97+ It " should rollback version 1.0" {
98+ $testResults = Install-DBOScript - ScriptPath (Get-PackageScript - Version 1 ) @dbConnectionParams - SchemaVersionTable $logTable - DeploymentMethod AlwaysRollback
99+ $testResults | Test-DeploymentOutput - Version 1 - HasJournal - Script
100+ $testResults.SourcePath | Should - Be (Get-PackageScript - Version 1 )
101+
102+ " Beginning transaction" | Should - BeIn $testResults.DeploymentLog
103+ " Success! No errors have occured when executing scripts, transaction will be rolled back" | Should - BeIn $testResults.DeploymentLog
104+ Test-DeploymentState - Script - Version 0
105+ }
106+ }
92107 Context " testing deployment order" {
93108 BeforeAll {
94109 Reset-TestDatabase
0 commit comments