Skip to content

Commit 9ae2ca3

Browse files
committed
Refactor integration tests to remove service start/stop commands for SQL Server instance
1 parent 2a5d1ce commit 9ae2ca3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

tests/Integration/Commands/Invoke-SqlDscQuery.Integration.Tests.ps1

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ BeforeAll {
3131

3232
Describe 'Invoke-SqlDscQuery' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
3333
BeforeAll {
34-
# Starting the named instance SQL Server service prior to running tests.
35-
Start-Service -Name 'MSSQL$DSCSQLTEST' -Verbose -ErrorAction 'Stop'
36-
3734
$script:mockInstanceName = 'DSCSQLTEST'
3835
$script:mockComputerName = Get-ComputerName
3936

@@ -58,7 +55,7 @@ CREATE TABLE TestTable (
5855
5956
INSERT INTO TestTable (Name, Value) VALUES ('Test1', 100), ('Test2', 200), ('Test3', 300)
6057
"@
61-
58+
6259
Invoke-SqlDscQuery -ServerObject $script:serverObject -DatabaseName $script:testDatabaseName -Query $createTableQuery -Force -ErrorAction 'Stop'
6360
}
6461

@@ -77,9 +74,6 @@ INSERT INTO TestTable (Name, Value) VALUES ('Test1', 100), ('Test2', 200), ('Tes
7774
}
7875

7976
Disconnect-SqlDscDatabaseEngine -ServerObject $script:serverObject
80-
81-
# Stop the named instance SQL Server service to save memory on the build worker.
82-
Stop-Service -Name 'MSSQL$DSCSQLTEST' -Verbose -ErrorAction 'Stop'
8377
}
8478

8579
Context 'When executing a query using ServerObject parameter set' {

0 commit comments

Comments
 (0)