From 687fbffd9bcbc6e59c86ba0f5d319b10d68a93c4 Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Fri, 9 Sep 2022 08:16:46 -0700 Subject: [PATCH] Fixing mac php tests (#10523) * Manually run brew cleanup and initialize php * Add debug loggin for visibility * Allow underscores in php folder name * Add logging to php tests * Add tracing * Only use the latest installation of php --- kokoro/macos/php74/build.sh | 3 ++- kokoro/macos/php80/build.sh | 3 ++- php/tests/compile_extension.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kokoro/macos/php74/build.sh b/kokoro/macos/php74/build.sh index 2b50a0a6eeebd..2ad4eab5984a7 100755 --- a/kokoro/macos/php74/build.sh +++ b/kokoro/macos/php74/build.sh @@ -9,10 +9,11 @@ cd $(dirname $0)/../../.. source kokoro/macos/prepare_build_macos_rc # Install Dependencies +brew cleanup brew install coreutils php@7.4 # Configure path -PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/7.4.[0-9]*") +PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/7.4.[0-9_.]*" | sort -n | tail -n 1) test ! -z "$PHP_FOLDER" export PATH="$PHP_FOLDER/bin:$PATH" diff --git a/kokoro/macos/php80/build.sh b/kokoro/macos/php80/build.sh index 4051822e974e1..e703ffc18f178 100755 --- a/kokoro/macos/php80/build.sh +++ b/kokoro/macos/php80/build.sh @@ -9,10 +9,11 @@ cd $(dirname $0)/../../.. source kokoro/macos/prepare_build_macos_rc # Install Dependencies +brew cleanup brew install coreutils php@8.0 # Configure path -PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/8.0.[0-9]*") +PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/8.0.[0-9_.]*" | sort -n | tail -n 1) test ! -z "$PHP_FOLDER" export PATH="$PHP_FOLDER/bin:$PATH" diff --git a/php/tests/compile_extension.sh b/php/tests/compile_extension.sh index 326191738f459..dc42aa32eeb90 100755 --- a/php/tests/compile_extension.sh +++ b/php/tests/compile_extension.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -ex cd $(dirname $0)/..