Skip to content

MONGOID-5599 Test on multiple mongoses #5871

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 5 commits into from
Sep 30, 2024
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
1 change: 0 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ axes:
display_name: Sharded Cluster
variables:
TOPOLOGY: "sharded-cluster"
SINGLE_MONGOS: true

- id: "auth"
display_name: Authentication
Expand Down
1 change: 0 additions & 1 deletion .evergreen/config/axes.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ axes:
display_name: Sharded Cluster
variables:
TOPOLOGY: "sharded-cluster"
SINGLE_MONGOS: true

- id: "auth"
display_name: Authentication
Expand Down
7 changes: 6 additions & 1 deletion .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ fi

export BUNDLE_GEMFILE

export MONGODB_URI="mongodb://localhost:27017/?appName=test-suite&$uri_options"
if test "$TOPOLOGY" = "sharded-cluster"; then
# We assume that sharded cluster has two mongoses
export MONGODB_URI="mongodb://localhost:27017,localhost:27018/?appName=test-suite&$uri_options"
else
export MONGODB_URI="mongodb://localhost:27017/?appName=test-suite&$uri_options"
fi

set +e
if test -n "$TEST_CMD"; then
Expand Down
1 change: 1 addition & 0 deletions spec/integration/shardable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

describe 'Sharding helpers' do
require_topology :sharded
min_server_version '4.4'

describe 'shard_collection rake task' do
let(:shard_collections) do
Expand Down
4 changes: 3 additions & 1 deletion spec/support/expectations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

module Mongoid
module Expectations

def connection_class
if defined?(Mongo::Server::ConnectionBase)
Mongo::Server::ConnectionBase
Expand All @@ -14,6 +13,9 @@ def connection_class
end

def expect_query(number)
if %i[ sharded load-balanced ].include?(ClusterConfig.instance.topology) && number > 0
skip 'This spec requires replica set or standalone topology'
end
rv = nil
RSpec::Mocks.with_temporary_scope do
if number > 0
Expand Down
Loading