mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[Windows] Disable mongodb service by default (#6023)
* Disable mongodb service by default * Add ErrorAction Ignore
This commit is contained in:
committed by
GitHub
parent
58ba4559eb
commit
f1bb031e43
@@ -1,10 +1,29 @@
|
||||
Describe "MongoDB" {
|
||||
It "<ToolName>" -TestCases @(
|
||||
@{ ToolName = "mongo" }
|
||||
@{ ToolName = "mongod" }
|
||||
) {
|
||||
$toolsetVersion = (Get-ToolsetContent).mongodb.version
|
||||
(&$ToolName --version)[2].Split('"')[-2] | Should -BeLike "$toolsetVersion*"
|
||||
Context "Version" {
|
||||
It "<ToolName>" -TestCases @(
|
||||
@{ ToolName = "mongo" }
|
||||
@{ ToolName = "mongod" }
|
||||
) {
|
||||
$toolsetVersion = (Get-ToolsetContent).mongodb.version
|
||||
(&$ToolName --version)[2].Split('"')[-2] | Should -BeLike "$toolsetVersion*"
|
||||
}
|
||||
}
|
||||
|
||||
Context "Service" {
|
||||
$mongoService = Get-Service -Name mongodb -ErrorAction Ignore
|
||||
$mongoServiceTests = @{
|
||||
Name = $mongoService.Name
|
||||
Status = $mongoService.Status
|
||||
StartType = $mongoService.StartType
|
||||
}
|
||||
|
||||
It "<Name> service is stopped" -TestCases $mongoServiceTests {
|
||||
$Status | Should -Be "Stopped"
|
||||
}
|
||||
|
||||
It "<Name> service is disabled" -TestCases $mongoServiceTests {
|
||||
$StartType | Should -Be "Disabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user