diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 88355ad8d5..f804a21de8 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -427,7 +427,6 @@ axes: display_name: Sharded Cluster variables: TOPOLOGY: "sharded-cluster" - SINGLE_MONGOS: true - id: "auth" display_name: Authentication diff --git a/.evergreen/config/axes.yml.erb b/.evergreen/config/axes.yml.erb index 15fa4f4870..e654086105 100644 --- a/.evergreen/config/axes.yml.erb +++ b/.evergreen/config/axes.yml.erb @@ -54,7 +54,6 @@ axes: display_name: Sharded Cluster variables: TOPOLOGY: "sharded-cluster" - SINGLE_MONGOS: true - id: "auth" display_name: Authentication diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index b48d881f40..ff5f5c1a3f 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -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 diff --git a/spec/integration/shardable_spec.rb b/spec/integration/shardable_spec.rb index 111083bd48..bfec7baaa7 100644 --- a/spec/integration/shardable_spec.rb +++ b/spec/integration/shardable_spec.rb @@ -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 diff --git a/spec/support/expectations.rb b/spec/support/expectations.rb index fc6d5254e6..30084a6a0d 100644 --- a/spec/support/expectations.rb +++ b/spec/support/expectations.rb @@ -3,7 +3,6 @@ module Mongoid module Expectations - def connection_class if defined?(Mongo::Server::ConnectionBase) Mongo::Server::ConnectionBase @@ -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