From 1f3f7c76655b10803087ba24274bacf7c3468eec Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Tue, 20 Jun 2023 16:16:10 -0600 Subject: [PATCH 1/5] let's not run 2.18-stable specs against MDB 7+ --- .evergreen/config.yml | 4 ++-- .evergreen/config/standard.yml.erb | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index cc3dc63305..23b1cb8897 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1063,7 +1063,7 @@ buildvariants: matrix_spec: auth-and-ssl: ["auth-and-ssl", "noauth-and-nossl"] ruby: "ruby-3.2" - mongodb-version: ["latest", "7.0", "6.0"] + mongodb-version: "6.0" topology: ["standalone", "replica-set", "sharded-cluster"] os: rhel8 display_name: ${auth-and-ssl} ${ruby} ${topology} @@ -1073,7 +1073,7 @@ buildvariants: - matrix_name: "mongo-recent" matrix_spec: ruby: ["ruby-3.2", "ruby-3.1", "jruby-9.3"] - mongodb-version: ["latest", "7.0", "6.0"] + mongodb-version: "6.0" topology: ["standalone", "replica-set", "sharded-cluster"] os: ['rhel8'] # There is no latest for ubuntu2204, so we can't test it here. diff --git a/.evergreen/config/standard.yml.erb b/.evergreen/config/standard.yml.erb index 8e56bcf887..160d6c58de 100644 --- a/.evergreen/config/standard.yml.erb +++ b/.evergreen/config/standard.yml.erb @@ -35,7 +35,6 @@ latest_stable_mdb = "6.0".inspect # so it gets quoted as a string # A few of the most recent MongoDB versions - actual_and_upcoming_mdb = %w( latest 7.0 6.0 ) recent_mdb = %w( 6.0 5.3 ) latest_5x_mdb = "5.3".inspect # so it gets quoted as a string %> @@ -45,7 +44,7 @@ buildvariants: matrix_spec: auth-and-ssl: ["auth-and-ssl", "noauth-and-nossl"] ruby: <%= latest_ruby %> - mongodb-version: <%= actual_and_upcoming_mdb %> + mongodb-version: <%= latest_stable_mdb %> topology: <%= topologies %> os: rhel8 display_name: ${auth-and-ssl} ${ruby} ${topology} @@ -55,7 +54,7 @@ buildvariants: - matrix_name: "mongo-recent" matrix_spec: ruby: <%= recent_rubies %> - mongodb-version: <%= actual_and_upcoming_mdb %> + mongodb-version: <%= latest_stable_mdb %> topology: <%= topologies %> os: ['rhel8'] # There is no latest for ubuntu2204, so we can't test it here. From af2e925e8a9d36a5095ce02c5189a480354875a8 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Tue, 20 Jun 2023 16:34:23 -0600 Subject: [PATCH 2/5] Revert "let's not run 2.18-stable specs against MDB 7+" Meant to do this on a branch :/ This reverts commit 1f3f7c76655b10803087ba24274bacf7c3468eec. --- .evergreen/config.yml | 4 ++-- .evergreen/config/standard.yml.erb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 23b1cb8897..cc3dc63305 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1063,7 +1063,7 @@ buildvariants: matrix_spec: auth-and-ssl: ["auth-and-ssl", "noauth-and-nossl"] ruby: "ruby-3.2" - mongodb-version: "6.0" + mongodb-version: ["latest", "7.0", "6.0"] topology: ["standalone", "replica-set", "sharded-cluster"] os: rhel8 display_name: ${auth-and-ssl} ${ruby} ${topology} @@ -1073,7 +1073,7 @@ buildvariants: - matrix_name: "mongo-recent" matrix_spec: ruby: ["ruby-3.2", "ruby-3.1", "jruby-9.3"] - mongodb-version: "6.0" + mongodb-version: ["latest", "7.0", "6.0"] topology: ["standalone", "replica-set", "sharded-cluster"] os: ['rhel8'] # There is no latest for ubuntu2204, so we can't test it here. diff --git a/.evergreen/config/standard.yml.erb b/.evergreen/config/standard.yml.erb index 160d6c58de..8e56bcf887 100644 --- a/.evergreen/config/standard.yml.erb +++ b/.evergreen/config/standard.yml.erb @@ -35,6 +35,7 @@ latest_stable_mdb = "6.0".inspect # so it gets quoted as a string # A few of the most recent MongoDB versions + actual_and_upcoming_mdb = %w( latest 7.0 6.0 ) recent_mdb = %w( 6.0 5.3 ) latest_5x_mdb = "5.3".inspect # so it gets quoted as a string %> @@ -44,7 +45,7 @@ buildvariants: matrix_spec: auth-and-ssl: ["auth-and-ssl", "noauth-and-nossl"] ruby: <%= latest_ruby %> - mongodb-version: <%= latest_stable_mdb %> + mongodb-version: <%= actual_and_upcoming_mdb %> topology: <%= topologies %> os: rhel8 display_name: ${auth-and-ssl} ${ruby} ${topology} @@ -54,7 +55,7 @@ buildvariants: - matrix_name: "mongo-recent" matrix_spec: ruby: <%= recent_rubies %> - mongodb-version: <%= latest_stable_mdb %> + mongodb-version: <%= actual_and_upcoming_mdb %> topology: <%= topologies %> os: ['rhel8'] # There is no latest for ubuntu2204, so we can't test it here. From 432dcaeab6f62c74b51b9781bbec2da809be72f6 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Mon, 10 Jul 2023 14:49:08 -0600 Subject: [PATCH 3/5] remove dead comments, and permit bson5 for these specs --- spec/mongo/protocol/msg_spec.rb | 63 +-------------------------------- 1 file changed, 1 insertion(+), 62 deletions(-) diff --git a/spec/mongo/protocol/msg_spec.rb b/spec/mongo/protocol/msg_spec.rb index 9c28da0196..23a4f41d1b 100644 --- a/spec/mongo/protocol/msg_spec.rb +++ b/spec/mongo/protocol/msg_spec.rb @@ -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 @@ -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 @@ -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 From 2a6598a41944a71f55a6b8a3cefe73e1b83a9cc3 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Mon, 10 Jul 2023 14:52:02 -0600 Subject: [PATCH 4/5] name the bson matrix appropriately --- .evergreen/config.yml | 2 +- .evergreen/config/standard.yml.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index cc3dc63305..c8d8ade9dc 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -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" diff --git a/.evergreen/config/standard.yml.erb b/.evergreen/config/standard.yml.erb index 8e56bcf887..4549f31ef2 100644 --- a/.evergreen/config/standard.yml.erb +++ b/.evergreen/config/standard.yml.erb @@ -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" From 829816e2fe5480fb62fca59114d1e716f564190b Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Mon, 10 Jul 2023 15:37:04 -0600 Subject: [PATCH 5/5] fix duplicate variant names --- .evergreen/config.yml | 2 +- .evergreen/config/standard.yml.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index c8d8ade9dc..27a1ab0ed2 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -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" diff --git a/.evergreen/config/standard.yml.erb b/.evergreen/config/standard.yml.erb index 4549f31ef2..67e2a92686 100644 --- a/.evergreen/config/standard.yml.erb +++ b/.evergreen/config/standard.yml.erb @@ -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"