summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Banala <arun.banala@mongodb.com>2021-08-27 14:23:14 +0100
committerArun Banala <arun.banala@mongodb.com>2021-08-31 13:50:43 +0100
commit3c6366dc2736373688b18cb127fa463036e0731c (patch)
treec5020848c5b36e07d9181f6ae29a2391a918f6cc
parent2e5dfc90df4e955eedc95be37e907f24eddf8fad (diff)
downloadmongo-3c6366dc2736373688b18cb127fa463036e0731c.tar.gz
SERVER-59640 [5.0] Add coverage for removed commands in views_all_commands.js test
-rw-r--r--jstests/core/views/views_all_commands.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/jstests/core/views/views_all_commands.js b/jstests/core/views/views_all_commands.js
index f3e54cda7f4..e7610971f18 100644
--- a/jstests/core/views/views_all_commands.js
+++ b/jstests/core/views/views_all_commands.js
@@ -70,6 +70,8 @@ load('jstests/sharding/libs/last_lts_mongod_commands.js');
// Pre-written reasons for skipping a test.
const isAnInternalCommand = "internal command";
const isUnrelated = "is unrelated";
+const wasRemovedInBinaryVersion50 =
+ "must define test coverage for the multiversion passthrough suite";
let viewsCommandTests = {
_addShard: {skip: isAnInternalCommand},
@@ -298,6 +300,7 @@ let viewsCommandTests = {
flushRouterConfig: {skip: isUnrelated},
fsync: {skip: isUnrelated},
fsyncUnlock: {skip: isUnrelated},
+ geoSearch: {skip: wasRemovedInBinaryVersion50},
getAuditConfig: {skip: isUnrelated},
getDatabaseVersion: {skip: isUnrelated},
getCmdLineOpts: {skip: isUnrelated},
@@ -344,9 +347,19 @@ let viewsCommandTests = {
getParameter: {skip: isUnrelated},
getShardMap: {skip: isUnrelated},
getShardVersion: {
- command: {getShardVersion: "test.view"},
- expectFailure: true,
- expectedErrorCode: ErrorCodes.NoShardingEnabled,
+ command: function(conn) {
+ // getShardVersion was updated to throw 'NoShardingEnabled' on v5.0, but in v4.4 the
+ // command would have succeeded. Ignore a 'NoShardingEnabled' error code so that the
+ // test passes in the mixed-version replica sets passthrough.
+ try {
+ assert.commandWorked(conn.adminCommand({getShardVersion: "test.view"}));
+ } catch (e) {
+ if (e.code == ErrorCodes.NoShardingEnabled) {
+ return;
+ }
+ throw e;
+ }
+ },
isAdminCommand: true,
skipSharded: true, // mongos is tested in views/views_sharded.js
},
@@ -489,6 +502,7 @@ let viewsCommandTests = {
replSetTestEgress: {skip: isUnrelated},
replSetUpdatePosition: {skip: isUnrelated},
replSetResizeOplog: {skip: isUnrelated},
+ resetError: {skip: wasRemovedInBinaryVersion50},
reshardCollection: {
command: {reshardCollection: "test.view", key: {_id: 1}},
setup: function(conn) {
@@ -537,6 +551,7 @@ let viewsCommandTests = {
expectFailure: true,
isAdminCommand: true,
},
+ shardConnPoolStats: {skip: wasRemovedInBinaryVersion50},
shardingState: {skip: isUnrelated},
shutdown: {skip: isUnrelated},
sleep: {skip: isUnrelated},
@@ -581,6 +596,7 @@ let viewsCommandTests = {
testVersion2: {skip: isAnInternalCommand},
testVersions1And2: {skip: isAnInternalCommand},
top: {skip: "tested in views/views_stats.js"},
+ unsetSharding: {skip: wasRemovedInBinaryVersion50},
update: {command: {update: "view", updates: [{q: {x: 1}, u: {x: 2}}]}, expectFailure: true},
updateRole: {
command: {