Skip to content

RUBY-1599 Test against BSON 5 #2740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 12, 2023
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 .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ buildvariants:
mongodb-version: ["latest", "7.0", "6.0"]
topology: ["standalone", "replica-set", "sharded-cluster"]
os: rhel8
display_name: ${auth-and-ssl} ${ruby} ${topology}
display_name: ${auth-and-ssl} ${ruby} db-${mongodb-version} ${topology}
tasks:
- name: "test-mlaunch"

Expand Down Expand Up @@ -1338,7 +1338,7 @@ buildvariants:
topology: replica-set
bson: "*"
os: rhel8
display_name: "AS ${mongodb-version} ${topology} ${ruby} ${bson}"
display_name: "bson-${bson} ${mongodb-version} ${topology} ${ruby}"
tasks:
- name: "test-mlaunch"

Expand Down
4 changes: 2 additions & 2 deletions .evergreen/config/standard.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ buildvariants:
mongodb-version: <%= actual_and_upcoming_mdb %>
topology: <%= topologies %>
os: rhel8
display_name: ${auth-and-ssl} ${ruby} ${topology}
display_name: ${auth-and-ssl} ${ruby} db-${mongodb-version} ${topology}
tasks:
- name: "test-mlaunch"

Expand Down Expand Up @@ -320,7 +320,7 @@ buildvariants:
topology: replica-set
bson: "*"
os: rhel8
display_name: "AS ${mongodb-version} ${topology} ${ruby} ${bson}"
display_name: "bson-${bson} ${mongodb-version} ${topology} ${ruby}"
tasks:
- name: "test-mlaunch"

Expand Down
63 changes: 1 addition & 62 deletions spec/mongo/protocol/msg_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# rubocop:todo all

require 'lite_spec_helper'
require 'spec_helper'
require 'support/shared/protocol'

describe Mongo::Protocol::Msg do
Expand Down Expand Up @@ -237,44 +237,6 @@
end
end

=begin no longer supported
context 'when a 0 payload type is specified' do

let(:section) do
{ type: 0, payload: { ismaster: 1 } }
end

let(:section_payload_type) { bytes.to_s[36] }
let(:section_bytes) { bytes.to_s[37..-1] }

it 'sets the payload type' do
expect(section_payload_type).to eq(0.chr)
end

it 'serializes the section' do
expect(section_bytes).to be_bson(section[:payload])
end
end

context 'when a no payload type is specified' do

let(:section) do
{ payload: { ismaster: 1 } }
end

let(:section_payload_type) { bytes.to_s[36] }
let(:section_bytes) { bytes.to_s[37..-1] }

it 'sets the payload type as 0' do
expect(section_payload_type).to eq(0.chr)
end

it 'serializes the section' do
expect(section_bytes).to be_bson(section[:payload])
end
end
=end

context 'when a payload of type 1 is specified' do

let(:section) do
Expand Down Expand Up @@ -366,32 +328,9 @@
end
end
end

=begin no longer supported
context 'when the sections are mixed types and payload type 1 comes before type 0' do

let(:section1) do
Mongo::Protocol::Msg::Section1.new('documents', [ { a: 1 } ])
end

let(:section2) do
{ type: 0, payload: { 'b' => 2 } }
end

let(:sections) do
[ section1, section2 ]
end

it 'serializes all sections' do
expect(deserialized.documents).to eq([ BSON::Document.new(main_document), { 'a' => 1 }, { 'b' => 2 }])
end
end
=end
end

context 'when the validating_keys option is true with payload 1' do
max_bson_version '4.99.99'

let(:sequences) do
[ section ]
end
Expand Down