Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ group :development do
gem "minitest", "< 6.0"
gem "minitest-reporters"
gem "mutex_m"
gem "opentelemetry-metrics-sdk"
gem "opentelemetry-sdk"
gem "opentelemetry-metrics-sdk", "~> 0.11.2"
gem "opentelemetry-sdk", "~> 1.10"
Comment thread
DemetrisChr marked this conversation as resolved.
gem "rack"
gem "reek"
gem "rubocop", require: false
Expand Down
2 changes: 2 additions & 0 deletions ext/rcb_crud.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ cb_Backend_document_append(VALUE self,
cb_extract_content(req, content);
cb_extract_timeout(req, options);
cb_extract_durability_level(req, options);
cb_extract_cas(req, options);

auto parent_span = cb_create_parent_span(req, self);

Expand Down Expand Up @@ -807,6 +808,7 @@ cb_Backend_document_prepend(VALUE self,
cb_extract_content(req, content);
cb_extract_timeout(req, options);
cb_extract_durability_level(req, options);
cb_extract_cas(req, options);

auto parent_span = cb_create_parent_span(req, self);

Expand Down
22 changes: 22 additions & 0 deletions test/crud_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,28 @@ def test_prepend_with_durability
assert_equal "barfoo", res.content
end

def test_append_with_bad_cas
doc_id = uniq_id(:append)

res = @collection.upsert(doc_id, "foo", Options::Upsert(transcoder: RawBinaryTranscoder.new))

Comment thread
DemetrisChr marked this conversation as resolved.
refute_equal 0, res.cas
assert_raises(Couchbase::Error::CasMismatch) do
@collection.binary.append(doc_id, "bar", Options::Append(cas: res.cas + 1))
end
end

def test_prepend_with_bad_cas
doc_id = uniq_id(:prepend)

res = @collection.upsert(doc_id, "foo", Options::Upsert(transcoder: RawBinaryTranscoder.new))

Comment thread
DemetrisChr marked this conversation as resolved.
refute_equal 0, res.cas
assert_raises(Couchbase::Error::CasMismatch) do
@collection.binary.prepend(doc_id, "bar", Options::Prepend(cas: res.cas + 1))
end
end

def test_multi_ops
skip("#{name}: The #{Couchbase::Protostellar::NAME} protocol does not support multi ops") if env.protostellar?

Expand Down
Loading