aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanleycheung@google.com>2016-02-13 00:03:02 -0800
committerGravatar Stanley Cheung <stanleycheung@google.com>2016-02-23 22:26:44 -0800
commit5adb71fb9add555ac161ebf745e5ac104fe3f847 (patch)
tree4c6748761c1fa6200756cca631d65bdfcb87fe7c /tools/run_tests
parentc95bfefa5ecd38fdbb8d3a14d425cf5cd7337fe6 (diff)
php: simplify installation
Diffstat (limited to 'tools/run_tests')
-rw-r--r--tools/run_tests/artifact_targets.py21
-rwxr-xr-xtools/run_tests/build_artifact_php.sh40
-rwxr-xr-xtools/run_tests/build_package_php.sh36
-rw-r--r--tools/run_tests/distribtest_targets.py31
-rw-r--r--tools/run_tests/package_targets.py20
5 files changed, 145 insertions, 3 deletions
diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py
index f84d35580b..15a1e2a681 100644
--- a/tools/run_tests/artifact_targets.py
+++ b/tools/run_tests/artifact_targets.py
@@ -241,6 +241,23 @@ class NodeExtArtifact:
['tools/run_tests/build_artifact_node.sh',
self.gyp_arch])
+class PHPExtArtifact:
+ """Builds PHP native extension"""
+
+ def __init__(self, platform, arch):
+ self.name = 'php_ext_{0}_{1}'.format(platform, arch)
+ self.platform = platform
+ self.arch = arch
+ self.labels = ['artifact', 'php', platform, arch]
+
+ def pre_build_jobspecs(self):
+ return []
+
+ def build_jobspec(self):
+ return create_docker_jobspec(
+ self.name,
+ 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch),
+ 'tools/run_tests/build_artifact_php.sh')
class ProtocArtifact:
"""Builds protoc and protoc-plugin artifacts"""
@@ -299,4 +316,6 @@ def targets():
PythonArtifact('windows', 'x64'),
RubyArtifact('linux', 'x86'),
RubyArtifact('linux', 'x64'),
- RubyArtifact('macos', 'x64')])
+ RubyArtifact('macos', 'x64'),
+ PHPExtArtifact('linux', 'x64'),
+ PHPExtArtifact('macos', 'x64')])
diff --git a/tools/run_tests/build_artifact_php.sh b/tools/run_tests/build_artifact_php.sh
new file mode 100755
index 0000000000..50bf0ea821
--- /dev/null
+++ b/tools/run_tests/build_artifact_php.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+# Copyright 2016, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PHP_TARGET_ARCH=$1
+set -ex
+
+cd $(dirname $0)/../..
+
+mkdir -p artifacts
+
+pear package
+
+cp -r grpc-*.tgz artifacts/grpc-php.tgz
diff --git a/tools/run_tests/build_package_php.sh b/tools/run_tests/build_package_php.sh
new file mode 100755
index 0000000000..56e3319ed9
--- /dev/null
+++ b/tools/run_tests/build_package_php.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+# Copyright 2016, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+set -ex
+
+cd $(dirname $0)/../..
+
+mkdir -p artifacts/
+cp -r $EXTERNAL_GIT_ROOT/architecture={x86,x64},language=php,platform={windows,linux,macos}/artifacts/* artifacts/ || true
diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py
index 261f44bc6d..0c02344d90 100644
--- a/tools/run_tests/distribtest_targets.py
+++ b/tools/run_tests/distribtest_targets.py
@@ -198,6 +198,33 @@ class RubyDistribTest(object):
return self.name
+class PHPDistribTest(object):
+ """Tests PHP package"""
+
+ def __init__(self, platform, arch, docker_suffix):
+ self.name = 'php_%s_%s_%s' % (platform, arch, docker_suffix)
+ self.platform = platform
+ self.arch = arch
+ self.docker_suffix = docker_suffix
+ self.labels = ['distribtest', 'php', platform, arch, docker_suffix]
+
+ def pre_build_jobspecs(self):
+ return []
+
+ def build_jobspec(self):
+ if not self.platform == 'linux':
+ raise Exception("Not supported yet.")
+
+ return create_docker_jobspec(self.name,
+ 'tools/dockerfile/distribtest/php_%s_%s' % (
+ self.docker_suffix,
+ self.arch),
+ 'test/distrib/php/run_distrib_test.sh')
+
+ def __str__(self):
+ return self.name
+
+
def targets():
"""Gets list of supported targets"""
return [CSharpDistribTest('linux', 'x64', 'wheezy'),
@@ -241,7 +268,9 @@ def targets():
RubyDistribTest('linux', 'x64', 'ubuntu1510'),
RubyDistribTest('linux', 'x64', 'ubuntu1604'),
NodeDistribTest('macos', 'x64', None, '4'),
- NodeDistribTest('linux', 'x86', 'jessie', '4')
+ NodeDistribTest('macos', 'x64', None, '5'),
+ NodeDistribTest('linux', 'x86', 'jessie', '4'),
+ PHPDistribTest('linux', 'x64', 'jessie'),
] + [
NodeDistribTest('linux', 'x64', os, version)
for os in ('wheezy', 'jessie', 'ubuntu1204', 'ubuntu1404',
diff --git a/tools/run_tests/package_targets.py b/tools/run_tests/package_targets.py
index 4ca8279f1b..8aee1f86de 100644
--- a/tools/run_tests/package_targets.py
+++ b/tools/run_tests/package_targets.py
@@ -139,9 +139,27 @@ class PythonPackage:
'tools/run_tests/build_package_python.sh')
+class PHPPackage:
+ """Builds PHP PECL package and collects precompiled package"""
+
+ def __init__(self):
+ self.name = 'php_package'
+ self.labels = ['package', 'php', 'linux']
+
+ def pre_build_jobspecs(self):
+ return []
+
+ def build_jobspec(self):
+ return create_docker_jobspec(
+ self.name,
+ 'tools/dockerfile/grpc_artifact_linux_x64',
+ 'tools/run_tests/build_package_php.sh')
+
+
def targets():
"""Gets list of supported targets"""
return [CSharpPackage(),
NodePackage(),
RubyPackage(),
- PythonPackage()]
+ PythonPackage(),
+ PHPPackage()]