@@ -34,7 +34,7 @@ $newDbName = "_test_$commandName"
34
34
$dropDatabaseScript = ' IF EXISTS (SELECT * FROM sys.databases WHERE name = '' {0}'' ) BEGIN ALTER DATABASE [{0}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DROP DATABASE [{0}]; END' -f $newDbName
35
35
$createDatabaseScript = ' IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '' {0}'' ) BEGIN CREATE DATABASE [{0}]; END' -f $newDbName
36
36
37
- Describe " Invoke-DBODeployment integration tests" - Tag $commandName , IntegrationTests {
37
+ Describe " Invoke-Deployment integration tests" - Tag $commandName , IntegrationTests {
38
38
BeforeAll {
39
39
if ((Test-Path $workFolder ) -and $workFolder -like ' *.Tests.dbops' ) { Remove-Item $workFolder - Recurse }
40
40
$null = New-Item $workFolder - ItemType Directory - Force
@@ -66,7 +66,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
66
66
# Running package
67
67
$deploymentConfig.DeploymentMethod = ' SingleTransaction'
68
68
try {
69
- $null = Invoke-DBODeployment - PackageFile $packageFileName - Configuration $deploymentConfig
69
+ $null = Invoke-Deployment - PackageFile $packageFileName - Configuration $deploymentConfig
70
70
}
71
71
catch {
72
72
$testResults = $_
@@ -88,7 +88,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
88
88
It " Should throw an error and create one object" {
89
89
# Running package
90
90
try {
91
- $null = Invoke-DBODeployment - PackageFile $packageFileName - Configuration $deploymentConfig
91
+ $null = Invoke-Deployment - PackageFile $packageFileName - Configuration $deploymentConfig
92
92
}
93
93
catch {
94
94
$testResults = $_
@@ -108,7 +108,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
108
108
$null = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $cleanupScript
109
109
}
110
110
It " should deploy version 1.0" {
111
- $testResults = Invoke-DBODeployment - ScriptFile $v1files - Configuration $deploymentConfig
111
+ $testResults = Invoke-Deployment - ScriptFile $v1files - Configuration $deploymentConfig
112
112
$testResults.Successful | Should Be $true
113
113
$testResults.Scripts.Name | Should Be (Resolve-Path $v1scripts ).Path
114
114
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -132,7 +132,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
132
132
' d' | Should Not BeIn $testResults.name
133
133
}
134
134
It " should deploy version 2.0" {
135
- $testResults = Invoke-DBODeployment - ScriptFile $v2files - Configuration $deploymentConfig
135
+ $testResults = Invoke-Deployment - ScriptFile $v2files - Configuration $deploymentConfig
136
136
$testResults.Successful | Should Be $true
137
137
$testResults.Scripts.Name | Should Be (Resolve-Path $v2scripts ).Path
138
138
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -161,7 +161,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
161
161
$null = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $cleanupScript
162
162
}
163
163
It " should deploy 2.sql before 1.sql" {
164
- $testResults = Invoke-DBODeployment - ScriptFile $v2files , $v1files - Configuration $deploymentConfig
164
+ $testResults = Invoke-Deployment - ScriptFile $v2files , $v1files - Configuration $deploymentConfig
165
165
$testResults.Successful | Should Be $true
166
166
$testResults.Scripts.Name | Should Be (Resolve-Path $v2scripts , $v1scripts ).Path
167
167
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -200,7 +200,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
200
200
It " should throw timeout error" {
201
201
$deploymentConfig.ExecutionTimeout = 2
202
202
try {
203
- $null = Invoke-DBODeployment - ScriptFile $delayScripts - Configuration $deploymentConfig - OutputFile " $workFolder \log.txt"
203
+ $null = Invoke-Deployment - ScriptFile $delayScripts - Configuration $deploymentConfig - OutputFile " $workFolder \log.txt"
204
204
}
205
205
catch {
206
206
$testResults = $_
@@ -213,7 +213,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
213
213
}
214
214
It " should successfully run within specified timeout" {
215
215
$deploymentConfig.ExecutionTimeout = 6
216
- $testResults = Invoke-DBODeployment - ScriptFile $delayScripts - Configuration $deploymentConfig - OutputFile " $workFolder \log.txt"
216
+ $testResults = Invoke-Deployment - ScriptFile $delayScripts - Configuration $deploymentConfig - OutputFile " $workFolder \log.txt"
217
217
$testResults.Successful | Should Be $true
218
218
$testResults.Scripts.Name | Should Be (Join-PSFPath - Normalize " $workFolder \delay.sql" )
219
219
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -233,7 +233,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
233
233
}
234
234
It " should successfully run with infinite timeout" {
235
235
$deploymentConfig.ExecutionTimeout = 0
236
- $testResults = Invoke-DBODeployment - ScriptFile $delayScripts - Configuration $deploymentConfig - OutputFile " $workFolder \log.txt"
236
+ $testResults = Invoke-Deployment - ScriptFile $delayScripts - Configuration $deploymentConfig - OutputFile " $workFolder \log.txt"
237
237
$testResults.Successful | Should Be $true
238
238
$testResults.Scripts.Name | Should Be (Join-PSFPath - Normalize " $workFolder \delay.sql" )
239
239
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -260,7 +260,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
260
260
AfterAll {
261
261
}
262
262
It " should deploy nothing" {
263
- $testResults = Invoke-DBODeployment - ScriptFile $v1files - Configuration $deploymentConfig - WhatIf
263
+ $testResults = Invoke-Deployment - ScriptFile $v1files - Configuration $deploymentConfig - WhatIf
264
264
$testResults.Successful | Should Be $true
265
265
$testResults.Scripts.Name | Should Be $v1scripts
266
266
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -296,7 +296,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
296
296
$deploymentConfig.Remove (' SchemaVersionTable' )
297
297
$before = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $verificationScript
298
298
$rowsBefore = ($before | Measure-Object ).Count
299
- $testResults = Invoke-DBODeployment - ScriptFile $v1files - Configuration $deploymentConfig
299
+ $testResults = Invoke-Deployment - ScriptFile $v1files - Configuration $deploymentConfig
300
300
$testResults.Successful | Should Be $true
301
301
$testResults.Scripts.Name | Should Be (Resolve-Path $v1scripts ).Path
302
302
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -324,7 +324,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
324
324
$deploymentConfig.Remove (' SchemaVersionTable' )
325
325
$before = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $verificationScript
326
326
$rowsBefore = ($before | Measure-Object ).Count
327
- $testResults = Invoke-DBODeployment - ScriptFile $v2files - Configuration $deploymentConfig
327
+ $testResults = Invoke-Deployment - ScriptFile $v2files - Configuration $deploymentConfig
328
328
$testResults.Successful | Should Be $true
329
329
$testResults.Scripts.Name | Should Be (Resolve-Path $v2scripts ).Path
330
330
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -360,7 +360,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
360
360
$deploymentConfig.SchemaVersionTable = $null
361
361
$before = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $verificationScript
362
362
$rowsBefore = ($before | Measure-Object ).Count
363
- $testResults = Invoke-DBODeployment - ScriptFile $v1files - Configuration $deploymentConfig
363
+ $testResults = Invoke-Deployment - ScriptFile $v1files - Configuration $deploymentConfig
364
364
$testResults.Successful | Should Be $true
365
365
$testResults.Scripts.Name | Should Be (Resolve-Path $v1scripts ).Path
366
366
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -393,7 +393,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
393
393
It " should register version 1.0 without creating any objects" {
394
394
$before = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $verificationScript
395
395
$rowsBefore = ($before | Measure-Object ).Count
396
- $testResults = Invoke-DBODeployment - ScriptFile $v1files - Configuration $deploymentConfig - RegisterOnly
396
+ $testResults = Invoke-Deployment - ScriptFile $v1files - Configuration $deploymentConfig - RegisterOnly
397
397
$testResults.Successful | Should Be $true
398
398
$testResults.Scripts.Name | Should Be (Resolve-Path $v1scripts ).Path
399
399
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -424,7 +424,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
424
424
It " should register version 1.0 + 2.0 without creating any objects" {
425
425
$before = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $verificationScript
426
426
$rowsBefore = ($before | Measure-Object ).Count
427
- $testResults = Invoke-DBODeployment - ScriptFile $v1files , $v2files - Configuration $deploymentConfig - RegisterOnly
427
+ $testResults = Invoke-Deployment - ScriptFile $v1files , $v2files - Configuration $deploymentConfig - RegisterOnly
428
428
$testResults.Successful | Should Be $true
429
429
$testResults.Scripts.Name | Should Be (Resolve-Path $v2scripts ).Path
430
430
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -464,11 +464,11 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
464
464
# Deploy a non-logged script
465
465
$dc = $deploymentConfig.Clone ()
466
466
$dc.SchemaVersionTable = $null
467
- $null = Invoke-DBODeployment - ScriptFile $v1files - Configuration $dc
467
+ $null = Invoke-Deployment - ScriptFile $v1files - Configuration $dc
468
468
# Running package
469
469
try {
470
470
$testResults = $null
471
- $testResults = Invoke-DBODeployment - PackageFile $packageFileName - Configuration $deploymentConfig
471
+ $testResults = Invoke-Deployment - PackageFile $packageFileName - Configuration $deploymentConfig
472
472
}
473
473
catch {
474
474
$errorObject = $_
@@ -481,8 +481,8 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
481
481
# Running package
482
482
try {
483
483
$testResults = $null
484
- $null = Invoke-DBODeployment - PackageFile $packageFileName - Configuration $deploymentConfig
485
- $testResults = Invoke-DBODeployment - ScriptFile $v2files - Configuration $deploymentConfig
484
+ $null = Invoke-Deployment - PackageFile $packageFileName - Configuration $deploymentConfig
485
+ $testResults = Invoke-Deployment - ScriptFile $v2files - Configuration $deploymentConfig
486
486
}
487
487
catch {
488
488
$errorObject = $_
@@ -503,7 +503,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
503
503
$null = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $cleanupScript
504
504
}
505
505
It " should throw if ScriptFile is not DBOpsFile" {
506
- { Invoke-DBODeployment - ScriptFile $v1scripts - Configuration $deploymentConfig } | Should - Throw ' Expected DBOpsFile'
506
+ { Invoke-Deployment - ScriptFile $v1scripts - Configuration $deploymentConfig } | Should - Throw ' Expected DBOpsFile'
507
507
}
508
508
}
509
509
}
0 commit comments