Skip to content

Commit f49ac8e

Browse files
committed
proper state for silentlycontinue
1 parent e7af481 commit f49ac8e

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tests/functional/Install-DBOScript.Tests.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,8 @@ Describe "<type> Install-DBOScript functional tests" -Tag FunctionalTests -ForEa
234234
Context "deployments with errors should throw terminating errors" {
235235
BeforeEach {
236236
Reset-TestDatabase
237-
$null = Install-DBOScript -ScriptPath (Get-PackageScript -Version 1) @dbConnectionParams -SchemaVersionTable $null
238237
}
239238
It "Should return terminating error when object exists" {
240-
#Running package
241239
try {
242240
$testResults = $null
243241
$testResults = Install-DBOScript -Path $tranFailScripts -SchemaVersionTable $logTable -DeploymentMethod NoTransaction @dbConnectionParams
@@ -254,18 +252,19 @@ Describe "<type> Install-DBOScript functional tests" -Tag FunctionalTests -ForEa
254252
$testResults.Successful | Should -Be $false
255253
$testResults.SqlInstance | Should -Be $instance
256254
$testResults.Database | Should -Be $newDbName
257-
$testResults.SourcePath | Should -Be ($tranFailScripts | Split-Path -Leaf)
255+
$testResults.SourcePath | Should -Be (Get-ChildItem $tranFailScripts).FullName
258256
$testResults.ConnectionType | Should -Be $Type
259257
$testResults.Configuration.SchemaVersionTable | Should -Be $logTable
260258
$testResults.Error.Message | Should -BeLike (Get-TableExistsMessage "a")
261-
$testResults.ErrorScript | Should -Be ($tranFailScripts[1] | Split-Path -Leaf)
262-
$testResults.Scripts.Name | Should -Be ($tranFailScripts[0] | Split-Path -Leaf)
259+
$testResults.ErrorScript | Should -Be (Join-Path (Split-Path $tranFailScripts -Leaf) (Get-ChildItem $tranFailScripts)[1].Name)
260+
$testResults.Scripts.Name | Should -Be (Join-Path (Split-Path $tranFailScripts -Leaf) (Get-ChildItem $tranFailScripts)[0].Name)
263261
$testResults.Duration.TotalMilliseconds | Should -BeGreaterOrEqual 0
264262
$testResults.StartTime | Should -Not -BeNullOrEmpty
265263
$testResults.EndTime | Should -Not -BeNullOrEmpty
266264
$testResults.EndTime | Should -BeGreaterOrEqual $testResults.StartTime
267265
}
268266
It "should halt after throwing an error" {
267+
$null = Install-DBOScript -ScriptPath (Get-PackageScript -Version 1) @dbConnectionParams -SchemaVersionTable $null
269268
#Running package
270269
try {
271270
$testResults = $null

0 commit comments

Comments
 (0)