aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/run_tests/run_interops.py18
-rwxr-xr-xtools/run_tests/run_interops_build.sh36
-rwxr-xr-xtools/run_tests/run_interops_test.sh11
3 files changed, 50 insertions, 15 deletions
diff --git a/tools/run_tests/run_interops.py b/tools/run_tests/run_interops.py
index 1cf268526d..4e6b5ce2f6 100755
--- a/tools/run_tests/run_interops.py
+++ b/tools/run_tests/run_interops.py
@@ -4,24 +4,20 @@ import jobset
argp = argparse.ArgumentParser(description='Run interop tests.')
argp.add_argument('-l', '--language',
- choices=['build_only', 'c++'],
- nargs='+',
- default=['build_only'])
+ default='c++')
args = argp.parse_args()
# build job
-build_steps = 'tools/run_tests/run_interops_build.sh'
-build_job = jobset.JobSpec(cmdline=build_steps, shortname='build')
+build_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_build.sh', '%s' % args.language], shortname='build')
-# test jobs
+# test jobs, each test is a separate job to run in parallel
_TESTS = ['large_unary', 'empty_unary', 'ping_pong', 'client_streaming', 'server_streaming']
jobs = []
jobNumber = 0
-for lang in args.language:
- for test in _TESTS:
- test_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_test.sh', '%s' % lang, '%s' % test], shortname=test)
- jobs.append(test_job)
- jobNumber+=1
+for test in _TESTS:
+ test_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_test.sh', '%s' % args.language, '%s' % test], shortname=test)
+ jobs.append(test_job)
+ jobNumber+=1
root = ET.Element('testsuites')
testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests')
diff --git a/tools/run_tests/run_interops_build.sh b/tools/run_tests/run_interops_build.sh
index 23441a5300..ff1a26cf89 100755
--- a/tools/run_tests/run_interops_build.sh
+++ b/tools/run_tests/run_interops_build.sh
@@ -29,6 +29,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+language=$1
+
set -e
#clean up any old docker files and start mirroring repository if not started already
@@ -40,8 +42,34 @@ sudo docker run -d -e GCS_BUCKET=docker-interop-images -e STORAGE_PATH=/admin/d
#prepare building by pulling down base images and necessary files
sudo docker pull 0.0.0.0:5000/grpc/base
sudo docker tag -f 0.0.0.0:5000/grpc/base grpc/base
-gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_cxx
-gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_cxx
-#build docker file, add more languages later
-sudo docker build --no-cache -t grpc/cxx tools/dockerfile/grpc_cxx
+if [ "$language" = "c++" ]
+then
+ gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_cxx
+ gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_cxx
+ sudo docker build --no-cache -t grpc/cxx tools/dockerfile/grpc_cxx
+elif [ "$language" = "node" ]
+then
+ sudo docker pull 0.0.0.0:5000/grpc/node_base
+ sudo docker tag -f 0.0.0.0:5000/grpc/node_base grpc/node_base
+ gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_node
+ gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_node
+ sudo docker build --no-cache -t grpc/node tools/dockerfile/grpc_node
+elif [ "$language" = "ruby" ]
+then
+ sudo docker pull 0.0.0.0:5000/grpc/ruby_base
+ sudo docker tag -f 0.0.0.0:5000/grpc/ruby_base grpc/ruby_base
+ gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_ruby
+ gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_ruby
+ sudo docker build --no-cache -t grpc/ruby tools/dockerfile/grpc_ruby
+elif [ "$language" = "php" ]
+then
+ sudo docker pull 0.0.0.0:5000/grpc/php_base
+ sudo docker tag -f 0.0.0.0:5000/grpc/php_base grpc/php_base
+ gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_php
+ gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_php
+ sudo docker build --no-cache -t grpc/php tools/dockerfile/grpc_php
+else
+ echo "interop testss not added for $language"
+ exit 1
+fi
diff --git a/tools/run_tests/run_interops_test.sh b/tools/run_tests/run_interops_test.sh
index 1d0eedad85..9be253af46 100755
--- a/tools/run_tests/run_interops_test.sh
+++ b/tools/run_tests/run_interops_test.sh
@@ -36,6 +36,17 @@ set -e
if [ "$language" = "c++" ]
then
sudo docker run grpc/cxx /var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots --server_host_override=grpc-test.sandbox.google.com --server_host=grpc-test.sandbox.google.com --server_port=443 --test_case=$test_case
+elif [ "$language" = "node" ]
+then
+ sudo docker run grpc/node /usr/bin/nodejs /var/local/git/grpc/src/node/interop/interop_client.js --use_tls=true --use_test_ca=true --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com --test_case=$test_case
+elif [ "$language" = "ruby" ]
+then
+ cmd_prefix="SSL_CERT_FILE=/cacerts/roots.pem ruby /var/local/git/grpc/src/ruby/bin/interop/interop_client.rb --use_tls --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com "
+ cmd="$cmd_prefix --test_case=$test_case"
+ sudo docker run grpc/ruby bin/bash -l -c '$cmd'
+elif [ "$language" = "php" ]
+then
+ sudo docker run -e SSL_CERT_FILE=/cacerts/roots.pem grpc/php /var/local/git/grpc/src/php/bin/interop_client.sh --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com --test_case=$test_case
else
echo "interop testss not added for $language"
exit 1