Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable test for Invoke-DbaDbMirroring #9503

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/Invoke-DbaDbMirroring.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@ Describe "$commandname Integration Tests" -Tag "IntegrationTests" {
Remove-DbaDatabase -SqlInstance $script:instance2 -Database $db1 -Confirm:$false
$null = Get-DbaDatabase -SqlInstance $script:instance2 -Database $db1 | Remove-DbaDatabase -Confirm:$false
$null = $server.Query("CREATE DATABASE $db1")

Get-DbaEndpoint -SqlInstance $script:instance2 -Type DatabaseMirroring | Remove-DbaEndpoint -Confirm:$false
New-DbaEndpoint -SqlInstance $script:instance2 -Name dbatoolsci_MirroringEndpoint -Type DatabaseMirroring -Port 5022 -Owner sa
Get-DbaEndpoint -SqlInstance $script:instance3 -Type DatabaseMirroring | Remove-DbaEndpoint -Confirm:$false
New-DbaEndpoint -SqlInstance $script:instance3 -Name dbatoolsci_MirroringEndpoint -Type DatabaseMirroring -Port 5023 -Owner sa
}
AfterAll {
$null = Remove-DbaDbMirror -SqlInstance $script:instance2, $script:instance3 -Database $db1 -Confirm:$false
$null = Remove-DbaDatabase -Confirm:$false -SqlInstance $script:instance2, $script:instance3 -Database $db1 -ErrorAction SilentlyContinue
}

It "returns success" {
$results = Invoke-DbaDbMirroring -Primary $script:instance2 -Mirror $script:instance3 -Database $db1 -Confirm:$false -Force -SharedPath C:\temp
$results = Invoke-DbaDbMirroring -Primary $script:instance2 -Mirror $script:instance3 -Database $db1 -Confirm:$false -Force -SharedPath C:\temp -WarningVariable warn
$warn | Should -BeNullOrEmpty
$results.Status | Should -Be 'Success'
}
}
3 changes: 0 additions & 3 deletions tests/pester.groups.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ $TestsRunGroups = @{
'Invoke-DbaBalanceDataFiles',
'Invoke-DbaWhoisActive', # Works locally aganint a SQL Server 2022 instance without problems.
'Install-DbaDarlingData',
# impossible to do within one server
# "the partner server name must be distinct"
'Invoke-DbaDbMirroring',
# previous tests that were failing on older versions too
'Remove-DbaAvailabilityGroup',
'Set-DbaAgReplica',
Expand Down
Loading