From 6a4c4fabf359a8253c94eaeeb7e044973bcc5837 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 12:08:57 -0800 Subject: [PATCH 01/12] Added ruby tests to run_tests.py --- src/ruby/ext/grpc/extconf.rb | 16 ++++++++++++ tools/run_tests/build_ruby.sh | 47 +++++++++++++++++++++++++++++++++++ tools/run_tests/run_ruby.sh | 36 +++++++++++++++++++++++++++ tools/run_tests/run_tests.py | 12 +++++++++ 4 files changed, 111 insertions(+) create mode 100755 tools/run_tests/build_ruby.sh create mode 100755 tools/run_tests/run_ruby.sh diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb index 96c92e2be5dda..483a31f60cce5 100644 --- a/src/ruby/ext/grpc/extconf.rb +++ b/src/ruby/ext/grpc/extconf.rb @@ -32,6 +32,17 @@ LIBDIR = RbConfig::CONFIG['libdir'] INCLUDEDIR = RbConfig::CONFIG['includedir'] +if ENV.key? 'GRPC_ROOT' + GRPC_ROOT = ENV['GRPC_ROOT'] + if ENV.key? 'GRPC_LIB_DIR' + GRPC_LIB_DIR = ENV['GRPC_LIB_DIR'] + else + GRPC_LIB_DIR = 'libs/opt' + end +else + GRPC_ROOT = nil +end + HEADER_DIRS = [ # Search /opt/local (Mac source install) '/opt/local/include', @@ -54,6 +65,11 @@ LIBDIR ] +unless GRPC_ROOT.nil? + HEADER_DIRS.unshift File.join(GRPC_ROOT, 'include') + LIB_DIRS.unshift File.join(GRPC_ROOT, GRPC_LIB_DIR) +end + def crash(msg) print(" extconf failure: #{msg}\n") exit 1 diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/build_ruby.sh new file mode 100755 index 0000000000000..53a69cf0798bc --- /dev/null +++ b/tools/run_tests/build_ruby.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Copyright 2015, 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 + +CONFIG=${CONFIG:-opt} + +# change to grpc repo root +cd $(dirname $0)/../.. + +# tells npm install to look for files in that directory +export GRPC_ROOT=`pwd` +# tells npm install the subdirectory with library files +export GRPC_LIB_SUBDIR=libs/$CONFIG + +cd src/ruby + +bundle install +rake compile:grpc diff --git a/tools/run_tests/run_ruby.sh b/tools/run_tests/run_ruby.sh new file mode 100755 index 0000000000000..b82ce52af3821 --- /dev/null +++ b/tools/run_tests/run_ruby.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright 2015, 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 + +# change to grpc repo root +cd $(dirname $0)/../../src/ruby + +rake diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 4e0ff85c59d3d..7b87c621ddd09 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -136,6 +136,17 @@ def make_targets(self): def build_steps(self): return [['tools/run_tests/build_python.sh']] +class RubyLanguage(object): + + def test_specs(self, config, travis): + return [config.job_spec('tools/run_tests/run_ruby.sh', None)] + + def make_targets(self): + return ['static_c'] + + def build_steps(self): + return [['tools/run_tests/build_ruby.sh']] + # different configurations we can run under _CONFIGS = { @@ -160,6 +171,7 @@ def build_steps(self): 'node': NodeLanguage(), 'php': PhpLanguage(), 'python': PythonLanguage(), + 'ruby': RubyLanguage() } # parse command line From cc2ef26288b860e43ea494b16ee4d9a35a15fb3f Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 12:51:14 -0800 Subject: [PATCH 02/12] Added ruby tests to travis file --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d770e7261f522..ad5fa22e39cf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,5 +10,6 @@ script: - ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 - ./tools/run_tests/run_tests.py -l node -t -j 16 -c opt + - ./tools/run_tests/run_tests.py -l ruby -t -j 16 -c opt notifications: email: false From 7f86e953660b0a100eadc31ed538e66e037d475e Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 13:20:43 -0800 Subject: [PATCH 03/12] Added ruby version file for travis --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000000000..8f9174b4dd16e --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.1.2 \ No newline at end of file From c921865c3956425732ab3bb27041729b95155153 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:08:46 -0800 Subject: [PATCH 04/12] Changed how ruby version is selected --- .ruby-version | 1 - tools/run_tests/build_ruby.sh | 2 ++ tools/run_tests/run_ruby.sh | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 8f9174b4dd16e..0000000000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.1.2 \ No newline at end of file diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/build_ruby.sh index 53a69cf0798bc..808570d80041f 100755 --- a/tools/run_tests/build_ruby.sh +++ b/tools/run_tests/build_ruby.sh @@ -31,6 +31,8 @@ set -ex +rvm use 2.1.2 + CONFIG=${CONFIG:-opt} # change to grpc repo root diff --git a/tools/run_tests/run_ruby.sh b/tools/run_tests/run_ruby.sh index b82ce52af3821..ef28c74398e0e 100755 --- a/tools/run_tests/run_ruby.sh +++ b/tools/run_tests/run_ruby.sh @@ -30,6 +30,8 @@ set -ex +rvm use 2.1.2 + # change to grpc repo root cd $(dirname $0)/../../src/ruby From ea14cfb4932335d4ccb7b7a612338157451d2f08 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:21:45 -0800 Subject: [PATCH 05/12] Further changed ruby version handling --- tools/run_tests/build_ruby.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/build_ruby.sh index 808570d80041f..e5eae05cb281a 100755 --- a/tools/run_tests/build_ruby.sh +++ b/tools/run_tests/build_ruby.sh @@ -31,6 +31,7 @@ set -ex +rvm install 2.1.2 rvm use 2.1.2 CONFIG=${CONFIG:-opt} From 530c0b9b1fc6690423a457166c2ff7a71c35c050 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:38:34 -0800 Subject: [PATCH 06/12] Changed how ruby versions are selected again --- .travis.yml | 2 ++ tools/run_tests/build_ruby.sh | 3 --- tools/run_tests/run_ruby.sh | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad5fa22e39cf7..ba21f8cb912d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv script: + - rvm install 2.1.2 + - rvm use 2.1.2 - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 - make clean diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/build_ruby.sh index e5eae05cb281a..53a69cf0798bc 100755 --- a/tools/run_tests/build_ruby.sh +++ b/tools/run_tests/build_ruby.sh @@ -31,9 +31,6 @@ set -ex -rvm install 2.1.2 -rvm use 2.1.2 - CONFIG=${CONFIG:-opt} # change to grpc repo root diff --git a/tools/run_tests/run_ruby.sh b/tools/run_tests/run_ruby.sh index ef28c74398e0e..b82ce52af3821 100755 --- a/tools/run_tests/run_ruby.sh +++ b/tools/run_tests/run_ruby.sh @@ -30,8 +30,6 @@ set -ex -rvm use 2.1.2 - # change to grpc repo root cd $(dirname $0)/../../src/ruby From 726b486b80b70cc5c49c163891d75f3c44b9468a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:54:24 -0800 Subject: [PATCH 07/12] Updated bundler in travis.yml --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ba21f8cb912d4..efb27d09c2dec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,14 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv script: - - rvm install 2.1.2 - rvm use 2.1.2 - - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 + - gem install bundler + - #./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 + - #./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 - make clean - - ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 - - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 - - ./tools/run_tests/run_tests.py -l node -t -j 16 -c opt + - #./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 + - #./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 + - #./tools/run_tests/run_tests.py -l node -t -j 16 -c opt - ./tools/run_tests/run_tests.py -l ruby -t -j 16 -c opt notifications: email: false From 640e93f10be36f9d641918db148b5e57896588cf Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:59:37 -0800 Subject: [PATCH 08/12] Uncommented tests, switched to less specific version of ruby --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index efb27d09c2dec..769d552f57ee2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,14 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv script: - - rvm use 2.1.2 + - rvm use 2.1 - gem install bundler - - #./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - - #./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 + - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 + - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 - make clean - - #./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 - - #./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 - - #./tools/run_tests/run_tests.py -l node -t -j 16 -c opt + - ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 + - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 + - ./tools/run_tests/run_tests.py -l node -t -j 16 -c opt - ./tools/run_tests/run_tests.py -l ruby -t -j 16 -c opt notifications: email: false From 7e14dd817a17547a33c8730382fb3a28e831b008 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 15:06:03 -0800 Subject: [PATCH 09/12] Moved ruby version to environment varible --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 769d552f57ee2..c3b5efb4e4a56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,10 @@ before_install: - sudo add-apt-repository ppa:yjwong/gflags -y - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv +env: + - RUBY_VERSION=2.1 script: - - rvm use 2.1 + - rvm use $RUBY_VERSION - gem install bundler - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 From 239916079600f40eb035cac272c2a7211c75b77a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 15:39:03 -0800 Subject: [PATCH 10/12] Switched to test matrix --- .travis.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index c3b5efb4e4a56..17957584b76b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,16 +4,18 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv env: - - RUBY_VERSION=2.1 + global: + - RUBY_VERSION=2.1 + matrix: + - CONFIG=dbg TEST=c + - CONFIG=dbg TEST=c++ + - CONFIG=opt TEST=c + - CONFIG=opt TEST=c++ + - CONFIG=opt TEST=node + - CONFIG=opt TEST=ruby script: - rvm use $RUBY_VERSION - gem install bundler - - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 - - make clean - - ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 - - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 - - ./tools/run_tests/run_tests.py -l node -t -j 16 -c opt - - ./tools/run_tests/run_tests.py -l ruby -t -j 16 -c opt + - ./tools/run_tests/run_tests.py -l $TEST -t -j 16 -c $CONFIG -s 2.0 notifications: - email: false + email: false \ No newline at end of file From ffc442c96126abde3355a7ac4c50fe326399d474 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 15:46:13 -0800 Subject: [PATCH 11/12] Added multiple ruby version tests --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 17957584b76b3..71e60a751b3a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ env: - CONFIG=opt TEST=c - CONFIG=opt TEST=c++ - CONFIG=opt TEST=node + - CONFIG=opt TEST=ruby RUBY_VERSION=2.1.0 - CONFIG=opt TEST=ruby script: - rvm use $RUBY_VERSION From 0ee5fb8754afc44ee341ff3b737bcfe544ba390c Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 15:54:33 -0800 Subject: [PATCH 12/12] Removed test with non-included version of ruby --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 71e60a751b3a4..17957584b76b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ env: - CONFIG=opt TEST=c - CONFIG=opt TEST=c++ - CONFIG=opt TEST=node - - CONFIG=opt TEST=ruby RUBY_VERSION=2.1.0 - CONFIG=opt TEST=ruby script: - rvm use $RUBY_VERSION