[Windows] Update MongoDB to 7.0 on windows-2022 (#13125)

This commit is contained in:
Alexey-Ayupov
2025-10-02 12:35:19 +02:00
committed by GitHub
parent 4fb55a7372
commit 8b17fc0f05
5 changed files with 17 additions and 27 deletions

View File

@@ -39,19 +39,18 @@ $mongodbService.WaitForStatus('Running', '00:01:00')
Stop-Service $mongodbService Stop-Service $mongodbService
$mongodbService | Set-Service -StartupType Disabled $mongodbService | Set-Service -StartupType Disabled
# Install mongodb shell for mongodb > 5 version # Install mongodb shell for mongodb
if (Test-IsWin25) { $mongoshVersion = (Get-GithubReleasesByVersion -Repo "mongodb-js/mongosh" -Version "latest").version
$mongoshVersion = (Get-GithubReleasesByVersion -Repo "mongodb-js/mongosh" -Version "latest").version
$mongoshDownloadUrl = Resolve-GithubReleaseAssetUrl ` $mongoshDownloadUrl = Resolve-GithubReleaseAssetUrl `
-Repo "mongodb-js/mongosh" ` -Repo "mongodb-js/mongosh" `
-Version $mongoshVersion ` -Version $mongoshVersion `
-UrlMatchPattern "mongosh-*-x64.msi" -UrlMatchPattern "mongosh-*-x64.msi"
Install-Binary -Type MSI `
-Url $mongoshDownloadUrl `
-ExtraInstallArgs @('ALLUSERS=1') `
-ExpectedSubject 'CN="MongoDB, Inc.", O="MongoDB, Inc.", L=New York, S=New York, C=US'
Install-Binary -Type MSI `
-Url $mongoshDownloadUrl `
-ExtraInstallArgs @('ALLUSERS=1') `
-ExpectedSubject 'CN="MongoDB, Inc.", O="MongoDB, Inc.", L=New York, S=New York, C=US'
}
Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB" Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB"

View File

@@ -193,9 +193,8 @@ $databaseTools.AddToolVersion("DacFx", $(Get-DacFxVersion))
$databaseTools.AddToolVersion("MySQL", $(Get-MySQLVersion)) $databaseTools.AddToolVersion("MySQL", $(Get-MySQLVersion))
$databaseTools.AddToolVersion("SQL OLEDB Driver", $(Get-SQLOLEDBDriverVersion)) $databaseTools.AddToolVersion("SQL OLEDB Driver", $(Get-SQLOLEDBDriverVersion))
$databaseTools.AddToolVersion("SQLPS", $(Get-SQLPSVersion)) $databaseTools.AddToolVersion("SQLPS", $(Get-SQLPSVersion))
if (Test-IsWin25) { $databaseTools.AddToolVersion("MongoDB Shell (mongosh)", $(Get-MongoshVersion))
$databaseTools.AddToolVersion("MongoDB Shell (mongosh)", $(Get-MongoshVersion))
}
# Web Servers # Web Servers
$installedSoftware.AddHeader("Web Servers").AddTable($(Build-WebServersSection)) $installedSoftware.AddHeader("Web Servers").AddTable($(Build-WebServersSection))

View File

@@ -21,11 +21,7 @@ function Get-PostgreSQLTable
function Get-MongoDBTable function Get-MongoDBTable
{ {
$name = "MongoDB" $name = "MongoDB"
if (Test-IsWin25) { $command = "mongod"
$command = "mongod"
} else {
$command = "mongo"
}
$mongoService = Get-Service -Name $name $mongoService = Get-Service -Name $name
$mongoVersion = (Get-Command -Name $command).Version.ToString() $mongoVersion = (Get-Command -Name $command).Version.ToString()
return [PSCustomObject]@{ return [PSCustomObject]@{

View File

@@ -1,11 +1,7 @@
Describe "MongoDB" { Describe "MongoDB" {
Context "Version" { Context "Version" {
It "<ToolName>" -TestCases @( It "<ToolName>" -TestCases @(
if (Test-IsWin25) { @{ ToolName = "mongos" }
@{ ToolName = "mongos" }
} else {
@{ ToolName = "mongo" }
}
@{ ToolName = "mongod" } @{ ToolName = "mongod" }
) { ) {
$toolsetVersion = (Get-ToolsetContent).mongodb.version $toolsetVersion = (Get-ToolsetContent).mongodb.version
@@ -30,7 +26,7 @@ Describe "MongoDB" {
} }
} }
Context "Shell" -Skip:(-not (Test-IsWin25)) { Context "Shell" {
It "mongosh" { It "mongosh" {
"mongosh --version" | Should -ReturnZeroExitCode "mongosh --version" | Should -ReturnZeroExitCode
} }

View File

@@ -345,7 +345,7 @@
"version": "8.0" "version": "8.0"
}, },
"mongodb": { "mongodb": {
"version": "5.0" "version": "7.0"
}, },
"nsis": { "nsis": {
"version": "3.10" "version": "3.10"