[MacOS] Pin PostgreSQL version installed in the toolset (#4504)

This commit is contained in:
Maksim Shilov
2021-11-16 11:43:59 +03:00
committed by GitHub
parent ff41a760f0
commit 4bd3568585
5 changed files with 23 additions and 11 deletions

View File

@@ -1,13 +1,16 @@
#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
#Install latest version of postgresql
brew_smart_install "postgres"
# Fetch PostgreSQL version to install from the toolset
toolsetVersion=$(get_toolset_value '.postgresql.version')
#Service postgresql should be started before use.
# Install latest version of PostgreSQL
brew_smart_install postgresql@$toolsetVersion
# Service PostgreSQL should be started before use
brew services start postgresql
#Verify PostgreSQL is ready for accept incoming connections
# Verify PostgreSQL is ready for accept incoming connections
echo "Check PostgreSQL service is running"
i=10
COMMAND='pg_isready'
@@ -23,7 +26,7 @@ while [ $i -gt 0 ]; do
sleep 10
done
#Stop postgresql
# Stop PostgreSQL
brew services stop postgresql
invoke_tests "Databases" "PostgreSQL"

View File

@@ -9,11 +9,11 @@ Describe "MongoDB" {
}
Describe "PostgreSQL" {
It "PostgreSQL-Client" {
"psql --version" | Should -ReturnZeroExitCode
}
It "PostgreSQL-Server" {
"pg_config --version" | Should -ReturnZeroExitCode
It "PostgreSQL version should correspond to the version in the toolset" {
$toolsetVersion = Get-ToolsetValue 'postgresql.version'
# Client version
(psql --version).split()[-1] | Should -BeLike "$toolsetVersion*"
# Server version
(pg_config --version).split()[-1] | Should -BeLike "$toolsetVersion*"
}
}

View File

@@ -343,5 +343,8 @@
},
"mongodb": {
"version": "5.0"
},
"postgresql": {
"version": "14"
}
}

View File

@@ -295,5 +295,8 @@
},
"mongodb": {
"version": "5.0"
},
"postgresql": {
"version": "14"
}
}

View File

@@ -193,5 +193,8 @@
},
"mongodb": {
"version": "5.0"
},
"postgresql": {
"version": "14"
}
}