Fix memcached 1.5.4 test compatibility.

epel9
Vít Ondruch 7 years ago
parent 3f7977f09c
commit dce8c2ae9d

@ -0,0 +1,44 @@
From 754414d3cd21a385ea62d58307ed7055e1df2996 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Thu, 18 Jan 2018 17:10:50 +0100
Subject: [PATCH] Fix mamcached 1.5.4 compatibility.
memcached 1.5.4 changed order of evaluation of command line parameters
[1]. As a result, the test suite failed with errors such as:
~~~
$ ruby -Ilib:test -e 'Dir.glob('\''./test/test_*.rb'\'').sort.each{ |x| require x }'
Testing with Rails 5.1.4
Using standard socket IO (ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux])
Run options: --seed 35324
# Running:
Found memcached 1.5.4 in PATH
.........................................................Cannot set item size limit higher than 1/2 of memory max.
Cannot set item size limit higher than 1/2 of memory max.
F
Failure:
Dalli::using a live server::in low memory conditions#test_0001_handle error response correctly [/builddir/build/BUILD/dalli-2.7.6/usr/share/gems/gems/dalli-2.7.6/test/test_dalli.rb:740]:
unexpected failure on iteration 0
/usr/share/gems/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:70:in `method': undefined method `test_0001_handle error response correctly' for class `Minitest::Result' (NameError)
~~~
This commit adjust the memcached parameters to make the test suite pass.
[1] https://github.com/memcached/memcached/commit/95246f7947e9d95969d04db0898a93ef66235fb0
---
test/memcached_mock.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/memcached_mock.rb b/test/memcached_mock.rb
index 47e96cb..42ba9d7 100644
--- a/test/memcached_mock.rb
+++ b/test/memcached_mock.rb
@@ -108,7 +108,7 @@ def memcached_cas_persistent(port = 25662)
def memcached_low_mem_persistent(port = 19128)
- dc = start_and_flush_with_retry(port, '-m 1 -M')
+ dc = start_and_flush_with_retry(port, '-m 1 -M -I 512k')
yield dc, port if block_given?
end

@ -5,7 +5,7 @@
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 2.7.6 Version: 2.7.6
Release: 3%{?dist} Release: 4%{?dist}
Summary: High performance memcached client for Ruby Summary: High performance memcached client for Ruby
License: MIT License: MIT
URL: https://github.com/petergoldstein/dalli URL: https://github.com/petergoldstein/dalli
@ -17,6 +17,9 @@ Source1: %{gem_name}-%{version}-tests.tgz
# Use 'assert_nil ...' instead of 'assert_equal nil, ...' # Use 'assert_nil ...' instead of 'assert_equal nil, ...'
# https://github.com/petergoldstein/dalli/pull/661 # https://github.com/petergoldstein/dalli/pull/661
Patch0: rubygem-dalli-2.7.6-Use-assert_nil-in-tests.patch Patch0: rubygem-dalli-2.7.6-Use-assert_nil-in-tests.patch
# Fix memcached 1.5.4 test compatibility.
# https://github.com/petergoldstein/dalli/pull/672
Patch1: rubygem-dalli-2.7.6-Fix-memcached-1.5.4-compatibility.patch
BuildRequires: ruby(release) BuildRequires: ruby(release)
BuildRequires: rubygems-devel BuildRequires: rubygems-devel
@ -63,6 +66,7 @@ cp -pa .%{gem_dir}/* \
pushd .%{gem_instdir} pushd .%{gem_instdir}
tar xzvf %{SOURCE1} tar xzvf %{SOURCE1}
cat %{PATCH0} | patch -p1 cat %{PATCH0} | patch -p1
cat %{PATCH1} | patch -p1
sed -i '/bundler/ s/^/#/' test/helper.rb sed -i '/bundler/ s/^/#/' test/helper.rb
ruby -Ilib:test -e "Dir.glob('./test/test_*.rb').sort.each{ |x| require x }" ruby -Ilib:test -e "Dir.glob('./test/test_*.rb').sort.each{ |x| require x }"
popd popd
@ -82,6 +86,9 @@ popd
%{gem_instdir}/Gemfile %{gem_instdir}/Gemfile
%changelog %changelog
* Thu Jan 18 2018 Vít Ondruch <vondruch@redhat.com> - 2.7.6-4
- Fix memcached 1.5.4 test compatibility.
* Wed Aug 30 2017 Pavel Valena <pvalena@redhat.com> - 2.7.6-3 * Wed Aug 30 2017 Pavel Valena <pvalena@redhat.com> - 2.7.6-3
- Fix FTBFS(tests only) in rawhide. - Fix FTBFS(tests only) in rawhide.

Loading…
Cancel
Save