Skip to content

Commit

Permalink
try to fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 27, 2024
1 parent 793ddb9 commit f45a1c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
29 changes: 14 additions & 15 deletions tests/Copy-DbaLinkedServer.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,20 @@ Describe "Copy-DbaLinkedServer" -Tag "IntegrationTests" {
$results.Status | Should -BeExactly "Skipped"
}

# SQLNCLI10 and SQLNCLI11 are not used on newer versions, not sure which versions, but skipping if later than 2017
It "Upgrades SQLNCLI provider based on what is registered" -Skip:($server1.VersionMajor -gt 14 -or $server2.VersionMajor -gt 14) {
$upgradeSplat = @{
Source = $TestConfig.instance2
Destination = $TestConfig.instance3
LinkedServer = 'dbatoolsci_localhost2'
UpgradeSqlClient = $true
}
$result = Copy-DbaLinkedServer @upgradeSplat
# SQLNCLI10 and SQLNCLI11 are not used on newer versions, not sure which versions, but skipping if later than 2017
Context "When upgrading SQL Client provider" -Skip:($server1.VersionMajor -gt 14 -or $server2.VersionMajor -gt 14) {
BeforeAll {
$result = Copy-DbaLinkedServer -Source $TestConfig.instance2 -Destination $TestConfig.instance3 -LinkedServer dbatoolsci_localhost2 -UpgradeSqlClient
$sourceLinked = Get-DbaLinkedServer -SqlInstance $TestConfig.instance2
$destLinked = Get-DbaLinkedServer -SqlInstance $TestConfig.instance3
}

$server1 = Connect-DbaInstance -SqlInstance $TestConfig.instance2
$server2 = Connect-DbaInstance -SqlInstance $TestConfig.instance3
It "Should retain SQLNCLI10 on source" {
$sourceLinked.Script() | Should -Match 'SQLNCLI10'
}

$server1.LinkedServers.Script() | Should -Match 'SQLNCLI10'
$server2.LinkedServers.Script() | Should -Match 'SQLNCLI11'
}
}
It "Should upgrade to SQLNCLI11 on destination" {
$destLinked.Script() | Should -Match 'SQLNCLI11'
}
}
}
7 changes: 3 additions & 4 deletions tests/Dismount-DbaDatabase.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ Describe "Dismount-DbaDatabase" -Tag "IntegrationTests" {
It "Should detach database without snapshots" {
$null = Stop-DbaProcess -SqlInstance $TestConfig.instance3 -Database $dbDetached
$null = Dismount-DbaDatabase -SqlInstance $TestConfig.instance3 -Database $dbDetached

$database = Get-DbaDatabase -SqlInstance $TestConfig.instance3 -Database $dbDetached
$database | Should -BeNullOrEmpty
$result = Get-DbaDatabase -SqlInstance $TestConfig.instance3 -Database $dbDetached
$result | Should -BeNullOrEmpty
}
}
}
#$TestConfig.instance2 - to make it show up in appveyor, long story
#$TestConfig.instance2 - to make it show up in appveyor, long story

0 comments on commit f45a1c3

Please sign in to comment.