couchdb-python icon indicating copy to clipboard operation
couchdb-python copied to clipboard

config has moved in 2.0.0

Open geppettodivacin opened this issue 7 years ago • 4 comments

Although it is undocumented, the new location for /_config (at least for a server running locally) is /_node/couchdb@localhost/_config. If there is a cluster set up, each individual node gets its own config address. As such, running server.config() here produces an error. Maybe adding an extra, optional node argument would be the best solution.

geppettodivacin avatar Jun 22 '17 14:06 geppettodivacin

I'm not running 2.0 yet and probably won't be any time soon, so I can't easily work on this. However, I'm happy to review a patch if you can come up with one. It should probably include a test.

djc avatar Jun 25 '17 11:06 djc

I see that you've got couchdb in services in your travis config. I assume that's CouchDB 1.6.x, so we can't test it by running it against the actual CouchDB server. What kind of test would you expect?

geppettodivacin avatar Jun 28 '17 18:06 geppettodivacin

Just a unit test that's automatically skipped when running on CouchDB < 2.0. That way, at least everyone who runs CouchDB-2.0 will get to test the new behavior.

djc avatar Jun 29 '17 07:06 djc

I used two of my machines to try to run unit tests on 2.0.0, and many of the tests fail, and it also hangs on one of the tests in the middle. Unfortunately, thanks to the halting problem, it doesn't print any output to tell me which one is hanging. I'll go back later and try to see if I can figure out which of these tests fail and which hangs.

On that note, however: I believe there's already a unit test that covers getting the config. It looks to me like a few try to get the config, which would cause a failure in 2.0.0: test_init_with_resources, test_init_with_session, test_server_vars, and test_view_function_objects. Would a new unit test (one that just gets the config) be worthwhile? Or should we just keep the current unit tests that do other things, in addition to getting the config?

geppettodivacin avatar Jul 05 '17 13:07 geppettodivacin