Skip to content

Commit 90ec41c

Browse files
MONGOID-4657 Test against bson-master (#5255)
1 parent 5de9346 commit 90ec41c

File tree

6 files changed

+43
-1
lines changed

6 files changed

+43
-1
lines changed

.evergreen/config.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ axes:
484484
display_name: "BSON-min"
485485
variables:
486486
DRIVER: "bson-min"
487+
- id: bson-master
488+
display_name: "BSON-master"
489+
variables:
490+
DRIVER: "bson-master"
487491
- id: "rails"
488492
display_name: Rails Version
489493
values:
@@ -659,7 +663,7 @@ buildvariants:
659663

660664
- matrix_name: "bson-min"
661665
matrix_spec:
662-
driver: [min]
666+
driver: [bson-min]
663667
ruby: ["ruby-2.7"]
664668
mongodb-version: "5.0"
665669
topology: "standalone"
@@ -669,6 +673,19 @@ buildvariants:
669673
tasks:
670674
- name: "test"
671675

676+
- matrix_name: "bson-master"
677+
matrix_spec:
678+
driver: [bson-master]
679+
ruby: ["ruby-3.0"]
680+
mongodb-version: "5.0"
681+
topology: "standalone"
682+
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
683+
run_on:
684+
- ubuntu1804-small
685+
tasks:
686+
- name: "test"
687+
688+
672689
- matrix_name: "rails-6"
673690
matrix_spec:
674691
ruby: ["ruby-3.0"]

.evergreen/run-tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ elif test "$DRIVER" = "min"; then
6969
elif test "$DRIVER" = "bson-min"; then
7070
bundle install --gemfile=gemfiles/bson_min.gemfile
7171
BUNDLE_GEMFILE=gemfiles/bson_min.gemfile
72+
elif test "$DRIVER" = "bson-master"; then
73+
bundle install --gemfile=gemfiles/bson_master.gemfile
74+
BUNDLE_GEMFILE=gemfiles/bson_master.gemfile
7275
elif test "$DRIVER" = "stable-jruby"; then
7376
bundle install --gemfile=gemfiles/driver_stable_jruby.gemfile
7477
BUNDLE_GEMFILE=gemfiles/driver_stable_jruby.gemfile

gemfiles/bson_master.gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
source "https://rubygems.org"
2+
gemspec path: '..'
3+
4+
gem 'bson', git: "https://github.com/mongodb/bson-ruby"
5+
gem 'mongo'
6+
7+
gem 'actionpack'
8+
9+
gemspec path: '..'
10+
11+
require_relative './standard'
12+
13+
standard_dependencies

gemfiles/bson_min.gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ gem 'bson', '4.14.0'
66
# was released, current driver version was 2.17.0
77
gem 'mongo', '2.17.0'
88

9+
gem 'actionpack'
10+
11+
gemspec path: '..'
12+
913
require_relative './standard'
1014

1115
standard_dependencies

spec/mongoid/contextual/mongo_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@
572572
context 'when storing BigDecimal as decimal128' do
573573
config_override :map_big_decimal_to_decimal128, true
574574
min_bson_version '4.15.0'
575+
max_bson_version '4.99.99'
575576

576577
it "returns the non-demongoized distinct field values" do
577578
expect(context.distinct(:sales).sort).to eq([ BSON::Decimal128.new("1E2"), BSON::Decimal128.new("2E3") ])
@@ -796,6 +797,7 @@
796797
context "when legacy_pluck_distinct is set" do
797798
config_override :legacy_pluck_distinct, true
798799
config_override :map_big_decimal_to_decimal128, true
800+
max_bson_version '4.99.99'
799801

800802
it "returns the distinct matching fields" do
801803
expect(context.distinct("label.sales")).to eq([ BSON::Decimal128.new('1E+2') ])

spec/mongoid/criteria_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,7 @@
21762176

21772177
context 'when value is stored as decimal128' do
21782178
config_override :map_big_decimal_to_decimal128, true
2179+
max_bson_version '4.99.99'
21792180

21802181
it "does not demongoize the field" do
21812182
expect(plucked.first).to be_a(BSON::Decimal128)
@@ -2216,6 +2217,7 @@
22162217
context "when legacy_pluck_distinct is set" do
22172218
config_override :legacy_pluck_distinct, true
22182219
config_override :map_big_decimal_to_decimal128, true
2220+
max_bson_version '4.99.99'
22192221

22202222
it "returns a hash with a non-demongoized field" do
22212223
expect(plucked.first).to eq({ 'sales' => BSON::Decimal128.new('1E+2') })
@@ -2240,6 +2242,7 @@
22402242
context "when legacy_pluck_distinct is set" do
22412243
config_override :legacy_pluck_distinct, true
22422244
config_override :map_big_decimal_to_decimal128, true
2245+
max_bson_version '4.99.99'
22432246

22442247
it "returns a hash with a non-demongoized field" do
22452248
expect(plucked.first).to eq([{ 'sales' => BSON::Decimal128.new('1E+2') }])

0 commit comments

Comments
 (0)