diff --git a/scripts/tests/requirements.sh b/scripts/tests/requirements.sh index 7917ce2..56ff7ba 100755 --- a/scripts/tests/requirements.sh +++ b/scripts/tests/requirements.sh @@ -9,29 +9,45 @@ OS_TYPE="$(uname -s)" if [[ "$OS_TYPE" == "Linux" ]]; then if command -v apt >/dev/null 2>&1; then echo "Linux detected with apt. Installing tools..." + + echo "Adding PostgreSQL APT repository..." sudo apt update - echo "Installing redis-tools" + sudo apt install -y wget gnupg lsb-release + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - + echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list + + sudo apt update + + echo "Installing redis-tools..." sudo apt install -y redis-tools - echo "Installing postgresql-client" - sudo apt install postgresql-client + + echo "Installing PostgreSQL client v18..." + sudo apt install -y postgresql-client-18 + else echo "Unsupported Linux distribution. Only apt-based distros are supported." exit 1 fi + elif [[ "$OS_TYPE" == "Darwin" ]]; then if command -v brew >/dev/null 2>&1; then - echo "macOS detected. Installing redis via Homebrew..." - echo "Installing redis-tools" + echo "macOS detected. Installing tools via Homebrew..." + + echo "Installing redis..." brew install redis - echo "Installing postgresql-client" - brew install postgresql + + echo "Installing PostgreSQL client..." + brew install postgresql@18 + brew link --force postgresql@18 + else echo "Homebrew not found. Please install Homebrew first: https://brew.sh/" exit 1 fi + else echo "Unsupported OS: $OS_TYPE" exit 1 fi -echo "test tools installation completed." \ No newline at end of file +echo "Tools installation completed successfully." \ No newline at end of file