Merge lp:~adiroiban/couchdb-glib/couchdb-test-setup into lp:couchdb-glib
| Status: | Merged |
|---|---|
| Approved by: | Rodrigo Moya on 2010-04-09 |
| Approved revision: | 180 |
| Merge reported by: | Rodrigo Moya |
| Merged at revision: | not available |
| Proposed branch: | lp:~adiroiban/couchdb-glib/couchdb-test-setup |
| Merge into: | lp:couchdb-glib |
| Diff against target: |
95 lines (+64/-2) 3 files modified
tests/Makefile.am (+31/-2) tests/config/couchdb-auth.ini (+29/-0) tests/test-couchdb-glib.c (+4/-0) |
| To merge this branch: | bzr merge lp:~adiroiban/couchdb-glib/couchdb-test-setup |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Rodrigo Moya (community) | 2010-04-06 | Approve on 2010-04-09 | |
|
Review via email:
|
|||
Commit Message
Add setUp and tearDown of CouchDB server for couchdb-glib tests.
Description of the Change
= Bug 556671 =
When running the couchdb-glib tests, the testsuite should setUp and tearDown the an empty
couchdb server
== Proposed fix ==
Before running the couchdb-glib test, the Makefile should first setup and empty CouchDB used just for testing and when the test are done to tear down the server.
== Implementation details ==
The new server is using the configuration from tests/config/
It is using a predefined username/password and hostname/port_nr.
I have also fixed the name used for creating a new database since UUID can start with a number, while couchdb db names not.
Maybe we should change the port_nr used for testing to not be the default port.
| Adi Roiban (adiroiban) wrote : | # |
Hi,
Sorry for pushing this bad branch.
In my initial test it looks like couchdb can create the var folder if it not there. This is true, but it does not create the parent.
This is fixed.
Maybe we can move the functionality of starting and stoping a testing couchdb server in a different script.
What do you say?
I was thinking of adding extra configuration for also testing basic http and oauth authentication.
I'm stoppping the couchdb server before desktopcouch-glib, since desktopcouch will use the user server anyway.
For starting a testing desktopcouch server, we need to shut down the current one and change the dbus config to start our server.
- 180. By Adi Roiban on 2010-04-09
-
Delete pid file. Create an empty var folder before starting the couchdb server.
| Rodrigo Moya (rodrigo-moya) wrote : | # |
Works great now! But I think that, given that we are starting a new couchdb instance, shouldn't we use a different port than 5984, which is the one used by the system wide couchdb instance?

hmm, doesn't seem to work for me:
$ cd tests var/couchdb. stdout
$ make test
Setting up the couchdb server...
Apache CouchDB needs write permission on the STDOUT file: ../tests/
make: *** [test] Error 1
Also, I think we should do the cleanup after running the tests, that is, what there is in stop-couchdb rule should go after running test-desktopcou ch-glib
Anyway, this is a very needed branch, so thanks!