Skip to content

Commit 8551a7f

Browse files
authored
RUBY-1853 Test server 3.6/4.0 + mmapv1 configurations in Evergreen (#1430)
* RUBY-1853 Test server 3.6/4.0 + mmapv1 configurations in Evergreen * Add a marker test for mmapv1 * Allow uri options to take priority over test defaults * Fix URI * Turn off read & write retries when running on mmapv1
1 parent 74d9a7a commit 8551a7f

19 files changed

+219
-6
lines changed

.evergreen/config.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ functions:
8787
export RETRY_WRITES=${RETRY_WRITES}
8888
export WITH_ACTIVE_SUPPORT="${WITH_ACTIVE_SUPPORT}"
8989
export SINGLE_MONGOS="${SINGLE_MONGOS}"
90+
export MMAPV1="${MMAPV1}"
9091
EOT
9192
# See what we've done
9293
cat expansion.yml
@@ -348,6 +349,16 @@ functions:
348349
${PREPARE_SHELL}
349350
MONGODB_URI="${MONGODB_URI}" .evergreen/run-tests.sh
350351
352+
"run tests via mlaunch":
353+
- command: shell.exec
354+
type: test
355+
params:
356+
shell: bash
357+
working_dir: "src"
358+
script: |
359+
${PREPARE_SHELL}
360+
MONGODB_URI="${MONGODB_URI}" .evergreen/run-tests-mlaunch.sh
361+
351362
"run local tls tests":
352363
- command: shell.exec
353364
type: test
@@ -488,6 +499,9 @@ tasks:
488499
- func: "bootstrap mongo-orchestration"
489500
- func: "run tests"
490501
#- func: "cleanup mo"
502+
- name: "test-mlaunch"
503+
commands:
504+
- func: "run tests via mlaunch"
491505
- name: "local-tls-tests"
492506
commands:
493507
- func: "run local tls tests"
@@ -675,7 +689,15 @@ axes:
675689
- id: "single-mongos"
676690
display_name: Single Mongos
677691
variables:
678-
SINGLE_MONGOS: true
692+
SINGLE_MONGOS: 'true'
693+
- id: storage-engine
694+
display_name: Storage Engine
695+
values:
696+
- id: mmapv1
697+
display_name: MMAPv1
698+
run_on: ubuntu1404-test
699+
variables:
700+
MMAPV1: 'true'
679701

680702

681703
buildvariants:
@@ -731,7 +753,7 @@ buildvariants:
731753
mongodb-version: ["4.2", latest]
732754
topology: "sharded-cluster"
733755
single-mongos: single-mongos
734-
display_name: "${mongodb-version} ${topology} ${auth-and-ssl} ${ruby}"
756+
display_name: "${mongodb-version} ${topology} single-mongos ${auth-and-ssl} ${ruby}"
735757
run_on:
736758
- rhel70-small
737759
tasks:
@@ -776,6 +798,19 @@ buildvariants:
776798
tasks:
777799
- name: "test"
778800

801+
-
802+
matrix_name: mmapv1
803+
matrix_spec:
804+
ruby: "ruby-2.6"
805+
mongodb-version: [3.6, 4.0]
806+
topology: '*'
807+
storage-engine: mmapv1
808+
display_name: "${mongodb-version} ${topology} mmapv1 ${ruby}"
809+
run_on:
810+
- rhel70-small
811+
tasks:
812+
- name: "test-mlaunch"
813+
779814
-
780815
matrix_name: "lint"
781816
matrix_spec:
@@ -883,7 +918,7 @@ buildvariants:
883918
ruby: "*"
884919
mongodb-version: ['4.0', '4.2']
885920
topology: standalone
886-
display_name: "Local TLS ${ruby}"
921+
display_name: "Local TLS ${mongodb-version} ${ruby}"
887922
run_on:
888923
- ubuntu1404-test
889924
tasks:

.evergreen/run-tests-mlaunch.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/bash
2+
3+
set -o xtrace # Write all commands first to stderr
4+
set -o errexit # Exit the script with error if any of the commands fail
5+
6+
# Supported/used environment variables:
7+
# AUTH Set to enable authentication. Values are: "auth" / "noauth" (default)
8+
# SSL Set to enable SSL. Values are "ssl" / "nossl" (default)
9+
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info)
10+
# TOPOLOGY Allows you to modify variables and the MONGODB_URI based on test topology
11+
# Supported values: "server", "replica_set", "sharded_cluster"
12+
# RVM_RUBY Define the Ruby version to test with, using its RVM identifier.
13+
# For example: "ruby-2.3" or "jruby-9.1"
14+
# DRIVER_TOOLS Path to driver tools.
15+
16+
. `dirname "$0"`/functions.sh
17+
18+
set_fcv
19+
set_env_vars
20+
21+
setup_ruby
22+
23+
install_deps
24+
25+
arch=ubuntu1404
26+
version=4.0.9
27+
prepare_server $arch $version
28+
29+
install_mlaunch
30+
31+
# Launching mongod under $MONGO_ORCHESTRATION_HOME
32+
# makes its long available through log collecting machinery
33+
34+
export dbdir="$MONGO_ORCHESTRATION_HOME"/db
35+
mkdir -p "$dbdir"
36+
37+
args="--setParameter enableTestCommands=1"
38+
args="$args --setParameter diagnosticDataCollectionEnabled=false"
39+
uri_options=
40+
if test "$TOPOLOGY" = replica_set; then
41+
args="$args --replicaset --name ruby-driver-rs"
42+
elif test "$TOPOLOGY" = sharded_cluster; then
43+
args="$args --replicaset --sharded 2 --name ruby-driver-rs"
44+
else
45+
args="$args --single"
46+
fi
47+
if test -n "$MMAPV1"; then
48+
args="$args --storageEngine mmapv1"
49+
uri_options="$uri_options&retryReads=false&retryWrites=false"
50+
fi
51+
mlaunch --dir "$dbdir" --binarypath "$BINDIR" $args
52+
53+
echo "Running specs"
54+
which bundle
55+
bundle --version
56+
57+
export MONGODB_URI="mongodb://localhost:27017/?serverSelectionTimeoutMS=30000$uri_options"
58+
bundle exec rake spec:prepare
59+
60+
export MONGODB_URI="mongodb://localhost:27017/?appName=test-suite$uri_options"
61+
bundle exec rake spec:ci
62+
test_status=$?
63+
echo "TEST STATUS"
64+
echo ${test_status}
65+
66+
kill_jruby
67+
68+
mlaunch stop --dir "$dbdir"
69+
70+
exit ${test_status}

