mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
[MacOS] Pin PostgreSQL version installed in the toolset (#4504)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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*"
|
||||
}
|
||||
}
|
||||
@@ -343,5 +343,8 @@
|
||||
},
|
||||
"mongodb": {
|
||||
"version": "5.0"
|
||||
},
|
||||
"postgresql": {
|
||||
"version": "14"
|
||||
}
|
||||
}
|
||||
@@ -295,5 +295,8 @@
|
||||
},
|
||||
"mongodb": {
|
||||
"version": "5.0"
|
||||
},
|
||||
"postgresql": {
|
||||
"version": "14"
|
||||
}
|
||||
}
|
||||
@@ -193,5 +193,8 @@
|
||||
},
|
||||
"mongodb": {
|
||||
"version": "5.0"
|
||||
},
|
||||
"postgresql": {
|
||||
"version": "14"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user