|
The test plan for this feature is "Unknown" according to the spec, although it mentions that some test coverage is be enabled by the Connection String spec tests (will be verified separately in CXX-1270).
This feature is mostly delegated to the C driver, though the C++ driver has a minimal amount of integration logic. I manually verified with mongocxx master (68b400a) and server 3.4.2 that the client metadata was correctly transmitted, and that the server logs indicated that the required client metadata sections were all present.
This was the program I used for manual verification:
TEST_CASE("CXX-1268") {
|
instance::current();
|
|
client mongodb_client{uri{"mongodb://localhost/?appName=myApp"}};
|
database db = mongodb_client["test"];
|
|
std::string collname{"mongo_cxx_driver"};
|
collection coll = db[collname];
|
coll.insert_one({});
|
}
|
And this was the observed output:
2017-05-15T16:27:40.858-0700 I NETWORK [conn576] received client metadata from 127.0.0.1:57857 conn576: { application: { name: "myApp" }, driver: { name: "mongoc / mongocxx", version: "1.7.0-dev / 3.1.1-pre" }, os: { type: "Darwin", name: "macOS", version: "14.1.0", architecture: "x86_64" }, platform: "cfg=0x280e9 posix=200112 stdc=201112 CC=clang 7.0.2 (clang-700.1.81) CFLAGS="" LDFLAGS=""" }
|
It would be helpful (but not necessary to comply with the spec) that we have automated test coverage for this feature, so I've opened CXX-1340 to track the addition of two basic tests.
One potential point of confusion about the way that this feature works in the C++ driver is that the "platform" section (see observed output above) contains build information about the compiler and flags used for building the C driver – a user could mistakenly think that this compiler and these flags were used for building the C++ driver. david.golden, do you think this is worth making code changes to improve?
|