@@ -592,7 +592,7 @@ Describe "Install-DBOPackage integration tests" -Tag $commandName, IntegrationTe
592
592
}
593
593
Context " testing deployment using variables in config" {
594
594
BeforeAll {
595
- $p1 = New-DBOPackage - ScriptPath $v1scripts - Name " $workFolder \pv1" - Build 1.0 - Force - Configuration @ {SqlInstance = ' #{srv}' ; Database = ' #{db}' }
595
+ $p1 = New-DBOPackage - ScriptPath $v1scripts - Name " $workFolder \pv1" - Build 1.0 - Force - Configuration @ {SqlInstance = ' #{srv}' ; Database = ' #{db}' }
596
596
$outputFile = " $workFolder \log.txt"
597
597
$null = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $cleanupScript
598
598
}
@@ -602,7 +602,7 @@ Describe "Install-DBOPackage integration tests" -Tag $commandName, IntegrationTe
602
602
It " should deploy version 1.0" {
603
603
$before = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $verificationScript
604
604
$rowsBefore = ($before | Measure-Object ).Count
605
- $testResults = Install-DBOPackage " $workFolder \pv1.zip" - Credential $script :mssqlCredential - Variables @ {srv = $script :mssqlInstance ; db = $newDbName } - SchemaVersionTable $logTable - OutputFile " $workFolder \log.txt" - Silent
605
+ $testResults = Install-DBOPackage " $workFolder \pv1.zip" - Credential $script :mssqlCredential - Variables @ {srv = $script :mssqlInstance ; db = $newDbName } - SchemaVersionTable $logTable - OutputFile " $workFolder \log.txt" - Silent
606
606
$testResults.Successful | Should Be $true
607
607
$testResults.Scripts.Name | Should Be $v1Journal
608
608
$testResults.SqlInstance | Should Be $script :mssqlInstance
@@ -666,4 +666,42 @@ Describe "Install-DBOPackage integration tests" -Tag $commandName, IntegrationTe
666
666
' d' | Should Not BeIn $testResults.name
667
667
}
668
668
}
669
+ Context " testing deployment from a package with an absolute path" {
670
+ BeforeAll {
671
+ $p1 = New-DBOPackage - ScriptPath $v1scripts - Name " $workFolder \pv1" - Build 1.0 - Force - Absolute
672
+ $outputFile = " $workFolder \log.txt"
673
+ $null = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $cleanupScript
674
+ }
675
+ AfterAll {
676
+ $null = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - Query " IF OBJECT_ID('SchemaVersions') IS NOT NULL DROP TABLE SchemaVersions"
677
+ }
678
+ It " should deploy version 1.0" {
679
+ $before = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $verificationScript
680
+ $rowsBefore = ($before | Measure-Object ).Count
681
+ $testResults = Install-DBOPackage " $workFolder \pv1.zip" - SqlInstance $script :mssqlInstance - Credential $script :mssqlCredential - Database $newDbName - Silent
682
+ $testResults.Successful | Should Be $true
683
+ $absolutePath = Get-Item $v1scripts | ForEach-Object { Join-PSFPath 1.0 ($_.FullName -replace ' ^/|^\\|^\\\\|\.\\|\./|:' , " " ) }
684
+ $testResults.Scripts.Name | Should BeIn $absolutePath
685
+ $testResults.SqlInstance | Should Be $script :mssqlInstance
686
+ $testResults.Database | Should Be $newDbName
687
+ $testResults.SourcePath | Should Be (Join-PSFPath - Normalize " $workFolder \pv1.zip" )
688
+ $testResults.ConnectionType | Should Be ' SQLServer'
689
+ $testResults.Configuration.SchemaVersionTable | Should Be ' SchemaVersions'
690
+ $testResults.Error | Should BeNullOrEmpty
691
+ $testResults.Duration.TotalMilliseconds | Should - BeGreaterOrEqual 0
692
+ $testResults.StartTime | Should Not BeNullOrEmpty
693
+ $testResults.EndTime | Should Not BeNullOrEmpty
694
+ $testResults.EndTime | Should - BeGreaterOrEqual $testResults.StartTime
695
+ ' Upgrade successful' | Should BeIn $testResults.DeploymentLog
696
+
697
+ # Verifying objects
698
+ $testResults = Invoke-DBOQuery - SqlInstance $script :mssqlInstance - Silent - Credential $script :mssqlCredential - Database $newDbName - InputFile $verificationScript
699
+ ' SchemaVersions' | Should BeIn $testResults.name
700
+ ' a' | Should BeIn $testResults.name
701
+ ' b' | Should BeIn $testResults.name
702
+ ' c' | Should Not BeIn $testResults.name
703
+ ' d' | Should Not BeIn $testResults.name
704
+ ($testResults | Measure-Object ).Count | Should Be ($rowsBefore + 3 )
705
+ }
706
+ }
669
707
}
0 commit comments