[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
$mongodbService | Set-Service -StartupType Disabled
# Install mongodb shell for mongodb > 5 version
if (Test-IsWin25) {
$mongoshVersion = (Get-GithubReleasesByVersion -Repo "mongodb-js/mongosh" -Version "latest").version
# Install mongodb shell for mongodb
$mongoshVersion = (Get-GithubReleasesByVersion -Repo "mongodb-js/mongosh" -Version "latest").version
$mongoshDownloadUrl = Resolve-GithubReleaseAssetUrl `
-Repo "mongodb-js/mongosh" `
-Version $mongoshVersion `
-UrlMatchPattern "mongosh-*-x64.msi"
$mongoshDownloadUrl = Resolve-GithubReleaseAssetUrl `
-Repo "mongodb-js/mongosh" `
-Version $mongoshVersion `
-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"

View File

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

View File

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

View File

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

View File

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