Skip to content

Commit f6a3ccb

Browse files
author
dalyd
committed
Merge branch 'develop'
2 parents 94fb5bb + 0ff14b3 commit f6a3ccb

File tree

2 files changed

+64
-26
lines changed

2 files changed

+64
-26
lines changed

testcases/pipelines.js

+49-12
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,19 @@ function populatorGenerator(isView, nDocs, indices, docGenerator) {
104104
* @param {function} [options.post=drop] - A function run after the test completes, intended to
105105
* clean up any state on the server it may have created during setup or execution. If 'pipeline'
106106
* uses more than one collection, this will need to drop the other collection(s) involved.
107-
* @param {Boolean} [options.noRegression=false] - If true, do not include this test in the
108-
* regression suite.
109107
*/
110108
function generateTestCase(options) {
111109
var isView = true; // Constant for use when calling populatorGenerator().
112110
var nDocs = options.nDocs || 500;
113111
var pipeline = options.pipeline;
114112
var tags = options.tags || [];
115-
if (options.noRegression !== true) {
116-
tags.push("regression");
117-
}
113+
118114
if (pipeline.length > 0 && !pipeline[pipeline.length - 1].hasOwnProperty("$out")) {
119115
pipeline.push({$skip: 1e9});
120116
}
121117

122118
tests.push({
123-
tags: ["aggregation"].concat(tags),
119+
tags: ["aggregation", "regression"].concat(tags),
124120
name: "Aggregation." + options.name,
125121
pre: (options.pre !== undefined) ? options.pre(!isView) : populatorGenerator(!isView,
126122
nDocs,
@@ -142,7 +138,7 @@ function generateTestCase(options) {
142138
]
143139
});
144140
tests.push({
145-
tags: ["views", "aggregation_identityview"].concat(tags),
141+
tags: ["views", "aggregation_identityview", "regression"].concat(tags),
146142
name: "Aggregation.IdentityView." + options.name,
147143
pre: (options.pre !== undefined) ? options.pre(isView) : populatorGenerator(isView,
148144
nDocs,
@@ -759,12 +755,9 @@ generateTestCase({
759755

760756
generateTestCase({
761757
name: "UnwindThenGroup",
762-
// TODO (PERF-805): When the throughput of this test has improved, re-tag it back into the
763-
// regression suite.
764-
noRegression: true,
765-
docGenerator: function simpleUnwindDocGenerator(i) {
758+
docGenerator: function simpleUnwindLargeDocGenerator(i) {
766759
var largeArray = [];
767-
for (var j = 0; j < 1000; j++) {
760+
for (var j = 0; j < 50; j++) {
768761
largeArray.push(getStringOfLength(10) + j);
769762
}
770763
return {
@@ -775,3 +768,47 @@ generateTestCase({
775768
},
776769
pipeline: [{$unwind: "$array"}, {$group: {_id: "$array", count: {$sum: 1}}}]
777770
});
771+
772+
generateTestCase({
773+
name: "UnwindThenMatch",
774+
docGenerator: function simpleUnwindAndMatchDocGenerator(i) {
775+
var valArray = [];
776+
for (var j = 0; j < 30; j++) {
777+
valArray.push(j%10);
778+
}
779+
return {
780+
_id: i,
781+
array: valArray,
782+
smallString: getStringOfLength(10)
783+
};
784+
},
785+
pipeline: [{$unwind: "$array"}, {$match: {array: 5}}]
786+
});
787+
788+
/**
789+
* Data population function used by 'UnwindThenSort' and 'UnwindThenSkip' tests. Geared towards
790+
* unwind tests that require/benefit from small documents.
791+
*/
792+
function simpleSmallDocUnwindGenerator(i) {
793+
var valArray = [];
794+
for (var j = 0; j < 10; j++) {
795+
valArray.push(getStringOfLength(10) + j);
796+
}
797+
return {
798+
_id: i,
799+
array: valArray,
800+
smallString: getStringOfLength(10)
801+
};
802+
}
803+
804+
generateTestCase({
805+
name: "UnwindThenSort",
806+
docGenerator: simpleSmallDocUnwindGenerator,
807+
pipeline: [{$unwind: "$array"}, {$sort: {array: -1}}]
808+
});
809+
810+
generateTestCase({
811+
name: "UnwindThenSkip",
812+
docGenerator: simpleSmallDocUnwindGenerator,
813+
pipeline: [{$unwind: "$array"}, {$skip: 10}]
814+
});

testcases/simple_insert.js

+15-14
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,6 @@ var docs = []
116116
for (var i = 0; i < batchSize; i++) {
117117
docs.push(doc)
118118
}
119-
/*
120-
* Setup:
121-
* Test: Insert a vector of large documents. Each document contains a long string
122-
* Notes: Generates the _id field on the client
123-
*
124-
*/
125-
tests.push( { name: "Insert.LargeDocVector",
126-
tags: ['insert','regression'],
127-
pre: function( collection ) { collection.drop(); },
128-
ops: [
129-
{ op: "insert",
130-
doc: docs }
131-
] } );
132-
133119

134120

135121
/*
@@ -259,3 +245,18 @@ tests.push( { name: "InsertIndexedStringsNonSimpleCollation",
259245
ops: [
260246
{ op: "insert", doc: { a: { "#RAND_STRING": [10] } } }
261247
] } );
248+
249+
/*
250+
* Setup:
251+
* Test: Insert a vector of large documents. Each document contains a long string
252+
* Notes: Generates the _id field on the client
253+
*
254+
*/
255+
tests.push( { name: "Insert.LargeDocVector",
256+
tags: ['insert','regression'],
257+
pre: function( collection ) { collection.drop(); },
258+
ops: [
259+
{ op: "insert",
260+
doc: docs }
261+
] } );
262+

0 commit comments

Comments
 (0)