From a8b82b7234352ee522808802ee3370e0dcb62fed Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 Nov 2020 06:58:41 +0000 Subject: [PATCH 1/8] add a test dockerfile for php8 --- src/php/bin/build_all_docker_images.sh | 2 +- src/php/bin/run_all_docker_images.sh | 2 +- src/php/docker/php8/Dockerfile | 45 +++++++++++++++++++ .../src/php/docker/php8/Dockerfile.template | 38 ++++++++++++++++ 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 src/php/docker/php8/Dockerfile create mode 100644 templates/src/php/docker/php8/Dockerfile.template diff --git a/src/php/bin/build_all_docker_images.sh b/src/php/bin/build_all_docker_images.sh index defc5551f00..77e2df7a024 100755 --- a/src/php/bin/build_all_docker_images.sh +++ b/src/php/bin/build_all_docker_images.sh @@ -17,7 +17,7 @@ set -e cd $(dirname $0)/../../.. ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-future php-zts - fork-support i386 ) + fork-support i386 php8 ) if [[ "$1" == "--cmds" ]]; then for arg in "${ALL_IMAGES[@]}" diff --git a/src/php/bin/run_all_docker_images.sh b/src/php/bin/run_all_docker_images.sh index 7969c281dd0..a10345816d2 100755 --- a/src/php/bin/run_all_docker_images.sh +++ b/src/php/bin/run_all_docker_images.sh @@ -17,7 +17,7 @@ set -e cd $(dirname $0)/../../.. ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-future php-zts - fork-support i386 ) + fork-support i386 php8 ) if [[ "$1" == "--cmds" ]]; then for arg in "${ALL_IMAGES[@]}" diff --git a/src/php/docker/php8/Dockerfile b/src/php/docker/php8/Dockerfile new file mode 100644 index 00000000000..397bbcd98d0 --- /dev/null +++ b/src/php/docker/php8/Dockerfile @@ -0,0 +1,45 @@ +# Copyright 2020 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM php:8.0.0RC3-cli-buster + +RUN apt-get -qq update && apt-get -qq install -y \ + autoconf automake git libtool pkg-config \ + valgrind wget zlib1g-dev + +ARG MAKEFLAGS=-j8 + + +WORKDIR /tmp + +# install pear +RUN apt-get install expect -y && \ + curl -LO http://pear.php.net/go-pear.phar && \ + expect -c 'spawn php ./go-pear.phar; expect "or Enter to continue:"; send "\n"; expect "Currently used php.ini"; send "\n"; expect eof' && \ + rm go-pear.phar + +RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ + mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ + chmod +x /usr/local/bin/phpunit + + +WORKDIR /github/grpc + +COPY . . + +RUN pear package && \ + find . -name grpc-*.tgz | xargs -I{} pecl install {} + + +CMD ["/github/grpc/src/php/bin/run_tests.sh", "--skip-persistent-channel-tests", "--ignore-valgrind-undef-errors"] diff --git a/templates/src/php/docker/php8/Dockerfile.template b/templates/src/php/docker/php8/Dockerfile.template new file mode 100644 index 00000000000..4838c91dc08 --- /dev/null +++ b/templates/src/php/docker/php8/Dockerfile.template @@ -0,0 +1,38 @@ +%YAML 1.2 +--- | + # Copyright 2020 gRPC authors. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + + FROM php:8.0.0RC3-cli-buster + + RUN apt-get -qq update && apt-get -qq install -y ${'\\'} + autoconf automake git libtool pkg-config ${'\\'} + valgrind wget zlib1g-dev + + ARG MAKEFLAGS=-j8 + + + WORKDIR /tmp + + # install pear + RUN apt-get install expect -y && ${'\\'} + curl -LO http://pear.php.net/go-pear.phar && ${'\\'} + expect -c 'spawn php ./go-pear.phar; expect "or Enter to continue:"; send "\n"; expect "Currently used php.ini"; send "\n"; expect eof' && ${'\\'} + rm go-pear.phar + + <%include file="../download_phpunit.include" /> + + <%include file="../pecl_ext_build_src.include" /> + + CMD ["/github/grpc/src/php/bin/run_tests.sh", "--skip-persistent-channel-tests", "--ignore-valgrind-undef-errors"] From d00e92040ec5c3d7190950a268c791717b3df320 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 Nov 2020 08:46:23 +0000 Subject: [PATCH 2/8] upgrade to phpunit8 --- src/php/docker/alpine/Dockerfile | 4 ++-- src/php/docker/centos7/Dockerfile | 4 ++-- src/php/docker/grpc-ext/Dockerfile | 4 ++-- src/php/docker/grpc-src/Dockerfile | 4 ++-- src/php/docker/i386/Dockerfile | 4 ++-- src/php/docker/php-future/Dockerfile | 4 ++-- src/php/docker/php-src/Dockerfile | 4 ++-- src/php/docker/php-zts/Dockerfile | 4 ++-- src/php/docker/php8/Dockerfile | 4 ++-- src/php/tests/generated_code/AbstractGeneratedCodeTest.php | 2 +- src/php/tests/unit_tests/CallCredentials2Test.php | 2 +- src/php/tests/unit_tests/CallCredentialsTest.php | 2 +- src/php/tests/unit_tests/CallInvokerTest.php | 2 +- src/php/tests/unit_tests/CallTest.php | 2 +- src/php/tests/unit_tests/ChannelCredentialsTest.php | 2 +- src/php/tests/unit_tests/ChannelTest.php | 2 +- src/php/tests/unit_tests/EndToEndTest.php | 2 +- src/php/tests/unit_tests/InterceptorTest.php | 2 +- .../PersistentChannelTests/PersistentChannelTest.php | 2 +- src/php/tests/unit_tests/SecureEndToEndTest.php | 2 +- src/php/tests/unit_tests/ServerTest.php | 2 +- src/php/tests/unit_tests/TimevalTest.php | 2 +- templates/src/php/docker/download_phpunit.include | 4 ++-- 23 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/php/docker/alpine/Dockerfile b/src/php/docker/alpine/Dockerfile index a71c2afeccf..fa827ab513f 100644 --- a/src/php/docker/alpine/Dockerfile +++ b/src/php/docker/alpine/Dockerfile @@ -21,8 +21,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.phar && \ + mv phpunit-8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/centos7/Dockerfile b/src/php/docker/centos7/Dockerfile index e6df3ef819e..b02412b8d0f 100644 --- a/src/php/docker/centos7/Dockerfile +++ b/src/php/docker/centos7/Dockerfile @@ -35,8 +35,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.phar && \ + mv phpunit-8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/grpc-ext/Dockerfile b/src/php/docker/grpc-ext/Dockerfile index 93d0307c4a0..4421861be87 100644 --- a/src/php/docker/grpc-ext/Dockerfile +++ b/src/php/docker/grpc-ext/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.phar && \ + mv phpunit-8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/grpc-src/Dockerfile b/src/php/docker/grpc-src/Dockerfile index 936ddc0da23..13955245b0c 100644 --- a/src/php/docker/grpc-src/Dockerfile +++ b/src/php/docker/grpc-src/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.phar && \ + mv phpunit-8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/i386/Dockerfile b/src/php/docker/i386/Dockerfile index dff43552558..c53e921b6c1 100644 --- a/src/php/docker/i386/Dockerfile +++ b/src/php/docker/i386/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.phar && \ + mv phpunit-8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php-future/Dockerfile b/src/php/docker/php-future/Dockerfile index 95c0ac47a07..52f726232ba 100644 --- a/src/php/docker/php-future/Dockerfile +++ b/src/php/docker/php-future/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.phar && \ + mv phpunit-8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php-src/Dockerfile b/src/php/docker/php-src/Dockerfile index 972a297aafe..1f0fe61e29c 100644 --- a/src/php/docker/php-src/Dockerfile +++ b/src/php/docker/php-src/Dockerfile @@ -23,8 +23,8 @@ RUN apt-get -qq update && apt-get -qq install -y \ WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.phar && \ + mv phpunit-8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php-zts/Dockerfile b/src/php/docker/php-zts/Dockerfile index 9bc9d37152d..f3b39e90eeb 100644 --- a/src/php/docker/php-zts/Dockerfile +++ b/src/php/docker/php-zts/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.phar && \ + mv phpunit-8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php8/Dockerfile b/src/php/docker/php8/Dockerfile index 397bbcd98d0..25a9c62054a 100644 --- a/src/php/docker/php8/Dockerfile +++ b/src/php/docker/php8/Dockerfile @@ -29,8 +29,8 @@ RUN apt-get install expect -y && \ expect -c 'spawn php ./go-pear.phar; expect "or Enter to continue:"; send "\n"; expect "Currently used php.ini"; send "\n"; expect eof' && \ rm go-pear.phar -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.phar && \ + mv phpunit-8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/tests/generated_code/AbstractGeneratedCodeTest.php b/src/php/tests/generated_code/AbstractGeneratedCodeTest.php index f7b47359992..a68954606f7 100644 --- a/src/php/tests/generated_code/AbstractGeneratedCodeTest.php +++ b/src/php/tests/generated_code/AbstractGeneratedCodeTest.php @@ -23,7 +23,7 @@ require_once realpath(dirname(__FILE__).'/../../vendor/autoload.php'); @include_once dirname(__FILE__).'/math.pb.php'; @include_once dirname(__FILE__).'/math_grpc_pb.php'; -abstract class AbstractGeneratedCodeTest extends PHPUnit_Framework_TestCase +abstract class AbstractGeneratedCodeTest extends \PHPUnit\Framework\TestCase { /** * These tests require that a server exporting the math service must be diff --git a/src/php/tests/unit_tests/CallCredentials2Test.php b/src/php/tests/unit_tests/CallCredentials2Test.php index c63029f121b..e293fe266fc 100644 --- a/src/php/tests/unit_tests/CallCredentials2Test.php +++ b/src/php/tests/unit_tests/CallCredentials2Test.php @@ -17,7 +17,7 @@ * */ -class CallCredentials2Test extends PHPUnit_Framework_TestCase +class CallCredentials2Test extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/CallCredentialsTest.php b/src/php/tests/unit_tests/CallCredentialsTest.php index 818b823da71..e3f3966268a 100644 --- a/src/php/tests/unit_tests/CallCredentialsTest.php +++ b/src/php/tests/unit_tests/CallCredentialsTest.php @@ -17,7 +17,7 @@ * */ -class CallCredentialsTest extends PHPUnit_Framework_TestCase +class CallCredentialsTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/CallInvokerTest.php b/src/php/tests/unit_tests/CallInvokerTest.php index 00b5b998652..d38feb9d975 100644 --- a/src/php/tests/unit_tests/CallInvokerTest.php +++ b/src/php/tests/unit_tests/CallInvokerTest.php @@ -159,7 +159,7 @@ class CallInvokerChangeRequestCall } } -class CallInvokerTest extends PHPUnit_Framework_TestCase +class CallInvokerTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/CallTest.php b/src/php/tests/unit_tests/CallTest.php index 23d8e772d0e..602369512ae 100644 --- a/src/php/tests/unit_tests/CallTest.php +++ b/src/php/tests/unit_tests/CallTest.php @@ -16,7 +16,7 @@ * limitations under the License. * */ -class CallTest extends PHPUnit_Framework_TestCase +class CallTest extends \PHPUnit\Framework\TestCase { public static $server; public static $port; diff --git a/src/php/tests/unit_tests/ChannelCredentialsTest.php b/src/php/tests/unit_tests/ChannelCredentialsTest.php index e7e695c9c76..932fb1d0813 100644 --- a/src/php/tests/unit_tests/ChannelCredentialsTest.php +++ b/src/php/tests/unit_tests/ChannelCredentialsTest.php @@ -17,7 +17,7 @@ * */ -class ChanellCredentialsTest extends PHPUnit_Framework_TestCase +class ChanellCredentialsTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/ChannelTest.php b/src/php/tests/unit_tests/ChannelTest.php index 58f96a740b6..714b693d890 100644 --- a/src/php/tests/unit_tests/ChannelTest.php +++ b/src/php/tests/unit_tests/ChannelTest.php @@ -17,7 +17,7 @@ * */ -class ChannelTest extends PHPUnit_Framework_TestCase +class ChannelTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/EndToEndTest.php b/src/php/tests/unit_tests/EndToEndTest.php index d0965655e0a..701f92321bc 100644 --- a/src/php/tests/unit_tests/EndToEndTest.php +++ b/src/php/tests/unit_tests/EndToEndTest.php @@ -16,7 +16,7 @@ * limitations under the License. * */ -class EndToEndTest extends PHPUnit_Framework_TestCase +class EndToEndTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/InterceptorTest.php b/src/php/tests/unit_tests/InterceptorTest.php index acd68fc45a2..1ab4e2c8146 100644 --- a/src/php/tests/unit_tests/InterceptorTest.php +++ b/src/php/tests/unit_tests/InterceptorTest.php @@ -215,7 +215,7 @@ class StopCallInterceptor extends Grpc\Interceptor } } -class InterceptorTest extends PHPUnit_Framework_TestCase +class InterceptorTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php b/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php index 7b44221f89b..860fc865261 100644 --- a/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php +++ b/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php @@ -20,7 +20,7 @@ /** * @group persistent_list_bound_tests */ -class PersistentListTest extends PHPUnit_Framework_TestCase +class PersistentListTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/SecureEndToEndTest.php b/src/php/tests/unit_tests/SecureEndToEndTest.php index 071598c4c19..23ab04c62c4 100644 --- a/src/php/tests/unit_tests/SecureEndToEndTest.php +++ b/src/php/tests/unit_tests/SecureEndToEndTest.php @@ -16,7 +16,7 @@ * limitations under the License. * */ -class SecureEndToEndTest extends PHPUnit_Framework_TestCase +class SecureEndToEndTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/ServerTest.php b/src/php/tests/unit_tests/ServerTest.php index cab92e59419..6597853184a 100644 --- a/src/php/tests/unit_tests/ServerTest.php +++ b/src/php/tests/unit_tests/ServerTest.php @@ -17,7 +17,7 @@ * */ -class ServerTest extends PHPUnit_Framework_TestCase +class ServerTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/src/php/tests/unit_tests/TimevalTest.php b/src/php/tests/unit_tests/TimevalTest.php index 000b2db32d5..b5f372d6933 100644 --- a/src/php/tests/unit_tests/TimevalTest.php +++ b/src/php/tests/unit_tests/TimevalTest.php @@ -16,7 +16,7 @@ * limitations under the License. * */ -class TimevalTest extends PHPUnit_Framework_TestCase +class TimevalTest extends \PHPUnit\Framework\TestCase { public function setUp() { diff --git a/templates/src/php/docker/download_phpunit.include b/templates/src/php/docker/download_phpunit.include index 5387119bf55..17a4439fb59 100644 --- a/templates/src/php/docker/download_phpunit.include +++ b/templates/src/php/docker/download_phpunit.include @@ -1,3 +1,3 @@ -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && ${'\\'} - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && ${'\\'} +RUN wget https://phar.phpunit.de/phpunit-8.phar && ${'\\'} + mv phpunit-8.phar /usr/local/bin/phpunit && ${'\\'} chmod +x /usr/local/bin/phpunit From ad2909b489e628cc240976782a079fa6bb594eea Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 Nov 2020 19:41:17 +0000 Subject: [PATCH 3/8] upgrade to phpunit8.5.8 --- src/php/docker/alpine/Dockerfile | 4 ++-- src/php/docker/centos7/Dockerfile | 4 ++-- src/php/docker/grpc-ext/Dockerfile | 4 ++-- src/php/docker/grpc-src/Dockerfile | 4 ++-- src/php/docker/i386/Dockerfile | 4 ++-- src/php/docker/php-future/Dockerfile | 4 ++-- src/php/docker/php-src/Dockerfile | 4 ++-- src/php/docker/php-zts/Dockerfile | 4 ++-- src/php/docker/php8/Dockerfile | 4 ++-- templates/src/php/docker/download_phpunit.include | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/php/docker/alpine/Dockerfile b/src/php/docker/alpine/Dockerfile index fa827ab513f..67ede050773 100644 --- a/src/php/docker/alpine/Dockerfile +++ b/src/php/docker/alpine/Dockerfile @@ -21,8 +21,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.phar && \ - mv phpunit-8.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/centos7/Dockerfile b/src/php/docker/centos7/Dockerfile index b02412b8d0f..9c5278e982e 100644 --- a/src/php/docker/centos7/Dockerfile +++ b/src/php/docker/centos7/Dockerfile @@ -35,8 +35,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.phar && \ - mv phpunit-8.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/grpc-ext/Dockerfile b/src/php/docker/grpc-ext/Dockerfile index 4421861be87..137724bd3ad 100644 --- a/src/php/docker/grpc-ext/Dockerfile +++ b/src/php/docker/grpc-ext/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.phar && \ - mv phpunit-8.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/grpc-src/Dockerfile b/src/php/docker/grpc-src/Dockerfile index 13955245b0c..bd3acc1caf5 100644 --- a/src/php/docker/grpc-src/Dockerfile +++ b/src/php/docker/grpc-src/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.phar && \ - mv phpunit-8.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/i386/Dockerfile b/src/php/docker/i386/Dockerfile index c53e921b6c1..58556032f91 100644 --- a/src/php/docker/i386/Dockerfile +++ b/src/php/docker/i386/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.phar && \ - mv phpunit-8.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php-future/Dockerfile b/src/php/docker/php-future/Dockerfile index 52f726232ba..1817da14d3f 100644 --- a/src/php/docker/php-future/Dockerfile +++ b/src/php/docker/php-future/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.phar && \ - mv phpunit-8.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php-src/Dockerfile b/src/php/docker/php-src/Dockerfile index 1f0fe61e29c..f77e3dc2f7c 100644 --- a/src/php/docker/php-src/Dockerfile +++ b/src/php/docker/php-src/Dockerfile @@ -23,8 +23,8 @@ RUN apt-get -qq update && apt-get -qq install -y \ WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.phar && \ - mv phpunit-8.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php-zts/Dockerfile b/src/php/docker/php-zts/Dockerfile index f3b39e90eeb..9889645f994 100644 --- a/src/php/docker/php-zts/Dockerfile +++ b/src/php/docker/php-zts/Dockerfile @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.phar && \ - mv phpunit-8.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php8/Dockerfile b/src/php/docker/php8/Dockerfile index 25a9c62054a..fbb85796fb9 100644 --- a/src/php/docker/php8/Dockerfile +++ b/src/php/docker/php8/Dockerfile @@ -29,8 +29,8 @@ RUN apt-get install expect -y && \ expect -c 'spawn php ./go-pear.phar; expect "or Enter to continue:"; send "\n"; expect "Currently used php.ini"; send "\n"; expect eof' && \ rm go-pear.phar -RUN wget https://phar.phpunit.de/phpunit-8.phar && \ - mv phpunit-8.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/templates/src/php/docker/download_phpunit.include b/templates/src/php/docker/download_phpunit.include index 17a4439fb59..8d5e17f0ab4 100644 --- a/templates/src/php/docker/download_phpunit.include +++ b/templates/src/php/docker/download_phpunit.include @@ -1,3 +1,3 @@ -RUN wget https://phar.phpunit.de/phpunit-8.phar && ${'\\'} - mv phpunit-8.phar /usr/local/bin/phpunit && ${'\\'} +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && ${'\\'} + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && ${'\\'} chmod +x /usr/local/bin/phpunit From bf58994ce593e7b2018de7c730e5dc76411bb0b7 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 Nov 2020 19:43:15 +0000 Subject: [PATCH 4/8] to fit phpunit8 grammar, add void to setUpBeforeClass(), setUp() and tearDown() --- src/php/tests/generated_code/GeneratedCodeTest.php | 4 ++-- .../tests/generated_code/GeneratedCodeWithCallbackTest.php | 4 ++-- src/php/tests/unit_tests/CallCredentials2Test.php | 4 ++-- src/php/tests/unit_tests/CallCredentialsTest.php | 4 ++-- src/php/tests/unit_tests/CallInvokerTest.php | 4 ++-- src/php/tests/unit_tests/CallTest.php | 6 +++--- src/php/tests/unit_tests/ChannelCredentialsTest.php | 4 ++-- src/php/tests/unit_tests/ChannelTest.php | 4 ++-- src/php/tests/unit_tests/EndToEndTest.php | 4 ++-- src/php/tests/unit_tests/InterceptorTest.php | 4 ++-- .../PersistentChannelTests/PersistentChannelTest.php | 4 ++-- src/php/tests/unit_tests/SecureEndToEndTest.php | 4 ++-- src/php/tests/unit_tests/ServerTest.php | 4 ++-- src/php/tests/unit_tests/TimevalTest.php | 4 ++-- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/php/tests/generated_code/GeneratedCodeTest.php b/src/php/tests/generated_code/GeneratedCodeTest.php index 91339d390ed..f9fa573bf3e 100755 --- a/src/php/tests/generated_code/GeneratedCodeTest.php +++ b/src/php/tests/generated_code/GeneratedCodeTest.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__).'/AbstractGeneratedCodeTest.php'; class GeneratedCodeTest extends AbstractGeneratedCodeTest { - public function setUp() + public function setUp(): void { self::$client = new Math\MathClient( getenv('GRPC_TEST_HOST'), [ @@ -28,7 +28,7 @@ class GeneratedCodeTest extends AbstractGeneratedCodeTest ]); } - public function tearDown() + public function tearDown(): void { self::$client->close(); } diff --git a/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php b/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php index 60a90fa025e..fb55d1659cd 100644 --- a/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php +++ b/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__).'/AbstractGeneratedCodeTest.php'; class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest { - public function setUp() + public function setUp(): void { self::$client = new Math\MathClient( getenv('GRPC_TEST_HOST'), @@ -35,7 +35,7 @@ class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest ]); } - public function tearDown() + public function tearDown(): void { self::$client->close(); } diff --git a/src/php/tests/unit_tests/CallCredentials2Test.php b/src/php/tests/unit_tests/CallCredentials2Test.php index e293fe266fc..35cf821645c 100644 --- a/src/php/tests/unit_tests/CallCredentials2Test.php +++ b/src/php/tests/unit_tests/CallCredentials2Test.php @@ -19,7 +19,7 @@ class CallCredentials2Test extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $credentials = Grpc\ChannelCredentials::createSsl( file_get_contents(dirname(__FILE__).'/../data/ca.pem')); @@ -43,7 +43,7 @@ class CallCredentials2Test extends \PHPUnit\Framework\TestCase ); } - public function tearDown() + public function tearDown(): void { unset($this->channel); unset($this->server); diff --git a/src/php/tests/unit_tests/CallCredentialsTest.php b/src/php/tests/unit_tests/CallCredentialsTest.php index e3f3966268a..a88a2680dbb 100644 --- a/src/php/tests/unit_tests/CallCredentialsTest.php +++ b/src/php/tests/unit_tests/CallCredentialsTest.php @@ -19,7 +19,7 @@ class CallCredentialsTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->credentials = Grpc\ChannelCredentials::createSsl( file_get_contents(dirname(__FILE__).'/../data/ca.pem')); @@ -49,7 +49,7 @@ class CallCredentialsTest extends \PHPUnit\Framework\TestCase ); } - public function tearDown() + public function tearDown(): void { unset($this->channel); unset($this->server); diff --git a/src/php/tests/unit_tests/CallInvokerTest.php b/src/php/tests/unit_tests/CallInvokerTest.php index d38feb9d975..300d805cb04 100644 --- a/src/php/tests/unit_tests/CallInvokerTest.php +++ b/src/php/tests/unit_tests/CallInvokerTest.php @@ -161,14 +161,14 @@ class CallInvokerChangeRequestCall class CallInvokerTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->server = new Grpc\Server([]); $this->port = $this->server->addHttp2Port('0.0.0.0:0'); $this->server->start(); } - public function tearDown() + public function tearDown(): void { unset($this->server); } diff --git a/src/php/tests/unit_tests/CallTest.php b/src/php/tests/unit_tests/CallTest.php index 602369512ae..4d1be1b1e24 100644 --- a/src/php/tests/unit_tests/CallTest.php +++ b/src/php/tests/unit_tests/CallTest.php @@ -21,14 +21,14 @@ class CallTest extends \PHPUnit\Framework\TestCase public static $server; public static $port; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$server = new Grpc\Server([]); self::$port = self::$server->addHttp2Port('0.0.0.0:53000'); self::$server->start(); } - public function setUp() + public function setUp(): void { $this->channel = new Grpc\Channel('localhost:'.self::$port, [ 'force_new' => true, @@ -38,7 +38,7 @@ class CallTest extends \PHPUnit\Framework\TestCase Grpc\Timeval::infFuture()); } - public function tearDown() + public function tearDown(): void { $this->channel->close(); } diff --git a/src/php/tests/unit_tests/ChannelCredentialsTest.php b/src/php/tests/unit_tests/ChannelCredentialsTest.php index 932fb1d0813..73963cee155 100644 --- a/src/php/tests/unit_tests/ChannelCredentialsTest.php +++ b/src/php/tests/unit_tests/ChannelCredentialsTest.php @@ -19,11 +19,11 @@ class ChanellCredentialsTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { } - public function tearDown() + public function tearDown(): void { } diff --git a/src/php/tests/unit_tests/ChannelTest.php b/src/php/tests/unit_tests/ChannelTest.php index 714b693d890..8ae394511e8 100644 --- a/src/php/tests/unit_tests/ChannelTest.php +++ b/src/php/tests/unit_tests/ChannelTest.php @@ -19,11 +19,11 @@ class ChannelTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { } - public function tearDown() + public function tearDown(): void { if (!empty($this->channel)) { $this->channel->close(); diff --git a/src/php/tests/unit_tests/EndToEndTest.php b/src/php/tests/unit_tests/EndToEndTest.php index 701f92321bc..08b28e02b81 100644 --- a/src/php/tests/unit_tests/EndToEndTest.php +++ b/src/php/tests/unit_tests/EndToEndTest.php @@ -18,7 +18,7 @@ */ class EndToEndTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->server = new Grpc\Server([]); $this->port = $this->server->addHttp2Port('0.0.0.0:0'); @@ -28,7 +28,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase $this->server->start(); } - public function tearDown() + public function tearDown(): void { $this->channel->close(); unset($this->server); diff --git a/src/php/tests/unit_tests/InterceptorTest.php b/src/php/tests/unit_tests/InterceptorTest.php index 1ab4e2c8146..5e87679a3a2 100644 --- a/src/php/tests/unit_tests/InterceptorTest.php +++ b/src/php/tests/unit_tests/InterceptorTest.php @@ -217,7 +217,7 @@ class StopCallInterceptor extends Grpc\Interceptor class InterceptorTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->server = new Grpc\Server([]); $this->port = $this->server->addHttp2Port('0.0.0.0:0'); @@ -227,7 +227,7 @@ class InterceptorTest extends \PHPUnit\Framework\TestCase $this->server->start(); } - public function tearDown() + public function tearDown(): void { $this->channel->close(); unset($this->server); diff --git a/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php b/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php index 860fc865261..f10daeb93fb 100644 --- a/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php +++ b/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php @@ -22,11 +22,11 @@ */ class PersistentListTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { } - public function tearDown() + public function tearDown(): void { $channel_clean_persistent = new Grpc\Channel('localhost:50010', []); diff --git a/src/php/tests/unit_tests/SecureEndToEndTest.php b/src/php/tests/unit_tests/SecureEndToEndTest.php index 23ab04c62c4..da9d9d07fac 100644 --- a/src/php/tests/unit_tests/SecureEndToEndTest.php +++ b/src/php/tests/unit_tests/SecureEndToEndTest.php @@ -18,7 +18,7 @@ */ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $credentials = Grpc\ChannelCredentials::createSsl( file_get_contents(dirname(__FILE__).'/../data/ca.pem')); @@ -42,7 +42,7 @@ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase ); } - public function tearDown() + public function tearDown(): void { $this->channel->close(); unset($this->server); diff --git a/src/php/tests/unit_tests/ServerTest.php b/src/php/tests/unit_tests/ServerTest.php index 6597853184a..b29a6b0eac3 100644 --- a/src/php/tests/unit_tests/ServerTest.php +++ b/src/php/tests/unit_tests/ServerTest.php @@ -19,12 +19,12 @@ class ServerTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->server = null; } - public function tearDown() + public function tearDown(): void { unset($this->server); } diff --git a/src/php/tests/unit_tests/TimevalTest.php b/src/php/tests/unit_tests/TimevalTest.php index b5f372d6933..1a525088b2d 100644 --- a/src/php/tests/unit_tests/TimevalTest.php +++ b/src/php/tests/unit_tests/TimevalTest.php @@ -18,11 +18,11 @@ */ class TimevalTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { } - public function tearDown() + public function tearDown(): void { unset($this->time); } From faba9e93d6b6b6e64b7efa74e8d2e008bf036bfc Mon Sep 17 00:00:00 2001 From: root Date: Fri, 13 Nov 2020 21:35:03 +0000 Subject: [PATCH 5/8] del test dockerfile for php 8 for now --- src/php/bin/build_all_docker_images.sh | 2 +- src/php/bin/run_all_docker_images.sh | 2 +- src/php/docker/php8/Dockerfile | 45 ------------------- .../src/php/docker/php8/Dockerfile.template | 38 ---------------- 4 files changed, 2 insertions(+), 85 deletions(-) delete mode 100644 src/php/docker/php8/Dockerfile delete mode 100644 templates/src/php/docker/php8/Dockerfile.template diff --git a/src/php/bin/build_all_docker_images.sh b/src/php/bin/build_all_docker_images.sh index 77e2df7a024..defc5551f00 100755 --- a/src/php/bin/build_all_docker_images.sh +++ b/src/php/bin/build_all_docker_images.sh @@ -17,7 +17,7 @@ set -e cd $(dirname $0)/../../.. ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-future php-zts - fork-support i386 php8 ) + fork-support i386 ) if [[ "$1" == "--cmds" ]]; then for arg in "${ALL_IMAGES[@]}" diff --git a/src/php/bin/run_all_docker_images.sh b/src/php/bin/run_all_docker_images.sh index a10345816d2..7969c281dd0 100755 --- a/src/php/bin/run_all_docker_images.sh +++ b/src/php/bin/run_all_docker_images.sh @@ -17,7 +17,7 @@ set -e cd $(dirname $0)/../../.. ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-future php-zts - fork-support i386 php8 ) + fork-support i386 ) if [[ "$1" == "--cmds" ]]; then for arg in "${ALL_IMAGES[@]}" diff --git a/src/php/docker/php8/Dockerfile b/src/php/docker/php8/Dockerfile deleted file mode 100644 index fbb85796fb9..00000000000 --- a/src/php/docker/php8/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2020 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM php:8.0.0RC3-cli-buster - -RUN apt-get -qq update && apt-get -qq install -y \ - autoconf automake git libtool pkg-config \ - valgrind wget zlib1g-dev - -ARG MAKEFLAGS=-j8 - - -WORKDIR /tmp - -# install pear -RUN apt-get install expect -y && \ - curl -LO http://pear.php.net/go-pear.phar && \ - expect -c 'spawn php ./go-pear.phar; expect "or Enter to continue:"; send "\n"; expect "Currently used php.ini"; send "\n"; expect eof' && \ - rm go-pear.phar - -RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ - mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ - chmod +x /usr/local/bin/phpunit - - -WORKDIR /github/grpc - -COPY . . - -RUN pear package && \ - find . -name grpc-*.tgz | xargs -I{} pecl install {} - - -CMD ["/github/grpc/src/php/bin/run_tests.sh", "--skip-persistent-channel-tests", "--ignore-valgrind-undef-errors"] diff --git a/templates/src/php/docker/php8/Dockerfile.template b/templates/src/php/docker/php8/Dockerfile.template deleted file mode 100644 index 4838c91dc08..00000000000 --- a/templates/src/php/docker/php8/Dockerfile.template +++ /dev/null @@ -1,38 +0,0 @@ -%YAML 1.2 ---- | - # Copyright 2020 gRPC authors. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - - FROM php:8.0.0RC3-cli-buster - - RUN apt-get -qq update && apt-get -qq install -y ${'\\'} - autoconf automake git libtool pkg-config ${'\\'} - valgrind wget zlib1g-dev - - ARG MAKEFLAGS=-j8 - - - WORKDIR /tmp - - # install pear - RUN apt-get install expect -y && ${'\\'} - curl -LO http://pear.php.net/go-pear.phar && ${'\\'} - expect -c 'spawn php ./go-pear.phar; expect "or Enter to continue:"; send "\n"; expect "Currently used php.ini"; send "\n"; expect eof' && ${'\\'} - rm go-pear.phar - - <%include file="../download_phpunit.include" /> - - <%include file="../pecl_ext_build_src.include" /> - - CMD ["/github/grpc/src/php/bin/run_tests.sh", "--skip-persistent-channel-tests", "--ignore-valgrind-undef-errors"] From bb01f8320df14797c09fbe95d72a57cd2501d791 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 19 Nov 2020 06:35:18 +0000 Subject: [PATCH 6/8] add php8 test docker --- src/php/bin/build_all_docker_images.sh | 2 +- src/php/bin/run_all_docker_images.sh | 2 +- src/php/docker/php8/Dockerfile | 40 +++++++++++++++++++ .../src/php/docker/php8/Dockerfile.template | 36 +++++++++++++++++ 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 src/php/docker/php8/Dockerfile create mode 100644 templates/src/php/docker/php8/Dockerfile.template diff --git a/src/php/bin/build_all_docker_images.sh b/src/php/bin/build_all_docker_images.sh index defc5551f00..77e2df7a024 100755 --- a/src/php/bin/build_all_docker_images.sh +++ b/src/php/bin/build_all_docker_images.sh @@ -17,7 +17,7 @@ set -e cd $(dirname $0)/../../.. ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-future php-zts - fork-support i386 ) + fork-support i386 php8 ) if [[ "$1" == "--cmds" ]]; then for arg in "${ALL_IMAGES[@]}" diff --git a/src/php/bin/run_all_docker_images.sh b/src/php/bin/run_all_docker_images.sh index 7969c281dd0..a10345816d2 100755 --- a/src/php/bin/run_all_docker_images.sh +++ b/src/php/bin/run_all_docker_images.sh @@ -17,7 +17,7 @@ set -e cd $(dirname $0)/../../.. ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-future php-zts - fork-support i386 ) + fork-support i386 php8 ) if [[ "$1" == "--cmds" ]]; then for arg in "${ALL_IMAGES[@]}" diff --git a/src/php/docker/php8/Dockerfile b/src/php/docker/php8/Dockerfile new file mode 100644 index 00000000000..47ab8f61474 --- /dev/null +++ b/src/php/docker/php8/Dockerfile @@ -0,0 +1,40 @@ +# Copyright 2020 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM php:8.0.0RC3-cli-buster + +RUN apt-get -qq update && apt-get -qq install -y \ + autoconf automake git libtool pkg-config \ + valgrind wget zlib1g-dev + +ARG MAKEFLAGS=-j8 + + +WORKDIR /tmp + +# install pear +RUN apt-get install expect -y && \ + curl -LO http://pear.php.net/go-pear.phar && \ + expect -c 'spawn php ./go-pear.phar; expect "or Enter to continue:"; send "\n"; expect "Currently used php.ini"; send "\n"; expect eof' && \ + rm go-pear.phar + +WORKDIR /github/grpc + +COPY . . + +RUN pear package && \ + find . -name grpc-*.tgz | xargs -I{} pecl install {} + + +CMD php -d extension=grpc.so -r '$a = new \Grpc\Channel("dummy", []); echo get_class($a)."\n";' diff --git a/templates/src/php/docker/php8/Dockerfile.template b/templates/src/php/docker/php8/Dockerfile.template new file mode 100644 index 00000000000..eb00edb073e --- /dev/null +++ b/templates/src/php/docker/php8/Dockerfile.template @@ -0,0 +1,36 @@ +%YAML 1.2 +--- | + # Copyright 2020 gRPC authors. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + + FROM php:8.0.0RC3-cli-buster + + RUN apt-get -qq update && apt-get -qq install -y ${'\\'} + autoconf automake git libtool pkg-config ${'\\'} + valgrind wget zlib1g-dev + + ARG MAKEFLAGS=-j8 + + + WORKDIR /tmp + + # install pear + RUN apt-get install expect -y && ${'\\'} + curl -LO http://pear.php.net/go-pear.phar && ${'\\'} + expect -c 'spawn php ./go-pear.phar; expect "or Enter to continue:"; send "\n"; expect "Currently used php.ini"; send "\n"; expect eof' && ${'\\'} + rm go-pear.phar + + <%include file="../pecl_ext_build_src.include" /> + + CMD php -d extension=grpc.so -r '$a = new \Grpc\Channel("dummy", []); echo get_class($a)."\n";' From b6979f247ae466d47a3efc72f4d5477f5cac3ced Mon Sep 17 00:00:00 2001 From: root Date: Thu, 19 Nov 2020 06:49:23 +0000 Subject: [PATCH 7/8] upgrade phpunit to 8.5.8 --- tools/dockerfile/distribtest/php7_stretch_x64/Dockerfile | 4 ++-- tools/gce/linux_kokoro_performance_worker_init.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/dockerfile/distribtest/php7_stretch_x64/Dockerfile b/tools/dockerfile/distribtest/php7_stretch_x64/Dockerfile index ec74b00a75e..7f013b7386e 100644 --- a/tools/dockerfile/distribtest/php7_stretch_x64/Dockerfile +++ b/tools/dockerfile/distribtest/php7_stretch_x64/Dockerfile @@ -16,6 +16,6 @@ FROM debian:stretch RUN apt-get update && apt-get install -y php php-dev php-pear wget zlib1g-dev -RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/tools/gce/linux_kokoro_performance_worker_init.sh b/tools/gce/linux_kokoro_performance_worker_init.sh index a325611ceae..e81ba212342 100755 --- a/tools/gce/linux_kokoro_performance_worker_init.sh +++ b/tools/gce/linux_kokoro_performance_worker_init.sh @@ -162,8 +162,8 @@ gem install bundler # PHP dependencies sudo apt-get install -y php7.2 php7.2-dev php-pear unzip zlib1g-dev -sudo wget https://phar.phpunit.de/phpunit-5.7.27.phar && \ - sudo mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \ +sudo wget https://phar.phpunit.de/phpunit-8.5.8.phar && \ + sudo mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \ sudo chmod +x /usr/local/bin/phpunit curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer From dbb0d444427ede1f6d98e7d4877550ee8009d0dc Mon Sep 17 00:00:00 2001 From: Aleksandr Dankovtsev Date: Thu, 19 Nov 2020 23:09:52 +0300 Subject: [PATCH 8/8] update required minimal php version to 7.0 --- composer.json | 2 +- package.xml | 2 +- src/php/composer.json | 2 +- templates/composer.json.template | 2 +- templates/package.xml.template | 2 +- templates/src/php/composer.json.template | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index b8f4346444f..4ad328dbc07 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "homepage": "https://grpc.io", "license": "Apache-2.0", "require": { - "php": ">=5.5.0" + "php": ">=7.0.0" }, "require-dev": { "google/auth": "^v1.3.0" diff --git a/package.xml b/package.xml index 84dacfad93e..fd7b4debc0d 100644 --- a/package.xml +++ b/package.xml @@ -1996,7 +1996,7 @@ - 5.5.0 + 7.0.0 1.4.0 diff --git a/src/php/composer.json b/src/php/composer.json index 0ba0313eade..cf9ffad83c7 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "version": "1.34.0", "require": { - "php": ">=5.5.0", + "php": ">=7.0.0", "google/protobuf": "^v3.3.0" }, "require-dev": { diff --git a/templates/composer.json.template b/templates/composer.json.template index a9cc6cca865..e778ab08d76 100644 --- a/templates/composer.json.template +++ b/templates/composer.json.template @@ -8,7 +8,7 @@ "homepage": "https://grpc.io", "license": "Apache-2.0", "require": { - "php": ">=5.5.0" + "php": ">=7.0.0" }, "require-dev": { "google/auth": "^v1.3.0" diff --git a/templates/package.xml.template b/templates/package.xml.template index 3273c7987ef..de65792d4ef 100644 --- a/templates/package.xml.template +++ b/templates/package.xml.template @@ -52,7 +52,7 @@ - 5.5.0 + 7.0.0 1.4.0 diff --git a/templates/src/php/composer.json.template b/templates/src/php/composer.json.template index 9a1c5789040..e1c36461a88 100644 --- a/templates/src/php/composer.json.template +++ b/templates/src/php/composer.json.template @@ -6,7 +6,7 @@ "license": "Apache-2.0", "version": "${settings.php_version.php_composer()}", "require": { - "php": ">=5.5.0", + "php": ">=7.0.0", "google/protobuf": "^v3.3.0" }, "require-dev": {