Skip to content

Commit ded6ced

Browse files
MONGOID-5599 Test on multiple mongoses (#5871)
1 parent dc52d0e commit ded6ced

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ axes:
427427
display_name: Sharded Cluster
428428
variables:
429429
TOPOLOGY: "sharded-cluster"
430-
SINGLE_MONGOS: true
431430

432431
- id: "auth"
433432
display_name: Authentication

.evergreen/config/axes.yml.erb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ axes:
5454
display_name: Sharded Cluster
5555
variables:
5656
TOPOLOGY: "sharded-cluster"
57-
SINGLE_MONGOS: true
5857

5958
- id: "auth"
6059
display_name: Authentication

.evergreen/run-tests.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ fi
9393

9494
export BUNDLE_GEMFILE
9595

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

98103
set +e
99104
if test -n "$TEST_CMD"; then

spec/integration/shardable_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
describe 'Sharding helpers' do
88
require_topology :sharded
9+
min_server_version '4.4'
910

1011
describe 'shard_collection rake task' do
1112
let(:shard_collections) do

spec/support/expectations.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
module Mongoid
55
module Expectations
6-
76
def connection_class
87
if defined?(Mongo::Server::ConnectionBase)
98
Mongo::Server::ConnectionBase
@@ -14,6 +13,9 @@ def connection_class
1413
end
1514

1615
def expect_query(number)
16+
if %i[ sharded load-balanced ].include?(ClusterConfig.instance.topology) && number > 0
17+
skip 'This spec requires replica set or standalone topology'
18+
end
1719
rv = nil
1820
RSpec::Mocks.with_temporary_scope do
1921
if number > 0

0 commit comments

Comments
 (0)