Some more updates to PHP testing infrastructure (#8576)
* WIP.
* Added build config for all of the tests.
* Use ../src/protoc if it is available, for cases where Bazel isn't available.
* Added test_php.sh.
* Fix for the broken macOS tests.
* Move all jobs to use php80 instead of lots of separate jobs.
* Only pass -t flag if we are running in a terminal.
* Updated php_all job to use new Docker stuff.
diff --git a/php/generate_test_protos.sh b/php/generate_test_protos.sh
index 0aa4bdb..e86ca07 100755
--- a/php/generate_test_protos.sh
+++ b/php/generate_test_protos.sh
@@ -4,7 +4,17 @@
cd `dirname $0`
-if [[ -d tmp && -z $(find tests/proto ../src/protoc -newer tmp) ]]; then
+./prepare_c_extension.sh
+
+if ../src/protoc --help > /dev/null; then
+ PROTOC=src/protoc
+else
+ (cd .. && bazel build -c opt :protoc)
+ PROTOC=bazel-bin/protoc
+fi
+
+
+if [[ -d tmp && -z $(find tests/proto ../$PROTOC -newer tmp) ]]; then
# Generated protos are already present and up to date, so we can skip protoc.
#
# Protoc is very fast, but sometimes it is not available (like if we haven't
@@ -16,12 +26,13 @@
rm -rf tmp
mkdir -p tmp
-find tests/proto -type f -name "*.proto"| xargs ../src/protoc --php_out=tmp -I../src -Itests
+cd ..
+find php/tests/proto -type f -name "*.proto"| xargs $PROTOC --php_out=php/tmp -Isrc -Iphp/tests
if [ "$1" = "--aggregate_metadata" ]; then
# Overwrite some of the files to use aggregation.
AGGREGATED_FILES="tests/proto/test.proto tests/proto/test_include.proto tests/proto/test_import_descriptor_proto.proto"
- ../src/protoc --php_out=aggregate_metadata=foo#bar:tmp -I../src -Itests $AGGREGATED_FILES
+ $PROTOC --php_out=aggregate_metadata=foo#bar:php/tmp -Isrc -Iphp/tests $AGGREGATED_FILES
fi
echo "Generated test protos from tests/proto -> tmp"