spec/integration/change_stream_examples_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
describe 'change streams examples in Ruby' do
44
min_server_fcv '3.6'
55
require_topology :replica_set
6+
require_wired_tiger
67

78
let!(:inventory) do
89
client[:inventory]

spec/integration/change_stream_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
max_example_run_time 7
66
min_server_fcv '3.6'
77
require_topology :replica_set
8+
require_wired_tiger
89

910
let(:fail_point_base_command) do
1011
{ 'configureFailPoint' => "failCommand" }

spec/integration/command_monitoring_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
end
8080

8181
context 'when write concern is specified outside of command document' do
82+
require_wired_tiger
8283
require_topology :replica_set
8384
min_server_fcv '4.0'
8485

spec/integration/mmapv1_spec.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require 'spec_helper'
2+
3+
# This test is a marker used to verify that the test suite runs on
4+
# mmapv1 storage engine.
5+
describe 'mmapv1' do
6+
require_mmapv1
7+
8+
context 'standalone' do
9+
require_topology :single
10+
11+
it 'is exercised' do
12+
end
13+
end
14+
15+
context 'replica set' do
16+
require_topology :replica_set
17+
18+
it 'is exercised' do
19+
end
20+
end
21+
22+
context 'sharded' do
23+
require_topology :sharded
24+
25+
it 'is exercised' do
26+
end
27+
end
28+
end

spec/integration/retryable_writes_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
describe 'Retryable writes integration tests' do
1414
include PrimarySocket
1515

16+
require_wired_tiger_on_36
17+
1618
# These tests override server selector, which fails if there are multiple
1719
# eligible servers as would be the case in a multi-shard sharded cluster
1820
require_no_multi_shard

spec/integration/transactions_examples_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'spec_helper'
22

33
describe 'Transactions examples' do
4+
require_wired_tiger
45
require_transaction_support
56

67
let(:hr) do

spec/mongo/bulk_write_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,7 @@
18901890
end
18911891

18921892
context 'when retryable writes are supported' do
1893+
require_wired_tiger
18931894
min_server_fcv '3.6'
18941895
require_topology :replica_set, :sharded
18951896

spec/mongo/collection/view/change_stream_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'spec_helper'
22

33
describe Mongo::Collection::View::ChangeStream do
4+
require_wired_tiger
45
min_server_fcv '3.6'
56
require_topology :replica_set
67
max_example_run_time 7

0 commit comments

Comments
 (0)