diff --git a/.gitignore b/.gitignore index dab24e0..2b6b111 100755 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ deploy/bin/ .dist/ .out/ .extdep/ +test/correctness/dist/ +test/correctness/local/ +certs/ upsert_test.csv packages/ diff --git a/src/ExtCmd.actor.cpp b/src/ExtCmd.actor.cpp index 580529a..d53d5c9 100644 --- a/src/ExtCmd.actor.cpp +++ b/src/ExtCmd.actor.cpp @@ -697,23 +697,23 @@ struct BuildInfoCmd { static Future> call(Reference ec, Reference query, Reference reply) { - reply->addDocument(BSON("version" - << EXT_SERVER_VERSION - << "gitVersion" - << "" - << "OpenSSLVersion" - << "" - << "sysInfo" - << "" - << "loaderFlags" - << "" - << "compilerFlags" - << "" - << "allocator" - << "" - << "versionArray" << BSON_ARRAY(2 << 4 << 10) << "javascriptEngine" - << "" - << "bits" << 64 << "debug" << false << "maxBsonObjectSize" << 16777216 << "ok" << 1.0)); + // clang-format off + reply->addDocument(BSON( + "version" << EXT_SERVER_VERSION << + "gitVersion" << "" << + "OpenSSLVersion" << "" << + "sysInfo" << "" << + "loaderFlags" << "" << + "compilerFlags" << "" << + "allocator" << "" << + "versionArray" << BSON_ARRAY(2 << 4 << 10) << + "javascriptEngine" << "" << + "bits" << 64 << + "debug" << false << + "maxBsonObjectSize"<< 16777216 << + "ok" << 1.0 + )); + // clang-format on return reply; } }; @@ -1278,6 +1278,14 @@ struct ListIndexesCmd { indexList << indexObj; } + // Add the _id index here + indexList << BSON("name" + << "_id_" + << "ns" << (msg->ns.first + "." + msg->ns.second) << "key" << BSON("_id" << 1) + << "metadata version" << 1 << "status" + << "ready" + << "unique" << true); + // FIXME: Not using cursors to return collection list. reply->addDocument(BSON( // clang-format off @@ -1288,7 +1296,6 @@ struct ListIndexesCmd { "ok" << 1.0 // clang-format on )); - return reply; } catch (Error& e) { if (e.code() != error_code_actor_cancelled) { diff --git a/test/correctness/smoke/test_basic_flow.py b/test/correctness/smoke/test_basic_flow.py index 8fa9254..011d0f9 100644 --- a/test/correctness/smoke/test_basic_flow.py +++ b/test/correctness/smoke/test_basic_flow.py @@ -28,6 +28,11 @@ def test_simple_coll_index(fixture_collection): # Create an index collection.create_index('a', name='idx_a') + # Check the returned index by listindex command contains the primay one + indexes = collection.index_information() + + assert '_id_' in indexes, "Returned list of indexes by listIndex command does not contains the primary index _id_" + # Insert bunch of documents docs = [] for i in range(1, 50):