From 715b6d41d1b175bf7dbb54e9d17c05e96a6c9e42 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 3 Oct 2019 13:10:27 +0900 Subject: [PATCH] [GLib][CI] Unpin gobject-introspection gem gobject-introspection gem 3.3.8 or later is needed for GLib 2.62.0 or later. But gobject-introspection gem 3.3.8 has some problems. This change omits tests that are affected by these problems. --- c_glib/Gemfile | 2 +- c_glib/test/plasma/test-plasma-client.rb | 1 + .../test/plasma/test-plasma-created-object.rb | 3 ++ .../plasma/test-plasma-referred-object.rb | 3 ++ c_glib/test/test-cuda.rb | 2 ++ ruby/red-arrow/red-arrow.gemspec | 2 +- ruby/red-plasma/test/helper.rb | 1 + ruby/red-plasma/test/helper/omittable.rb | 36 +++++++++++++++++++ ruby/red-plasma/test/test-plasma-client.rb | 3 ++ 9 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 ruby/red-plasma/test/helper/omittable.rb diff --git a/c_glib/Gemfile b/c_glib/Gemfile index f42c1850a17..4b570902bcd 100644 --- a/c_glib/Gemfile +++ b/c_glib/Gemfile @@ -20,4 +20,4 @@ source "https://rubygems.org/" gem "test-unit" -gem "gobject-introspection", "= 3.3.7" +gem "gobject-introspection" diff --git a/c_glib/test/plasma/test-plasma-client.rb b/c_glib/test/plasma/test-plasma-client.rb index a57d1fc5944..14c65b4d65b 100644 --- a/c_glib/test/plasma/test-plasma-client.rb +++ b/c_glib/test/plasma/test-plasma-client.rb @@ -21,6 +21,7 @@ class TestPlasmaClient < Test::Unit::TestCase def setup @store = nil omit("Plasma is required") unless defined?(::Plasma) + require_gi_bindings(3, 3, 9) @store = Helper::PlasmaStore.new @store.start @options = Plasma::ClientOptions.new diff --git a/c_glib/test/plasma/test-plasma-created-object.rb b/c_glib/test/plasma/test-plasma-created-object.rb index 857322d20e1..8d036cda87a 100644 --- a/c_glib/test/plasma/test-plasma-created-object.rb +++ b/c_glib/test/plasma/test-plasma-created-object.rb @@ -16,9 +16,12 @@ # under the License. class TestPlasmaCreatedObject < Test::Unit::TestCase + include Helper::Omittable + def setup @store = nil omit("Plasma is required") unless defined?(::Plasma) + require_gi_bindings(3, 3, 9) @store = Helper::PlasmaStore.new @store.start @client = Plasma::Client.new(@store.socket_path, nil) diff --git a/c_glib/test/plasma/test-plasma-referred-object.rb b/c_glib/test/plasma/test-plasma-referred-object.rb index a74641ed5dc..ef4c72aee53 100644 --- a/c_glib/test/plasma/test-plasma-referred-object.rb +++ b/c_glib/test/plasma/test-plasma-referred-object.rb @@ -16,9 +16,12 @@ # under the License. class TestPlasmaReferredObject < Test::Unit::TestCase + include Helper::Omittable + def setup @store = nil omit("Plasma is required") unless defined?(::Plasma) + require_gi_bindings(3, 3, 9) @store = Helper::PlasmaStore.new @store.start @client = Plasma::Client.new(@store.socket_path, nil) diff --git a/c_glib/test/test-cuda.rb b/c_glib/test/test-cuda.rb index ae915307b70..d24bab610c8 100644 --- a/c_glib/test/test-cuda.rb +++ b/c_glib/test/test-cuda.rb @@ -17,6 +17,7 @@ class TestCUDA < Test::Unit::TestCase include Helper::Buildable + include Helper::Omittable def setup omit("Arrow CUDA is required") unless defined?(::ArrowCUDA) @@ -47,6 +48,7 @@ def test_copy end def test_export + require_gi_bindings(3, 3, 9) @buffer.copy_from_host("Hello World") handle = @buffer.export serialized_handle = handle.serialize.data diff --git a/ruby/red-arrow/red-arrow.gemspec b/ruby/red-arrow/red-arrow.gemspec index 75430b5b979..f4fcda90efe 100644 --- a/ruby/red-arrow/red-arrow.gemspec +++ b/ruby/red-arrow/red-arrow.gemspec @@ -47,7 +47,7 @@ Gem::Specification.new do |spec| spec.extensions = ["ext/arrow/extconf.rb"] spec.add_runtime_dependency("extpp", ">= 0.0.7") - spec.add_runtime_dependency("gio2", "= 3.3.7") + spec.add_runtime_dependency("gio2", ">= 3.3.6") spec.add_runtime_dependency("native-package-installer") spec.add_runtime_dependency("pkg-config") diff --git a/ruby/red-plasma/test/helper.rb b/ruby/red-plasma/test/helper.rb index 255cad28700..02c545f5367 100644 --- a/ruby/red-plasma/test/helper.rb +++ b/ruby/red-plasma/test/helper.rb @@ -21,4 +21,5 @@ require "test-unit" +require_relative "helper/omittable" require_relative "helper/plasma-store" diff --git a/ruby/red-plasma/test/helper/omittable.rb b/ruby/red-plasma/test/helper/omittable.rb new file mode 100644 index 00000000000..a1c0334b63a --- /dev/null +++ b/ruby/red-plasma/test/helper/omittable.rb @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +module Helper + module Omittable + def require_gi_bindings(major, minor, micro) + return if GLib.check_binding_version?(major, minor, micro) + message = + "Require gobject-introspection #{major}.#{minor}.#{micro} or later: " + + GLib::BINDING_VERSION.join(".") + omit(message) + end + + def require_gi(major, minor, micro) + return if GObjectIntrospection::Version.or_later?(major, minor, micro) + message = + "Require GObject Introspection #{major}.#{minor}.#{micro} or later: " + + GObjectIntrospection::Version::STRING + omit(message) + end + end +end diff --git a/ruby/red-plasma/test/test-plasma-client.rb b/ruby/red-plasma/test/test-plasma-client.rb index de76fb9d36e..d6182976c5f 100644 --- a/ruby/red-plasma/test/test-plasma-client.rb +++ b/ruby/red-plasma/test/test-plasma-client.rb @@ -16,8 +16,11 @@ # under the License. class TestPlasmaClient < Test::Unit::TestCase + include Helper::Omittable + def setup @store = nil + require_gi_bindings(3, 3, 9) @store = Helper::PlasmaStore.new @store.start @id = Plasma::ObjectID.new("Hello")