77 pull_request :
88 workflow_dispatch :
99
10+ env :
11+ replsetSrcConnStr : mongodb://localhost:27020,localhost:27021,localhost:27022
12+ replsetDstConnStr : mongodb://localhost:27030,localhost:27031,localhost:27032
13+ shardedSrcConnStr : mongodb://localhost:27020
14+ shardedDstConnStr : mongodb://localhost:27030
15+
1016jobs :
1117 basics :
1218 strategy :
1319 fail-fast : false
1420 matrix :
1521 include :
22+ # NB: This is the only setup we’re supporting with 4.0.
23+ - mongodb_versions : [ '4.0', '8.0' ]
24+ topology : replset
1625
1726 # Testing fallback when `hello` isn’t implemented
1827 # (but appendOplogNote is).
1928 - mongodb_versions : [ '4.2.5', '6.0' ]
20- topology :
21- name : replset
22- srcConnStr : mongodb://localhost:27020,localhost:27021,localhost:27022
23- dstConnStr : mongodb://localhost:27030,localhost:27031,localhost:27032
29+ topology : replset
2430
2531 exclude :
2632 - mongodb_versions : [ '4.2', '4.2' ]
@@ -31,13 +37,16 @@ jobs:
3137 toHashedIndexKey : true
3238 - mongodb_versions : [ '4.2', '6.0' ]
3339 toHashedIndexKey : true
40+ - mongodb_versions : [ '4.2', '8.0' ]
41+ toHashedIndexKey : true
3442
3543 # versions are: source, destination
3644 mongodb_versions :
3745 - [ '4.2', '4.2' ]
3846 - [ '4.2', '4.4' ]
3947 - [ '4.2', '5.0' ]
4048 - [ '4.2', '6.0' ]
49+ - [ '4.2', '8.0' ]
4150
4251 - [ '4.4', '4.4' ]
4352 - [ '4.4', '5.0' ]
@@ -61,26 +70,15 @@ jobs:
6170 toHashedIndexKey : [true, false]
6271
6372 topology :
64- - name : replset
65- srcConnStr : mongodb://localhost:27020,localhost:27021,localhost:27022
66- dstConnStr : mongodb://localhost:27030,localhost:27031,localhost:27032
67-
68- - name : replset-to-sharded
69- dstArgs : --sharded 2
70- srcConnStr : mongodb://localhost:27020,localhost:27021,localhost:27022
71- dstConnStr : mongodb://localhost:27030
72-
73- - name : sharded
74- srcArgs : --sharded 2
75- dstArgs : --sharded 2
76- srcConnStr : mongodb://localhost:27020
77- dstConnStr : mongodb://localhost:27030
73+ - replset
74+ - replset-to-sharded
75+ - sharded
7876
7977 # Ubuntu 24 lacks OpenSSL 1.1.1’s libcrypto, which pre-v6 MongoDB
8078 # versions need.
8179 runs-on : ubuntu-22.04
8280
83- name : ${{ matrix.mongodb_versions[0] }} to ${{ matrix.mongodb_versions[1] }}, ${{ matrix.topology.name }}${{ matrix.toHashedIndexKey && ', hashed doc compare' || '' }}
81+ name : ${{ matrix.mongodb_versions[0] }} to ${{ matrix.mongodb_versions[1] }}, ${{ matrix.topology }}${{ matrix.toHashedIndexKey && ', hashed doc compare' || '' }}
8482
8583 steps :
8684 - run : uname -a
@@ -95,11 +93,12 @@ jobs:
9593 with :
9694 go-version : stable
9795
96+ # Use an old pymongo so we can install MongoDB 4.0.
9897 - name : Install m and mtools
9998 run : |-
10099 {
101100 echo npm install -g m
102- echo pipx install 'mtools[all]'
101+ echo pip install pymongo==4.10.1 'mtools[all]'
103102 } | parallel
104103
105104 - name : Install MongoDB ${{ matrix.mongodb_versions[0] }} (source)
@@ -115,15 +114,17 @@ jobs:
115114 run : |-
116115 {
117116 echo ./build.sh
118- echo mlaunch init --binarypath $(cat .srcpath) --port 27020 --dir src --replicaset ${{ matrix.topology.srcArgs }}
119- echo mlaunch init --binarypath $(cat .dstpath) --port 27030 --dir dst --replicaset ${{ matrix.topology.dstArgs }}
117+ echo mlaunch init --binarypath $(cat .srcpath) --port 27020 --dir src --replicaset ${{ ( matrix.topology == 'sharded') && '--sharded 2' || '' }}
118+ echo mlaunch init --binarypath $(cat .dstpath) --port 27030 --dir dst --replicaset ${{ ( matrix.topology == 'sharded' || matrix.topology == 'replset-to-sharded') && '--sharded 2' || '' }}
120119 echo mlaunch init --binarypath $(cat .metapath) --port 27040 --dir meta --replicaset --nodes 1
121120 } | parallel
122121
123122 - name : Test
124123 run : go test -v ./... -race
125124 env :
126125 MVTEST_DOC_COMPARE_METHOD : ${{matrix.toHashedIndexKey && 'toHashedIndexKey' || ''}}
127- MVTEST_SRC : ${{matrix.topology.srcConnStr}}
128- MVTEST_DST : ${{matrix.topology.dstConnStr}}
126+
127+ MVTEST_SRC : ${{ (matrix.topology == 'sharded') && env.shardedSrcConnStr || env.replsetSrcConnStr }}
128+ MVTEST_DST : ${{ (matrix.topology == 'sharded' || matrix.topology == 'replset-to-sharded') && env.shardedDstConnStr || env.replsetDstConnStr }}
129+
129130 MVTEST_META : mongodb://localhost:27040
0 commit comments