Permalink
Browse files

Fixed up docs generation for all tests

  • Loading branch information...
1 parent 0806e52 commit d7bcfb2f7dc74d07053ce02dd724320b6e700f76 @christkv christkv committed Mar 13, 2013
Showing with 861 additions and 39 deletions.
  1. +38 −33 dev/tools/build-docs.js
  2. +21 −0 dev/tools/docs.js
  3. +36 −0 test/tests/authentication/authentication_replicaset_tests.js
  4. +6 −0 test/tests/authentication/authentication_tests.js
  5. +43 −3 test/tests/functional/admin_mode_tests.js
  6. +9 −0 test/tests/functional/aggregation_tests.js
  7. +42 −0 test/tests/functional/collection_tests.js
  8. +21 −0 test/tests/functional/command_generation_tests.js
  9. +12 −0 test/tests/functional/connection_pool_tests.js
  10. +2 −0 test/tests/functional/connection_tests.js
  11. +42 −0 test/tests/functional/cursor_tests.js
  12. +9 −0 test/tests/functional/cursorstream_tests.js
  13. +3 −0 test/tests/functional/custom_pk_tests.js
  14. +90 −0 test/tests/functional/db_tests.js
  15. +3 −1 test/tests/functional/error_tests.js
  16. +6 −0 test/tests/functional/exception_tests.js
  17. +18 −0 test/tests/functional/find_tests.js
  18. +3 −0 test/tests/functional/geo_tests.js
  19. +15 −0 test/tests/functional/gridstore/grid_tests.js
  20. +18 −0 test/tests/functional/gridstore/gridstore_file_tests.js
  21. +6 −0 test/tests/functional/gridstore/gridstore_stream_tests.js
  22. +51 −0 test/tests/functional/gridstore/gridstore_tests.js
  23. +9 −0 test/tests/functional/gridstore/readstream_tests.js
  24. +21 −0 test/tests/functional/index_tests.js
  25. +12 −0 test/tests/functional/insert_tests.js
  26. +3 −0 test/tests/functional/logging_tests.js
  27. +12 −0 test/tests/functional/mapreduce_tests.js
  28. +30 −0 test/tests/functional/mongo_reply_parser_tests.js
  29. +3 −0 test/tests/functional/multiple_db_tests.js
  30. +12 −0 test/tests/functional/objectid_tests.js
  31. +27 −0 test/tests/functional/raw_tests.js
  32. +6 −0 test/tests/functional/remove_tests.js
  33. +12 −1 test/tests/functional/unicode_tests.js
  34. +5 −1 test/tests/functional/uri_tests.js
  35. +39 −0 test/tests/functional/util_tests.js
  36. +24 −0 test/tests/functional/write_preferences_tests.js
  37. +7 −0 test/tests/repl_set/connecting_tests.js
  38. +6 −0 test/tests/repl_set/failover_query_tests.js
  39. +54 −0 test/tests/repl_set/read_preferences_tests.js
  40. +21 −0 test/tests/repl_set/reconnect_tests.js
  41. +9 −0 test/tests/repl_set/replicaset_examples_tests.js
  42. +2 −0 test/tests/sharded/mongoclient_tests.js
  43. +2 −0 test/tests/sharded/simple_tests.js
  44. +21 −0 test/tests/ssl/mongoclient_tests.js
  45. +30 −0 test/tests/ssl/ssl_validation_tests.js
