test/instrumentation/redis_sets_test.rb in oboe-2.6.6.1 vs test/instrumentation/redis_sets_test.rb in oboe-2.6.7.1

- old
+ new

@@ -1,29 +1,29 @@ require 'minitest_helper' require "redis" - + describe Oboe::Inst::Redis, :sets do attr_reader :entry_kvs, :exit_kvs, :redis, :redis_version def min_server_version(version) unless Gem::Version.new(@redis_version) >= Gem::Version.new(version.to_s) - skip "supported only on redis-server #{version} or greater" + skip "supported only on redis-server #{version} or greater" end end before do - clear_all_traces - + clear_all_traces + @redis ||= Redis.new @redis_version ||= @redis.info["redis_version"] # These are standard entry/exit KVs that are passed up with all moped operations @entry_kvs ||= { 'Layer' => 'redis_test', 'Label' => 'entry' } @exit_kvs ||= { 'Layer' => 'redis_test', 'Label' => 'exit' } end - + it "should trace sadd" do min_server_version(1.0) Oboe::API.start_trace('redis_test', '', {}) do @redis.sadd("shrimp", "fried") @@ -32,14 +32,14 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "sadd" traces[2]['KVKey'].must_equal "shrimp" end - + it "should trace scard" do min_server_version(1.0) - + @redis.sadd("mother sauces", "bechamel") @redis.sadd("mother sauces", "veloute") @redis.sadd("mother sauces", "espagnole") @redis.sadd("mother sauces", "hollandaise") @redis.sadd("mother sauces", "classic tomate") @@ -51,11 +51,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "scard" traces[2]['KVKey'].must_equal "mother sauces" end - + it "should trace sdiff" do min_server_version(1.0) @redis.sadd("abc", "a") @redis.sadd("abc", "b") @@ -70,11 +70,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "sdiff" traces[2].has_key?('KVKey').must_equal false end - + it "should trace sdiffstore" do min_server_version(1.0) @redis.sadd("abc", "a") @redis.sadd("abc", "b") @@ -89,11 +89,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "sdiffstore" traces[2]['destination'].must_equal "dest" end - + it "should trace sinter" do min_server_version(1.0) @redis.sadd("abc", "a") @redis.sadd("abc", "b") @@ -108,11 +108,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "sinter" traces[2].has_key?('KVKey').must_equal false end - + it "should trace sinterstore" do min_server_version(1.0) @redis.sadd("abc", "a") @redis.sadd("abc", "b") @@ -127,11 +127,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "sinterstore" traces[2]['destination'].must_equal "dest" end - + it "should trace sismember" do min_server_version(1.0) @redis.sadd("fibonacci", "0") @redis.sadd("fibonacci", "1") @@ -148,11 +148,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "sismember" traces[2]['KVKey'].must_equal "fibonacci" end - + it "should trace smembers" do min_server_version(1.0) @redis.sadd("fibonacci", "0") @redis.sadd("fibonacci", "1") @@ -167,11 +167,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "smembers" traces[2]['KVKey'].must_equal "fibonacci" end - + it "should trace smove" do min_server_version(1.0) @redis.sadd("numbers", "1") @redis.sadd("numbers", "2") @@ -185,11 +185,11 @@ traces.count.must_equal 4 traces[2]['KVOp'].must_equal "smove" traces[2]['source'].must_equal "alpha" traces[2]['destination'].must_equal "numbers" end - + it "should trace spop" do min_server_version(1.0) @redis.sadd("fibonacci", "0") @redis.sadd("fibonacci", "1") @@ -202,11 +202,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "spop" traces[2]['KVKey'].must_equal "fibonacci" end - + it "should trace srandmember" do min_server_version(1.0) @redis.sadd("fibonacci", "0") @redis.sadd("fibonacci", "1") @@ -219,11 +219,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "srandmember" traces[2]['KVKey'].must_equal "fibonacci" end - + it "should trace srem" do min_server_version(1.0) @redis.sadd("fibonacci", "0") @redis.sadd("fibonacci", "1") @@ -236,11 +236,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "srem" traces[2]['KVKey'].must_equal "fibonacci" end - + it "should trace sunion" do min_server_version(1.0) @redis.sadd("group1", "moe") @redis.sadd("group1", "curly") @@ -253,11 +253,11 @@ traces = get_all_traces traces.count.must_equal 4 traces[2]['KVOp'].must_equal "sunion" traces[2].has_key?('KVKey').must_equal false end - + it "should trace sunionstore" do min_server_version(1.0) @redis.sadd("group1", "moe") @redis.sadd("group1", "curly") @@ -271,10 +271,10 @@ traces.count.must_equal 4 traces[2]['KVOp'].must_equal "sunionstore" traces[2]['destination'].must_equal "dest" traces[2].has_key?('KVKey').must_equal false end - + it "should trace sscan" do min_server_version(2.8) @redis.sadd("group1", "moe") @redis.sadd("group1", "curly")