diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a31734f6..a077c604 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,7 @@ jobs: strategy: matrix: ruby: - - '2.5' # earliest supported - - '3.0' # latest release + - '3.4' # latest release steps: - run: | diff --git a/Gemfile b/Gemfile index 0590916d..670cd4f9 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ gemspec gem 'test-unit' gem "stackprof" +gem "ostruct" group :benchmark do gem "remix-stash", '~> 1.1.3' diff --git a/Gemfile.lock b/Gemfile.lock index 67254cd1..ddb97084 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,30 +6,47 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (6.1.3.1) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (8.0.3) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - concurrent-ruby (1.1.8) - dalli (2.7.11) - i18n (1.8.10) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + base64 (0.3.0) + benchmark (0.4.1) + bigdecimal (3.3.1) + concurrent-ruby (1.3.5) + connection_pool (2.5.4) + dalli (3.2.8) + drb (2.2.3) + i18n (1.14.7) concurrent-ruby (~> 1.0) + logger (1.7.0) memcache-client (1.8.5) - minitest (5.14.4) - mocha (1.12.0) - power_assert (2.0.0) - rake (13.0.3) - rake-compiler (1.1.1) + minitest (5.26.0) + mocha (2.7.1) + ruby2_keywords (>= 0.0.5) + ostruct (0.6.3) + power_assert (2.0.5) + rake (13.3.0) + rake-compiler (1.3.0) rake remix-stash (1.1.3) - stackprof (0.2.17) - test-unit (3.4.0) + ruby2_keywords (0.0.5) + securerandom (0.4.1) + stackprof (0.2.27) + test-unit (3.7.0) power_assert - tzinfo (2.0.4) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - zeitwerk (2.4.2) + uri (1.0.4) PLATFORMS ruby @@ -40,6 +57,7 @@ DEPENDENCIES memcache-client memcached! mocha + ostruct rake rake-compiler remix-stash (~> 1.1.3) @@ -47,4 +65,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 2.1.4 + 2.7.2 diff --git a/test/setup.rb b/test/setup.rb index fb5bd237..b5f94262 100644 --- a/test/setup.rb +++ b/test/setup.rb @@ -4,7 +4,9 @@ UNIX_SOCKET_NAME = File.join(ENV['TMPDIR']||'/tmp','memcached') # Kill memcached - system("killall -9 memcached") + unless ENV['CI'] + system("killall -9 memcached") + end # Start memcached verbosity = (ENV['DEBUG'] ? "-vv" : "") diff --git a/test/unit/memcached_experimental_test.rb b/test/unit/memcached_experimental_test.rb index da72a36d..affcae29 100644 --- a/test/unit/memcached_experimental_test.rb +++ b/test/unit/memcached_experimental_test.rb @@ -100,7 +100,7 @@ def test_reset private def key - caller.first[/.*[` ](.*)'/, 1] # ' + caller.first[/.*[`' ](.*)'/, 1] # ' end def stub_server(port) diff --git a/test/unit/memcached_test.rb b/test/unit/memcached_test.rb index 39702c07..ff3e366f 100644 --- a/test/unit/memcached_test.rb +++ b/test/unit/memcached_test.rb @@ -422,7 +422,7 @@ def test_get_multi_missing @cache.set "#{key}_3", 3 @cache.delete "#{key}_4" rescue nil assert_equal( - {"test_get_multi_missing_3"=>3, "test_get_multi_missing_1"=>1}, + {"#{key}_3"=>3, "#{key}_1"=>1}, @cache.get(["#{key}_1", "#{key}_2", "#{key}_3", "#{key}_4"]) ) end @@ -432,7 +432,7 @@ def test_get_multi_binary @binary_protocol_cache.delete "#{key}_2" rescue nil @binary_protocol_cache.set "#{key}_3", 3 assert_equal( - {"test_get_multi_binary_3"=>3, "test_get_multi_binary_1"=>1}, + {"#{key}_3"=>3, "#{key}_1"=>1}, @binary_protocol_cache.get(["#{key}_1", "#{key}_2", "#{key}_3"]) ) end @@ -1582,7 +1582,7 @@ def interrupt_test_with_options(key, options) end def key - caller.first[/.*[` ](.*)'/, 1] # ' + caller.first[/.*[`' ](.*)'/, 1] # ' end def stub_server(port) diff --git a/test/unit/rails_test.rb b/test/unit/rails_test.rb index b83058e0..7748650e 100644 --- a/test/unit/rails_test.rb +++ b/test/unit/rails_test.rb @@ -236,7 +236,7 @@ def test_fetch assert_equal @value, @cache.fetch("x"){ 1 } # works with options - @cache.expects(:write).with("y", 1, :foo => :bar) + @cache.expects(:write).with("y", 1, {:foo => :bar}) @cache.fetch("y", :foo => :bar){ 1 } end @@ -325,7 +325,7 @@ def test_write_with_nil_options private def key - caller.first[/.*[` ](.*)'/, 1] # ' + caller.first[/.*[`' ](.*)'/, 1] # ' end def compare_servers(cache, servers)