-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
131 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ lib-cov | |
pids | ||
logs | ||
results | ||
node-mongodb-native | ||
|
||
node_modules | ||
npm-debug.log | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"author": "Christian Kvalheim <christkv@10gen.com> (http://www.christiankvalheim.com)", | ||
"name": "mongodb-node-regression-benchmarks", | ||
"description": "Performance regression tests for node.js mongodb driver", | ||
"version": "0.0.1", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/christkv/mongodb-node-regression-benchmarks.git" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"nodeunit": "0.7.4" | ||
}, | ||
"scripts": { "test" : "node run.js" }, | ||
"optionalDependencies": {}, | ||
"engines": { | ||
"node": "*" | ||
}, | ||
"licenses" : [ { "type" : "Apache License, Version 2.0", | ||
"url" : "http://www.apache.org/licenses/LICENSE-2.0" } ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var spawn = require('child_process').spawn; | ||
|
||
// | ||
// Run the test suite multiple times, one for the 0.9.8.X, 0.9.9.X and 1.0.X, and master | ||
// | ||
|
||
// Start by fetch the git repo, the run the tests on different tags + master | ||
//https://github.com/mongodb/node-mongodb-native | ||
var fetchGitRepo = function(branch, callback) { | ||
// Remove the directory if it exists | ||
var rm = spawn("rm", ["-rf", "./node-mongodb-native"]); | ||
rm.on("exit", function() { | ||
// Set up git repo command | ||
var git = spawn("git", ["clone", "https://github.com/mongodb/node-mongodb-native.git"]); | ||
git.stdout.on("data", function (data) { process.stdout.write(data); }); | ||
git.stderr.on("data", function (data) { process.stdout.write(data); }); | ||
|
||
// Execute the git fetch command | ||
git.on("exit", function() { | ||
// Let's switch the tag | ||
git = spawn("git", ["--exec-path=./node-mongodb-native", "--git-dir=./node-mongodb-native/.git", "checkout", branch]); | ||
git.stdout.on("data", function (data) { process.stdout.write(data); }); | ||
git.stderr.on("data", function (data) { process.stdout.write(data); }); | ||
// Execute the git fetch command | ||
git.on("exit", function() { | ||
callback(); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
var executeBenchmarks = function(branch, callback) { | ||
// We fetch a git repository | ||
} | ||
|
||
// Fetch the git repo | ||
fetchGitRepo("V0.9.8", function() { | ||
// Execute benchmarks against a specific tag or branch | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
var mongodb = process.env['TEST_NATIVE'] != null ? require('../lib/mongodb').native() : require('../lib/mongodb').pure(); | ||
var useSSL = process.env['USE_SSL'] != null ? true : false; | ||
var native_parser = (process.env['TEST_NATIVE'] != null); | ||
|
||
/*! | ||
* Module dependencies. | ||
*/ | ||
var testCase = require('nodeunit').testCase, | ||
nodeunit = require('nodeunit'), | ||
Db = mongodb.Db, | ||
Cursor = mongodb.Cursor, | ||
Collection = mongodb.Collection, | ||
Server = mongodb.Server; | ||
|
||
var MONGODB = 'integration_tests'; | ||
var client = null; | ||
|
||
/** | ||
* Retrieve the server information for the current | ||
* instance of the db client | ||
* | ||
* @ignore | ||
*/ | ||
exports.setUp = function(callback) { | ||
var self = exports; | ||
client = new Db(MONGODB, new Server("127.0.0.1", 27017, {auto_reconnect: true, poolSize: 4, ssl:useSSL}), {native_parser: (process.env['TEST_NATIVE'] != null)}); | ||
client.open(function(err, db_p) { | ||
if(numberOfTestsRun == (Object.keys(self).length)) { | ||
// If first test drop the db | ||
client.dropDatabase(function(err, done) { | ||
callback(); | ||
}); | ||
} else { | ||
return callback(); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Retrieve the server information for the current | ||
* instance of the db client | ||
* | ||
* @ignore | ||
*/ | ||
exports.tearDown = function(callback) { | ||
var self = this; | ||
numberOfTestsRun = numberOfTestsRun - 1; | ||
// Close connection | ||
client.close(); | ||
callback(); | ||
} | ||
|
||
/** | ||
* Should insert 1000 documents and then fetch it back around 10000 times to calculate performance | ||
* | ||
* @ignore | ||
*/ | ||
exports.shouldExerciseToArrayFunctionOnQueries = function(test) { | ||
test.done(); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|