From a0841abff58faae708b3e175c0a571f2e7b65c60 Mon Sep 17 00:00:00 2001 From: andreasjordan Date: Sat, 12 Oct 2024 17:07:50 +0200 Subject: [PATCH 1/3] lets test (do Invoke-DbaDbMirroring) --- tests/Invoke-DbaDbMirroring.Tests.ps1 | 9 ++++++++- tests/pester.groups.ps1 | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/Invoke-DbaDbMirroring.Tests.ps1 b/tests/Invoke-DbaDbMirroring.Tests.ps1 index 23e5379c5b..3b15acac08 100644 --- a/tests/Invoke-DbaDbMirroring.Tests.ps1 +++ b/tests/Invoke-DbaDbMirroring.Tests.ps1 @@ -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' } } \ No newline at end of file diff --git a/tests/pester.groups.ps1 b/tests/pester.groups.ps1 index 8599d1f9f8..9723da3943 100644 --- a/tests/pester.groups.ps1 +++ b/tests/pester.groups.ps1 @@ -38,7 +38,7 @@ $TestsRunGroups = @{ 'Install-DbaDarlingData', # impossible to do within one server # "the partner server name must be distinct" - 'Invoke-DbaDbMirroring', + #'Invoke-DbaDbMirroring', # previous tests that were failing on older versions too 'Remove-DbaAvailabilityGroup', 'Set-DbaAgReplica', From c85e5320c5328bebf4434ed13abca316d2c4e854 Mon Sep 17 00:00:00 2001 From: andreasjordan Date: Sat, 12 Oct 2024 17:29:42 +0200 Subject: [PATCH 2/3] lets run all tests From 3253f26162d3eb43fb5e93b2be528782f2bb6703 Mon Sep 17 00:00:00 2001 From: andreasjordan Date: Sat, 12 Oct 2024 18:04:28 +0200 Subject: [PATCH 3/3] update pester.groups --- tests/pester.groups.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/pester.groups.ps1 b/tests/pester.groups.ps1 index 9723da3943..d8e7be4e08 100644 --- a/tests/pester.groups.ps1 +++ b/tests/pester.groups.ps1 @@ -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',