Skip to content

Commit

Permalink
RUBY-1599 Test against BSON 5 (#2740)
Browse files Browse the repository at this point in the history
* let's not run 2.18-stable specs against MDB 7+

* Revert "let's not run 2.18-stable specs against MDB 7+"

Meant to do this on a branch :/

This reverts commit 1f3f7c7.

* remove dead comments, and permit bson5 for these specs

* name the bson matrix appropriately

* fix duplicate variant names
  • Loading branch information
jamis authored Jul 12, 2023
1 parent eef4b20 commit c928e60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 66 deletions.
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

0 comments on commit c928e60

Please sign in to comment.