Ottoman Testing with SDK 4.0
The plan is to get Ottoman over Node.js SDK 4.1 which will release this month, as a step towards getting Ottoman updated it will be good to start testing Ottoman with SDK 4.0, a release with SDK 4.0 is not recommended at this time, this is just a proactive measure to get us to SDK 4.1 in May.
Tested it out with 4.0; everything worked well with a few minor changes:
/src/ottoman/ottoman.ts:
- removed
NoopTracerandNoopMeterfrom the import statement (from Couchbase) - removed lines 241-247, which appears to have been a temporary solution to a segfault that is hopefully fixed in 4.0
/src/couchbase.ts:
- removed
RequestSpanfrom the exports
Additionally, the connection string parameter to ignore TLS verification was renamed from ssl=no_verify to tls_verify=none in v4.0 (I believe this is due to the change to couchbase++). Connections to TLS-enabled clusters (like Capella) will either need the root certificate passed in with the connection or ?tls_verify=none at the end of the connection string.
I wrote a quick tutorial with a bit more info if needed: https://developer.couchbase.com/tutorial-nodejs-tls-connection
An update after running the test suite against Ottoman built with Node.js SDK 4.0:
Local/On Prem cluster (Docker)
- Initially I got a few errors claiming certain features were unsupported in my version of Couchbase
- Pulling the latest image from docker seemed to fix that issue, and all tests passed reliably afterwards
Capella
- After updating
testData.jsandjest.setup.tsto accommodate a Capella connection, most tests passed with several exceptions:model-crud.spec.ts- In test 'UserModel keyGeneratorDelimiter at Instance Level' a new Ottoman instances is created using a connection string, which is not yet documented for 4.0. This results in an
UnambiguousTimeout, See last bullet for more detail.
- In test 'UserModel keyGeneratorDelimiter at Instance Level' a new Ottoman instances is created using a connection string, which is not yet documented for 4.0. This results in an
ensure_collections_and_indexes.spec.ts- Fails to create bucket, several
UnambiguousTimeout, then fails to drop bucket - This is likely due to Capella not supporting bucket/scope/collection creation via the SDK on trial clusters (or so I've heard)
- I have not yet tested on a paid cluster but plan to do so later today once I have access
- Fails to create bucket, several
indexes.spec.ts- Fails to upsert the design document in
Testing indexes
- Fails to upsert the design document in
errors-name.spec.ts- Fails to upsert the design document in
Indexes -> BuildIndexQueryError
- Fails to upsert the design document in
nested-model-key.spec.ts- Tests in this file fail intermittently and were only observed once
- The failures were
UnambiguousTimeoutand failure to read collections
ottoman-instances.spec.ts- Several tests from this file fail (
UnambiguousTimeout) because it attempts to spawn multiple instances of Ottoman in various ways. - For the instance it creates using an object to pass connection params, updating the object params in the
instance3.connect()call to match the Capella details fixes the issue. - For the instances it creates using a connection string, it appears 4.0 does not currently have documentation for using connection strings (as they changed significantly). See more: https://docs.couchbase.com/nodejs-sdk/current/howtos/managing-connections.html#connection-strings
- Several tests from this file fail (