Skip to content

Commit 96d6d3a

Browse files
committed
added minor test fixes
1 parent 65ccd28 commit 96d6d3a

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"dependencies": {
1616
"es6-promise": "3.2.1",
1717
"mongodb-core": "2.0.10",
18+
"mongodb-core": "christkv/mongodb-core#2.0",
1819
"readable-stream": "2.1.5"
1920
},
2021
"devDependencies": {

test/functional/promote_values_tests.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,40 @@ exports['should correctly honor promoteValues at cursor level'] = {
110110
});
111111
}
112112
}
113+
114+
exports['should correctly honor promoteValues at cursor find level'] = {
115+
// Add a tag that our runner can trigger on
116+
// in this case we are setting that node needs to be higher than 0.10.X to run
117+
metadata: { requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } },
118+
119+
// The actual test we wish to run
120+
test: function(configuration, test) {
121+
var Long = configuration.require.Long,
122+
Int32 = configuration.require.Int32,
123+
Double = configuration.require.Double,
124+
MongoClient = configuration.require.MongoClient;
125+
126+
MongoClient.connect(configuration.url(), {
127+
}, function(err, db) {
128+
db.collection('shouldCorrectlyHonorPromoteValues').insert({
129+
doc: Long.fromNumber(10)
130+
, int: 10
131+
, double: 2.2222
132+
, array: [[Long.fromNumber(10)]]
133+
}, function(err, doc) {
134+
test.equal(null, err);
135+
136+
db.collection('shouldCorrectlyHonorPromoteValues').find({}, {}, {promoteValues: false}).next(function(err, doc) {
137+
test.equal(null, err);
138+
139+
test.deepEqual(Long.fromNumber(10), doc.doc);
140+
test.deepEqual(new Int32(10), doc.int);
141+
test.deepEqual(new Double(2.2222), doc.double);
142+
143+
db.close();
144+
test.done();
145+
});
146+
});
147+
});
148+
}
149+
}

test/functional/sharding_failover_tests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,14 @@ exports.shouldCorrectlyConnectToMongoSShardedSetupAndKillTheMongoSProxy = {
135135
// Wait for the ha process to pick up the existing new server
136136
setTimeout(function() {
137137
test.equal(2, mongos.connections().length);
138-
138+
global.debug = false
139139
// // Kill the mongos proxy
140140
// manager.remove('mongos', {index: 1}, function(err, serverDetails2) {
141141
proxies[1].stop().then(function() {
142142
// Attempt another insert
143143
collection.insert({test:3}, {w:1}, function(err, result) {
144144
test.equal(null, err);
145+
global.debug = false
145146
test.equal(1, mongos.connections().length);
146147

147148
// Restart the other mongos

0 commit comments

Comments
 (0)