@@ -39,51 +39,39 @@ Describe $CommandName -Tag UnitTests {
3939}
4040
4141Describe $CommandName - Tag IntegrationTests {
42- BeforeAll {
43- # We want to run all commands in the BeforeAll block with EnableException to ensure that the test fails if the setup fails.
44- $PSDefaultParameterValues [" *-Dba*:EnableException" ] = $true
45-
46- $defaultInstance = $TestConfig.instance1
47- $namedInstance = $TestConfig.instance2
48- $SkipLocalTest = $true # Change to $false to run the tests on a local instance.
49-
50- # We want to run all commands outside of the BeforeAll block without EnableException to be able to test for specific warnings.
51- $PSDefaultParameterValues.Remove (" *-Dba*:EnableException" )
52- }
53-
5442 Context " Validate command functionality" {
5543 # See https://github.com/dataplat/dbatools/issues/7035
56- It - Skip: $SkipLocalTest " Ensure the startup params are not duplicated when more than one server is modified in the same invocation" {
44+ It " Ensure the startup params are not duplicated when more than one server is modified in the same invocation" {
5745 $splatSetStartup = @ {
58- SqlInstance = $defaultInstance , $namedInstance
46+ SqlInstance = $TestConfig .instanceMulti1 , $TestConfig .instanceMulti2
5947 TraceFlag = 3226
6048 }
6149 $result = Set-DbaStartupParameter @splatSetStartup
6250
63- $resultDefaultInstance = Get-DbaStartupParameter - SqlInstance $defaultInstance
64- $resultDefaultInstance .TraceFlags.Count | Should - Be 1
65- $resultDefaultInstance .TraceFlags [0 ] | Should - Be 3226
51+ $result1 = Get-DbaStartupParameter - SqlInstance $TestConfig .instanceMulti1
52+ $result1 .TraceFlags.Count | Should - Be 1
53+ $result1 .TraceFlags [0 ] | Should - Be 3226
6654
6755 # The duplication occurs after the first server is processed.
68- $resultNamedInstance = Get-DbaStartupParameter - SqlInstance $namedInstance
56+ $result2 = Get-DbaStartupParameter - SqlInstance $TestConfig .instanceMulti2
6957 # Using the defaults to test locally
70- $resultNamedInstance .MasterData.Count | Should - Be 1
71- $resultNamedInstance .MasterLog.Count | Should - Be 1
72- $resultNamedInstance .ErrorLog.Count | Should - Be 1
58+ $result2 .MasterData.Count | Should - Be 1
59+ $result2 .MasterLog.Count | Should - Be 1
60+ $result2 .ErrorLog.Count | Should - Be 1
7361
74- $resultNamedInstance .TraceFlags.Count | Should - Be 1
75- $resultNamedInstance .TraceFlags [0 ] | Should - Be 3226
62+ $result2 .TraceFlags.Count | Should - Be 1
63+ $result2 .TraceFlags [0 ] | Should - Be 3226
7664 }
7765
7866 # See https://github.com/dataplat/dbatools/issues/7035
79- It - Skip: $SkipLocalTest " Ensure the correct instance name is returned" {
67+ It " Ensure the correct instance name is returned" {
8068 $splatSetInstance = @ {
81- SqlInstance = $namedInstance
69+ SqlInstance = $TestConfig .instanceMulti1
8270 TraceFlag = 3226
8371 }
8472 $result = Set-DbaStartupParameter @splatSetInstance
8573
86- $result.SqlInstance | Should - Be $namedInstance
74+ $result.SqlInstance | Should - Be $TestConfig .instanceMulti1
8775 $result.TraceFlags.Count | Should - Be 1
8876 $result.TraceFlags [0 ] | Should - Be 3226
8977 }
0 commit comments