Skip to content

RUBY-2870 Test driver against bson master and 4-stable #2406

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 6 commits into from
Jan 19, 2022
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
6 changes: 5 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,11 @@ axes:
display_name: min
variables:
BSON: min

- id: 4-stable
display_name: 4-stable
variables:
BSON: 4-stable

- id: storage-engine
display_name: Storage Engine
values:
Expand Down
8 changes: 6 additions & 2 deletions .evergreen/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ set_env_vars() {
if test "$BSON" = min; then
export BUNDLE_GEMFILE=gemfiles/bson_min.gemfile
elif test "$BSON" = master; then
export MONGO_RUBY_DRIVER_BSON_MASTER=1
export BUNDLE_GEMFILE=gemfiles/bson_master.gemfile
elif test "$BSON" = 4-stable; then
export BUNDLE_GEMFILE=gemfiles/bson_4-stable.gemfile
elif test "$COMPRESSOR" = snappy; then
export BUNDLE_GEMFILE=gemfiles/snappy_compression.gemfile
elif test "$COMPRESSOR" = zstd; then
Expand All @@ -59,17 +62,18 @@ set_env_vars() {
bundle_install() {
args=--quiet

if test "$BSON" = master; then
if test "$BSON" = master || test "$BSON" = 4-stable; then
# In Docker bson is installed in the image, remove it if we need bson master.
gem uni bson || true
fi

# On JRuby we can test against bson master but not in a conventional way.
# See https://jira.mongodb.org/browse/RUBY-2156
if echo $RVM_RUBY |grep -q jruby && test "$BSON" = master; then
if echo $RVM_RUBY |grep -q jruby && (test "$BSON" = master || test "$BSON" = 4-stable); then
unset BUNDLE_GEMFILE
git clone https://github.com/mongodb/bson-ruby
(cd bson-ruby &&
git checkout "origin/$BSON" &&
bundle install &&
rake compile &&
gem build *.gemspec &&
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/bson_4-stable.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source "https://rubygems.org"
gemspec path: '..'

gem 'bson', git: 'https://github.com/mongodb/bson-ruby', branch: '4-stable'

require_relative './standard'

standard_dependencies
2 changes: 1 addition & 1 deletion gemfiles/bson_master.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"
gemspec path: '..'

gem 'bson', git: 'https://github.com/mongodb/bson-ruby', branch: '4-stable'
gem 'bson', git: 'https://github.com/mongodb/bson-ruby', branch: 'master'

require_relative './standard'

Expand Down
10 changes: 8 additions & 2 deletions mongo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ Gem::Specification.new do |s|
s.bindir = 'bin'

s.required_ruby_version = ">= 2.5"

s.add_dependency 'bson', '>=4.13.0', '<5.0.0'

# For testing driver against bson master we need to depend on bson < 6.0.0
# but in release version we want to depend on bson < 5.0.0.
if %w(1 yes true).include?(ENV['MONGO_RUBY_DRIVER_BSON_MASTER'])
s.add_dependency 'bson', '>=4.13.0', '<6.0.0'
else
s.add_dependency 'bson', '>=4.13.0', '<5.0.0'
end
end