@@ -28,39 +28,42 @@ var apiClasses = [
];
// All test files
-var testClasses = [
- {path:"./test/mongo_client_test.js"},
- {path:"./test/replicaset/mongo_client_test.js"},
- {path:"./test/sharded/mongo_client_test.js"},
- {path:"./test/admin_test.js"},
- {path:"./test/objectid_test.js"},
- {path:"./test/insert_test.js"},
- {path:"./test/remove_test.js"},
- {path:"./test/collection_test.js"},
- {path:"./test/db_test.js"},
- {path:"./test/find_test.js"},
- {path:"./test/map_reduce_test.js"},
- {path:"./test/index_test.js"},
- {path:"./test/geo_search_test.js"},
- {path:"./test/replicaset/connect_test.js"},
- {path:"./test/replicaset/read_preference_replicaset_test.js"},
- {path:"./test/sharded/simple_sharded_setup_test.js"},
- {path:"./test/connect_test.js"},
- {path:"./test/multiple_dbs_on_connection_pool_test.js"},
- {path:"./test/cursor_test.js"},
- {path:"./test/cursorstream_test.js"},
- {path:"./test/gridstore/grid_store_test.js"},
- {path:"./test/gridstore/grid_store_file_test.js"},
- {path:"./test/gridstore/grid_store_stream_test.js"},
- {path:"./test/gridstore/readstream_test.js"},
- {path:"./test/gridstore/grid_test.js"},
- {path:"./node_modules/bson/test/node/bson_array_test.js"},
- {path:"./node_modules/bson/test/node/bson_test.js"},
- {path:"./node_modules/bson/test/node/test_full_bson.js"},
- {path:"./node_modules/bson/test/node/bson_parser_comparision_test.js"},
- {path:"./node_modules/bson/test/node/bson_typed_array_test.js"},
- {path:"./test/aggregation_framework_test.js"}
- ]
+var testClasses = [];
+// Read in all the test files and create a testClasses collection
+var files = fs.readdirSync("./test/tests/functional");
+files.forEach(function(file) {
+ if(file.indexOf('.js') != -1) testClasses.push({path: "./test/tests/functional/" + file});
+})
+
+// Read all gridstore files
+files = fs.readdirSync("./test/tests/functional/gridstore");
+files.forEach(function(file) {
+ if(file.indexOf('.js') != -1) testClasses.push({path: "./test/tests/functional/gridstore/" + file});
+})
+
+// Read all replicaset files
+files = fs.readdirSync("./test/tests/repl_set");
+files.forEach(function(file) {
+ if(file.indexOf('.js') != -1) testClasses.push({path: "./test/tests/repl_set/" + file});
+})
+
+// Sharded tests
+files = fs.readdirSync("./test/tests/sharded");
+files.forEach(function(file) {
+ if(file.indexOf('.js') != -1) testClasses.push({path: "./test/tests/sharded/" + file});
+})
+
+// Authentication tests
+files = fs.readdirSync("./test/tests/authentication");
+files.forEach(function(file) {
+ if(file.indexOf('.js') != -1) testClasses.push({path: "./test/tests/authentication/" + file});
+})
+
+// SSL tests
+files = fs.readdirSync("./test/tests/ssl");
+files.forEach(function(file) {
+ if(file.indexOf('.js') != -1) testClasses.push({path: "./test/tests/ssl/" + file});
+})
// Read all the templates
var templates = [
@@ -106,6 +109,8 @@ var apiClasses2 = [
// Render the API docs
docs.renderAPIDocs(outputDirectory2, apiClasses2, testClasses, templates, {index_title:'Binary JSON API'});
+// process.exit(0)
+
// ----------------------------------------------------------------------------
// PROCESS MARKDOWN DOCUMENTS TO STRUCTURED TEXT
// ----------------------------------------------------------------------------
View
@@ -252,8 +252,29 @@ exports.buildTestHash = function(objects) {
for(var k = 0; k < codeLines.length; k++) {
codeLines[k] = codeLines[k].replace(/^ /, "")
}
+
+ // Start and end of example
+ var start = 0, end = codeLines.length;
+ var additional_lines = [];
+
+ // Locate DOC_START
+ for(var k = 0; k < codeLines.length; k++) {
+ if(codeLines[k].indexOf("DOC_START") != -1) start = k + 1;
+ if(codeLines[k].indexOf("DOC_END") != -1) end = k;
+ if(codeLines[k].indexOf("DOC_LINE") != -1) {
+ additional_lines.push(codeLines[k].split("DOC_LINE")[1].substr(1));
+ }
+ }
+
+ // console.log(codeLines)
+
+ codeLines = codeLines.slice(start, end);
+ codeLines = additional_lines.concat(codeLines);
// Reasign the code block
block.code = codeLines.join("\n");
+
+ // console.log("------------------------------------------- CODE")
+ // console.log(block.code)
}
}
}
@@ -1,6 +1,9 @@
var format = require('util').format
Step = require('step');
+/**
+ * @ignore
+ */
exports['Should correctly handle replicaset master stepdown and stepup without loosing auth'] = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server
@@ -38,6 +41,9 @@ exports['Should correctly handle replicaset master stepdown and stepup without l
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthenticateUsingPrimary = function(configuration, test) {
var Db = configuration.getMongoPackage().Db;
// connection string
@@ -62,6 +68,9 @@ exports.shouldCorrectlyAuthenticateUsingPrimary = function(configuration, test)
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthenticateWithTwoSeeds = function(configuration, test) {
var Db = configuration.getMongoPackage().Db;
// connection string
@@ -86,6 +95,9 @@ exports.shouldCorrectlyAuthenticateWithTwoSeeds = function(configuration, test)
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthenticateWithOnlySecondarySeed = function(configuration, test) {
var Db = configuration.getMongoPackage().Db;
// connection string
@@ -110,6 +122,9 @@ exports.shouldCorrectlyAuthenticateWithOnlySecondarySeed = function(configuratio
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthenticateWithMultipleLoginsAndLogouts = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server
@@ -237,6 +252,9 @@ exports.shouldCorrectlyAuthenticateWithMultipleLoginsAndLogouts = function(confi
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthenticate = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server
@@ -305,6 +323,9 @@ exports.shouldCorrectlyAuthenticate = function(configuration, test) {
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthenticateAndEnsureIndex = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server
@@ -373,6 +394,9 @@ exports.shouldCorrectlyAuthenticateAndEnsureIndex = function(configuration, test
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthenticateAndUseReadPreference = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server
@@ -412,6 +436,9 @@ exports.shouldCorrectlyAuthenticateAndUseReadPreference = function(configuration
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyBringReplicasetStepDownPrimaryAndStillReadFromSecondary = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server
@@ -475,6 +502,9 @@ exports.shouldCorrectlyBringReplicasetStepDownPrimaryAndStillReadFromSecondary =
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthWithSecondaryAfterKillPrimary = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server
@@ -543,6 +573,9 @@ exports.shouldCorrectlyAuthWithSecondaryAfterKillPrimary = function(configuratio
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthAgainstReplicaSetAdminDbUsingMongoClient = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server
@@ -590,6 +623,9 @@ exports.shouldCorrectlyAuthAgainstReplicaSetAdminDbUsingMongoClient = function(c
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthAgainstNormalDbUsingMongoClient = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server
@@ -1,5 +1,8 @@
var Step = require('step');
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthenticateWithHorribleBananaCode = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server;
@@ -110,6 +113,9 @@ exports.shouldCorrectlyAuthenticateWithHorribleBananaCode = function(configurati
});
}
+/**
+ * @ignore
+ */
exports.shouldCorrectlyAuthenticate = function(configuration, test) {
var Db = configuration.getMongoPackage().Db
, Server = configuration.getMongoPackage().Server;
Oops, something went wrong.

0 comments on commit d7bcfb2

Please sign in to comment.