diff --git a/kokoro/linux/dockerfile/test/ruby/Dockerfile b/kokoro/linux/dockerfile/test/ruby/Dockerfile new file mode 100644 index 0000000000..41bfedeb33 --- /dev/null +++ b/kokoro/linux/dockerfile/test/ruby/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:jessie + +# Install dependencies. We start with the basic ones require to build protoc +# and the C++ build +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + git \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + parallel \ + time \ + wget \ + && apt-get clean + +# Install rvm +RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys \ + 409B6B1796C275462A1703113804BB82D39DC0E3 \ + 7D2BAF1CF37B13E2069D6956105BD0E739499BDB +RUN \curl -sSL https://get.rvm.io | bash -s stable + +RUN /bin/bash -l -c "rvm install 2.3.8" +RUN /bin/bash -l -c "rvm install 2.4.5" +RUN /bin/bash -l -c "rvm install 2.5.1" +RUN /bin/bash -l -c "rvm install 2.6.0" + +RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" +RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" diff --git a/kokoro/linux/ruby23/build.sh b/kokoro/linux/ruby23/build.sh index a80f02f9b1..503a320de2 100755 --- a/kokoro/linux/ruby23/build.sh +++ b/kokoro/linux/ruby23/build.sh @@ -10,7 +10,8 @@ # Change to repo root cd $(dirname $0)/../../.. -export DOCKERFILE_DIR=kokoro/linux/64-bit +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh export OUTPUT_DIR=testoutput export TEST_SET="ruby23" diff --git a/kokoro/linux/ruby24/build.sh b/kokoro/linux/ruby24/build.sh index bb6e3dc071..68585aabc0 100755 --- a/kokoro/linux/ruby24/build.sh +++ b/kokoro/linux/ruby24/build.sh @@ -10,7 +10,8 @@ # Change to repo root cd $(dirname $0)/../../.. -export DOCKERFILE_DIR=kokoro/linux/64-bit +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh export OUTPUT_DIR=testoutput export TEST_SET="ruby24" diff --git a/kokoro/linux/ruby25/build.sh b/kokoro/linux/ruby25/build.sh index ecf98c0d3b..1e82ec5f4c 100755 --- a/kokoro/linux/ruby25/build.sh +++ b/kokoro/linux/ruby25/build.sh @@ -10,7 +10,8 @@ # Change to repo root cd $(dirname $0)/../../.. -export DOCKERFILE_DIR=kokoro/linux/64-bit +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh export OUTPUT_DIR=testoutput export TEST_SET="ruby25" diff --git a/kokoro/linux/ruby26/build.sh b/kokoro/linux/ruby26/build.sh new file mode 100755 index 0000000000..72d2d45669 --- /dev/null +++ b/kokoro/linux/ruby26/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# This is the top-level script we give to Kokoro as the entry point for +# running the "pull request" project: +# +# This script selects a specific Dockerfile (for building a Docker image) and +# a script to run inside that image. Then we delegate to the general +# build_and_run_docker.sh script. + +# Change to repo root +cd $(dirname $0)/../../.. + +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby +export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh +export OUTPUT_DIR=testoutput +export TEST_SET="ruby26" +./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby26/continuous.cfg b/kokoro/linux/ruby26/continuous.cfg new file mode 100644 index 0000000000..4779065670 --- /dev/null +++ b/kokoro/linux/ruby26/continuous.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/ruby26/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/ruby26/presubmit.cfg b/kokoro/linux/ruby26/presubmit.cfg new file mode 100644 index 0000000000..4779065670 --- /dev/null +++ b/kokoro/linux/ruby26/presubmit.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/ruby26/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/macos/ruby26/build.sh b/kokoro/macos/ruby26/build.sh new file mode 100755 index 0000000000..6c33ed0a7e --- /dev/null +++ b/kokoro/macos/ruby26/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Build file to set up and run tests + +# Change to repo root +cd $(dirname $0)/../../.. + +# Prepare worker environment to run tests +source kokoro/macos/prepare_build_macos_rc + +./tests.sh ruby26 diff --git a/kokoro/macos/ruby26/continuous.cfg b/kokoro/macos/ruby26/continuous.cfg new file mode 100644 index 0000000000..688f63c2bc --- /dev/null +++ b/kokoro/macos/ruby26/continuous.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/ruby26/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/ruby26/presubmit.cfg b/kokoro/macos/ruby26/presubmit.cfg new file mode 100644 index 0000000000..688f63c2bc --- /dev/null +++ b/kokoro/macos/ruby26/presubmit.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/ruby26/build.sh" +timeout_mins: 1440 diff --git a/ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb b/ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb index 201fe36b97..4ebb731a83 100644 --- a/ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb +++ b/ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb @@ -19,6 +19,7 @@ class RepeatedFieldTest < Test::Unit::TestCase arr_methods -= [ :indices, :iter_for_each, :iter_for_each_index, :iter_for_each_with_index, :dimensions, :copy_data, :copy_data_simple, :nitems, :iter_for_reverse_each, :indexes, :append, :prepend] + arr_methods -= [:union, :difference, :filter!] arr_methods.each do |method_name| assert m.repeated_string.respond_to?(method_name) == true, "does not respond to #{method_name}" end diff --git a/ruby/tests/repeated_field_test.rb b/ruby/tests/repeated_field_test.rb index 3119d57869..df8ede42cd 100644 --- a/ruby/tests/repeated_field_test.rb +++ b/ruby/tests/repeated_field_test.rb @@ -19,6 +19,7 @@ class RepeatedFieldTest < Test::Unit::TestCase arr_methods -= [ :indices, :iter_for_each, :iter_for_each_index, :iter_for_each_with_index, :dimensions, :copy_data, :copy_data_simple, :nitems, :iter_for_reverse_each, :indexes, :append, :prepend] + arr_methods -= [:union, :difference, :filter!] arr_methods.each do |method_name| assert m.repeated_string.respond_to?(method_name) == true, "does not respond to #{method_name}" end diff --git a/ruby/travis-test.sh b/ruby/travis-test.sh index cbe7cd983c..a08964f4ca 100755 --- a/ruby/travis-test.sh +++ b/ruby/travis-test.sh @@ -13,12 +13,23 @@ test_version() { git clean -f && \ gem install bundler && bundle && \ rake test" + elif [ "$version" == "ruby-2.6.0" ] ; then + bash --login -c \ + "rvm install $version && rvm use $version && \ + which ruby && \ + git clean -f && \ + gem install bundler -v 1.17.3 && bundle && \ + rake test && + rake gc_test && + cd ../conformance && make test_ruby && + cd ../ruby/compatibility_tests/v3.0.0 && + cp -R ../../lib lib && ./test.sh" else bash --login -c \ "rvm install $version && rvm use $version && \ which ruby && \ git clean -f && \ - gem install bundler && bundle && \ + gem install bundler -v 1.17.3 && bundle && \ rake test && rake gc_test && cd ../conformance && make test_ruby && diff --git a/tests.sh b/tests.sh index 783261ddc6..91f27b1df0 100755 --- a/tests.sh +++ b/tests.sh @@ -322,10 +322,9 @@ build_ruby25() { internal_build_cpp # For conformance tests. cd ruby && bash travis-test.sh ruby-2.5.1 && cd .. } -build_ruby_all() { - build_ruby23 - build_ruby24 - build_ruby25 +build_ruby26() { + internal_build_cpp # For conformance tests. + cd ruby && bash travis-test.sh ruby-2.6.0 && cd .. } build_javascript() { @@ -616,6 +615,7 @@ Usage: $0 { cpp | ruby23 | ruby24 | ruby25 | + ruby26 | jruby | ruby_all | php5.5 |