couchdb-couch.git
6 years agoCreate md5 etag for _local docs local-docs-2978 159/head 257/head
Garren Smith [Thu, 7 Apr 2016 14:06:31 +0000 (16:06 +0200)] 
Create md5 etag for _local docs

This makes a unique ETAG for _local docs, so that they are cached
correctly, and fetched again when the document changes.

fixes COUCHDB-2978

6 years agoRevert "Merge remote branch 'github/pr/158'"
ILYA Khlopotov [Thu, 7 Apr 2016 17:50:54 +0000 (10:50 -0700)] 
Revert "Merge remote branch 'github/pr/158'"

This reverts commit 05b40a8ef7e544b1313018d000f0c6d3d6255f1a, reversing
changes made to c256ef5d098dce5b9624e117dab912205334c327.

6 years agoMerge remote branch 'github/pr/158'
ILYA Khlopotov [Thu, 7 Apr 2016 16:35:26 +0000 (09:35 -0700)] 
Merge remote branch 'github/pr/158'

This closes #158

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
6 years agoFix normalize_dbname to work with slashes 158/head
ILYA Khlopotov [Wed, 30 Mar 2016 22:02:52 +0000 (15:02 -0700)] 
Fix normalize_dbname to work with slashes

We shouldn't rely on dbname being the last part of path. Since database
name could include slashes.
normalize_dbname as the name suggests should accept either binary or
list and return only binary.

6 years agoAdd capability for compaction on local update 157/head
Benjamin Bastian [Wed, 30 Mar 2016 03:06:41 +0000 (20:06 -0700)] 
Add capability for compaction on local update

Prior to this commit, there was no functionality for a custom compactor
to know if the local database had been updated. This commit adds a
local_updated event, which will inform custom compactors when the local
tree has been updated.

6 years agoExplicity use the {minor_version, 1} option with term_to_binary when calculating... 156/head
Mike Fair [Thu, 24 Mar 2016 06:20:01 +0000 (23:20 -0700)] 
Explicity use the {minor_version, 1} option with term_to_binary when calculating the revision id.
This uses the 64-bit IEEE format for floats, making the binary representation consistent between OTP versions before and after 17.0.
This also makes it easier for third parties to replicate the md5 portion of the revision id calculation.

6 years agoMerge remote branch 'github/pr/154'
ILYA Khlopotov [Tue, 22 Mar 2016 12:35:03 +0000 (05:35 -0700)] 
Merge remote branch 'github/pr/154'

This closes #154

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
6 years agoUse couch_tests:setup/1 154/head
ILYA Khlopotov [Thu, 17 Mar 2016 17:58:26 +0000 (10:58 -0700)] 
Use couch_tests:setup/1

6 years agoUse couch_tests applications for couch_db_plugin_tests
ILYA Khlopotov [Thu, 17 Mar 2016 17:43:43 +0000 (10:43 -0700)] 
Use couch_tests applications for couch_db_plugin_tests

6 years agoFix log_response 153/head
Eric Avdey [Wed, 16 Mar 2016 19:45:00 +0000 (16:45 -0300)] 
Fix log_response

After recent refactoring `log_response/2` can also receive
an unencoded JSON as part of the error message.

6 years agoMerge remote branch 'github/pr/152'
ILYA Khlopotov [Wed, 16 Mar 2016 14:35:28 +0000 (07:35 -0700)] 
Merge remote branch 'github/pr/152'

This closes #152

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
6 years agoFix time:sleep -> timer:sleep typo 152/head
ILYA Khlopotov [Wed, 16 Mar 2016 14:05:27 +0000 (07:05 -0700)] 
Fix time:sleep -> timer:sleep typo

6 years agoMerge remote branch 'github/pr/151'
ILYA Khlopotov [Tue, 15 Mar 2016 19:29:37 +0000 (12:29 -0700)] 
Merge remote branch 'github/pr/151'

This closes #151

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
6 years agoFix incorrect use of eunit fixtures 151/head
ILYA Khlopotov [Mon, 14 Mar 2016 15:58:33 +0000 (08:58 -0700)] 
Fix incorrect use of eunit fixtures

6 years agoExtent fetch ddoc logic for view filtered changes feeds 148/head
Eric Avdey [Mon, 29 Feb 2016 20:11:12 +0000 (16:11 -0400)] 
Extent fetch ddoc logic for view filtered changes feeds

6 years agoMerge remote branch 'github/pr/150'
ILYA Khlopotov [Tue, 15 Mar 2016 17:33:57 +0000 (10:33 -0700)] 
Merge remote branch 'github/pr/150'

This closes #150

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
6 years agoPass unencoded JsonObj to before_request 150/head
ILYA Khlopotov [Thu, 10 Mar 2016 15:53:43 +0000 (07:53 -0800)] 
Pass unencoded JsonObj to before_request

It is much easier to write epi plugins if the object
it receives is not encoded yet.
So we pass unencoded JSON object to chttpd_plugin:before_response

COUCHDB-2966

6 years agoAdd chttpd_plugin:before_serve_file/5 EPI hook
ILYA Khlopotov [Tue, 8 Mar 2016 19:27:38 +0000 (11:27 -0800)] 
Add chttpd_plugin:before_serve_file/5 EPI hook

COUCHDB-2966

6 years agoIntroduce chttpd_plugin:before_response/4 EPI hook
ILYA Khlopotov [Tue, 8 Mar 2016 18:23:20 +0000 (10:23 -0800)] 
Introduce chttpd_plugin:before_response/4 EPI hook

COUCHDB-2966

6 years agoExtract handle_response function
ILYA Khlopotov [Tue, 8 Mar 2016 16:53:21 +0000 (08:53 -0800)] 
Extract handle_response function

COUCHDB-2966

6 years agoUse helper functions for headers generation
ILYA Khlopotov [Tue, 8 Mar 2016 16:29:58 +0000 (08:29 -0800)] 
Use helper functions for headers generation

Following functions were introduced:

 - add_headers/2
 - basic_headers/2
 - basic_headers_no_cors/2

COUCHDB-2966

6 years agoMerge remote-tracking branch 'github/pr/130'
Alexander Shorin [Mon, 14 Mar 2016 04:12:16 +0000 (07:12 +0300)] 
Merge remote-tracking branch 'github/pr/130'

6 years agoFix test function name
Alexander Shorin [Mon, 14 Mar 2016 03:08:33 +0000 (06:08 +0300)] 
Fix test function name

Thanks @alanning for the patch.

This closes #82

6 years agoRemove couch_stats_tests 130/head
Alexander Shorin [Thu, 26 Nov 2015 17:41:16 +0000 (20:41 +0300)] 
Remove couch_stats_tests

CouchDB 2.0 received completely new stats application which works
differently and requires completely different testing approach which
respects new features and folsom backend.

6 years agoIncrease timeout value to tolerate slow CI hosts
Alexander Shorin [Thu, 26 Nov 2015 17:10:05 +0000 (20:10 +0300)] 
Increase timeout value to tolerate slow CI hosts

6 years agoFix test suite name, remove broken tests guard
Alexander Shorin [Thu, 26 Nov 2015 17:07:05 +0000 (20:07 +0300)] 
Fix test suite name, remove broken tests guard

6 years agoUpdate db header now throws an database_disk_version_error error
Alexander Shorin [Thu, 26 Nov 2015 16:58:11 +0000 (19:58 +0300)] 
Update db header now throws an database_disk_version_error error

6 years ago Merge remote branch 'github/pr/138'
ILYA Khlopotov [Thu, 3 Mar 2016 20:03:01 +0000 (12:03 -0800)] 
Merge remote branch 'github/pr/138'

    This closes #138

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
6 years agoSuppress log of a response for clustered interface 138/head
ILYA Khlopotov [Thu, 3 Mar 2016 16:08:46 +0000 (08:08 -0800)] 
Suppress log of a response for clustered interface

COUCHDB-2945

6 years agoAdd send_response_no_cors/4
ILYA Khlopotov [Thu, 3 Mar 2016 15:45:58 +0000 (07:45 -0800)] 
Add send_response_no_cors/4

COUCHDB-2945

6 years agoUpdate test suite for CORS
ILYA Khlopotov [Tue, 9 Feb 2016 22:38:32 +0000 (14:38 -0800)] 
Update test suite for CORS

- Use definitions from chttpd_cors.hrl
- Do not depend on order of methods or headers returned in response.
- Extend list of allowed Exposed headers.

COUCHDB-2945

6 years agoRemove couch_http_cors in favor of chttpd_cors
ILYA Khlopotov [Tue, 9 Feb 2016 21:17:26 +0000 (13:17 -0800)] 
Remove couch_http_cors in favor of chttpd_cors

In order to avoid code duplication in http stack we remove
couch_http_cors. Vhosts support for CORS is moved into chttpd_cors.
The intend of this refactoring is to make sure we always call
couch_cors:headers for both chttpd and backdoor interface.

COUCHDB-2945

6 years ago Merge remote branch 'github/pr/145'
ILYA Khlopotov [Wed, 2 Mar 2016 20:36:57 +0000 (12:36 -0800)] 
Merge remote branch 'github/pr/145'

    - https://github.com/apache/couchdb-couch/pull/145

    This closes #145

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
6 years agoRemove configurable replicator db name 145/head
Nick Vatamaniuc [Fri, 26 Feb 2016 21:12:55 +0000 (16:12 -0500)] 
Remove configurable replicator db name

JIRA: COUCHDB-2954

6 years agoMerge remote-tracking branch 'github/pr/146'
Alexander Shorin [Sat, 27 Feb 2016 17:51:51 +0000 (20:51 +0300)] 
Merge remote-tracking branch 'github/pr/146'

6 years agoThrow errors from open_ddoc instead of failing on badmatch error. 146/head
Nick Vatamaniuc [Fri, 26 Feb 2016 23:07:51 +0000 (18:07 -0500)] 
Throw errors from open_ddoc instead of failing on badmatch error.

6 years agoMerge branch '2938-fix-5986-filtered-changes'
Russell Branca [Thu, 25 Feb 2016 23:46:24 +0000 (23:46 +0000)] 
Merge branch '2938-fix-5986-filtered-changes'

6 years agoOnly use fetch/ddoc_cache for clustered calls 2938-fix-5986-filtered-changes 144/head 250/head
Russell Branca [Thu, 25 Feb 2016 19:47:13 +0000 (19:47 +0000)] 
Only use fetch/ddoc_cache for clustered calls

6 years agoSend 400 error if 'count' sent to _uuid is not an integer 143/head
Eric Avdey [Tue, 23 Feb 2016 18:08:33 +0000 (14:08 -0400)] 
Send 400 error if 'count' sent to _uuid is not an integer

6 years agofix tarball build
Jan Lehnardt [Mon, 22 Feb 2016 11:22:57 +0000 (12:22 +0100)] 
fix tarball build

6 years agoMerge branch 'github/pr/139'
ILYA Khlopotov [Wed, 17 Feb 2016 02:06:58 +0000 (18:06 -0800)] 
Merge branch 'github/pr/139'

6 years agoComment out flaky test. 139/head
ILYA Khlopotov [Thu, 11 Feb 2016 18:31:50 +0000 (10:31 -0800)] 
Comment out flaky test.

While working on the issue test suite was re-enabled. It passes locally.
However one of the test cases fails in other environments so commenting out
that flaky test for now.

6 years agoPropagate db delete event to changes callback
ILYA Khlopotov [Thu, 11 Feb 2016 00:26:22 +0000 (16:26 -0800)] 
Propagate db delete event to changes callback

Not propagating the `delete` event to the changes callback causes
db to stay open when it is deleted in the presence of `continuous`
requests to _changes feed. This in its turn causes couch_file to stay
open until the connection is closed by the client.

6 years agoMerge remote-tracking branch 'github/pr/140'
ILYA Khlopotov [Wed, 17 Feb 2016 02:02:09 +0000 (18:02 -0800)] 
Merge remote-tracking branch 'github/pr/140'

6 years agoFix test_util:with_process_restart 140/head
ILYA Khlopotov [Mon, 15 Feb 2016 23:25:47 +0000 (15:25 -0800)] 
Fix test_util:with_process_restart

- The order of arguments is incorrect.
- Return the result of stop_sync from with_process_restart/3

6 years agoMerge remote-tracking branch 'github/pr/135'
ILYA Khlopotov [Tue, 16 Feb 2016 23:55:17 +0000 (15:55 -0800)] 
Merge remote-tracking branch 'github/pr/135'

6 years agoAdd couch_debug:opened_files/0 135/head
ILYA Khlopotov [Thu, 28 Jan 2016 21:17:42 +0000 (13:17 -0800)] 
Add couch_debug:opened_files/0

This function is for debugging purposes only. It iterates through all
open ports and returns file descriptor and filename correspondent to
every port.

6 years agoMerge remote-tracking branch 'github/pr/137'
Alexander Shorin [Tue, 16 Feb 2016 20:06:06 +0000 (23:06 +0300)] 
Merge remote-tracking branch 'github/pr/137'

6 years agoMerge branch '2938-use-ddoc-cache-in-filtered-changes'
Russell Branca [Wed, 10 Feb 2016 22:32:15 +0000 (22:32 +0000)] 
Merge branch '2938-use-ddoc-cache-in-filtered-changes'

6 years agoUse ddoc_cache and new fetch rpc format 2938-use-ddoc-cache-in-filtered-changes 134/head
Russell Branca [Thu, 21 Jan 2016 22:57:18 +0000 (22:57 +0000)] 
Use ddoc_cache and new fetch rpc format

6 years agoSend a real EventSource event for heartbeat 137/head
Damjan Georgievski [Fri, 2 May 2014 15:04:41 +0000 (17:04 +0200)] 
Send a real EventSource event for heartbeat

Bring back 845bf7529a3bc565d6446a7fa6cc5fd1a140653e

The EventSource connection can get stuck (in TCP half-open state*) and there's no way
for the client to detect that. This commit changes the way heartbeat is sent, instead of
sending a newline character, it sends an empty event of type heartbeat:

    event: heartbeat
    data:

This event doesn't have an id: field, so the client will retain its latest Last-Event-ID state.

This doesn't change the expectations of clients that used EventSource till now, because they
subscribe to the 'message' event type. To get the 'heartbeat' events a client will need to
explicitly subscribe to it:

    source.addEventListener('heartbeat', function () { /* cancel a timer that would otherwise reconnect the source */ });

* this can happen when you suspend your laptop, on flaky internet connection, ADSL reconnect,
bad wifi signals, bad routers etc. Pretty often in a typical internet usage nowadays.

6 years agoRemove lager and goldrush from default list of apps started by test_util:start_couch/2 126/head
Jay Doane [Fri, 6 Nov 2015 02:13:30 +0000 (18:13 -0800)] 
Remove lager and goldrush from default list of apps started by test_util:start_couch/2

Also, create a common list of default apps that is started and stopped consistently

COUCHDB-2872

6 years agoRewrite via query server 127/head
ermouth [Fri, 2 Oct 2015 10:58:05 +0000 (13:58 +0300)] 
Rewrite via query server

COUCHDB-2874

6 years agoExpose couch_js_functions to other apps
Robert Newson [Sun, 20 Dec 2015 18:14:35 +0000 (18:14 +0000)] 
Expose couch_js_functions to other apps

COUCHDB-2082

6 years agoFix syntax
Alexander Shorin [Sat, 19 Dec 2015 12:42:22 +0000 (15:42 +0300)] 
Fix syntax

6 years agoFind curl.h on FreeBSD
Robert Newson [Sat, 19 Dec 2015 12:29:07 +0000 (12:29 +0000)] 
Find curl.h on FreeBSD

6 years agoAlways send application/json response type 131/head
Robert Newson [Fri, 27 Nov 2015 16:53:58 +0000 (16:53 +0000)] 
Always send application/json response type

Modern browsers (I tested Firefox, Safari, Chrome) will render an
application/json response body as text in a fixed width font. This
ease of display motivated the text/plain vs application/json
negotiation.

It is now obsolete. Let's always send application/json content type.

COUCHDB-2905

6 years agoMerge remote-tracking branch 'github/pr/129'
Alexander Shorin [Tue, 24 Nov 2015 20:34:58 +0000 (23:34 +0300)] 
Merge remote-tracking branch 'github/pr/129'

6 years agoSimplify, and remove unnecessary code 129/head
Jay Doane [Sun, 22 Nov 2015 22:03:34 +0000 (14:03 -0800)] 
Simplify, and remove unnecessary code

COUCHDB-2898

6 years agoEnsure _global_changes exists
Jay Doane [Sun, 22 Nov 2015 19:01:04 +0000 (11:01 -0800)] 
Ensure _global_changes exists

Downstream builds automatically ensure _global_changes exists, so this commit works for both cases

COUCHDB-2898

6 years agoCreate and delete test db using HTTP API
Jay Doane [Sun, 22 Nov 2015 18:56:44 +0000 (10:56 -0800)] 
Create and delete test db using HTTP API

This supports downstream name munging that might occur

COUCHDB-2898

6 years agoExplicitly authorize test requests 128/head
Jay Doane [Sat, 21 Nov 2015 05:40:14 +0000 (21:40 -0800)] 
Explicitly authorize test requests

Create admin user and use its credentials for requests

Use http requests to create and delete test dbs to avoid potential db
name munging issues downstream

COUCHDB-2897

6 years agoImprove checks for db admin/member 29/head
Alexander Shorin [Tue, 6 Jan 2015 02:12:39 +0000 (05:12 +0300)] 
Improve checks for db admin/member

- Use lists:member/2 to check if user name is in list
- Throw forbidden error if user is authenticated on db membership check
- Normalize terminology readers vs members
- Make checks more Erlang-ish

COUCHDB-2534

6 years agoRun tests with only the couch_db_plugin_test couch_epi plugin 125/head
Jay Doane [Thu, 5 Nov 2015 21:42:05 +0000 (13:42 -0800)] 
Run tests with only the couch_db_plugin_test couch_epi plugin

These tests should only be run with the single couch_epi plugin defined by the test suite itself.
Also, only setup/teardown once for entire suite to improve performance.

COUCHDB-2868

6 years agoFix race condition in workqueue test. 124/head
Nick Vatamaniuc [Mon, 19 Oct 2015 06:05:46 +0000 (02:05 -0400)] 
Fix race condition in workqueue test.

Failure seen at least once in about 150 test runs:

```
Queue with max size of 160 bytes and 3 max items
 couch_work_queue_tests:143: should_have_no_items_for_new_queue...ok
**error:{assertEqual_failed,[{module,couch_work_queue_tests},
                     {line,210},
                     {expression,"couch_work_queue : item_count ( Q )"},
                     {expected,3},
                     {value,2}]}
```

From

```
should_block_producer_on_full_queue_count({Q, Producer, _}) ->
    ...
    produce(Q, Producer, 20, false),
    ?assertEqual(3, couch_work_queue:item_count(Q)),
```

Race condition is: telling Producer to produce, not waiting
for queue size to be updated, and then immediately checking
item_count.

To make failure occur reliably insert timer:sleep(10) in
producer_loop after ```Parent ! {item, Ref, Item}``` line.

The fix is to wait for queue size to be updated by using
the wait mode for produce function.

COUCHDB-2848

6 years agoMerge remote-tracking branch 'github/pr/123'
Alexander Shorin [Fri, 16 Oct 2015 15:57:41 +0000 (18:57 +0300)] 
Merge remote-tracking branch 'github/pr/123'

6 years agoStabilize os daemons test 123/head
Nick Vatamaniuc [Wed, 14 Oct 2015 18:04:20 +0000 (14:04 -0400)] 
Stabilize os daemons test

Increase delay timeout to fix this failure:

```
**error:{assertNotEqual,[{module,couchdb_os_daemons_tests},
                 {line,207},
                 {expression,"D # daemon . kill"},
                 {value,undefined}]}
```

So far noticed this failure once out of more than 100 runs.

6 years agoRemove deprecated functions
Alexander Shorin [Thu, 15 Oct 2015 20:16:36 +0000 (23:16 +0300)] 
Remove deprecated functions

6 years agoFix couch_httpd_multipart exports
Alexander Shorin [Thu, 15 Oct 2015 20:15:33 +0000 (23:15 +0300)] 
Fix couch_httpd_multipart exports

6 years agoAdd IS_OLD_RECORD macro
Paul J. Davis [Fri, 12 Dec 2014 20:25:38 +0000 (14:25 -0600)] 
Add IS_OLD_RECORD macro

This can be used in guards to detect if a state variable needs to be
upgraded. An example of it's use might be:

    handle_call(Msg, From, St) when ?IS_OLD_RECORD(St, #st{}) ->
        handle_call(Msg, From, upgrade_state(St));

This is useful for upgrading any of our various gen behaviors that
aren't properly supervised.

This closes #23

COUCHDB-2511

Signed-off-by: Alexander Shorin <kxepal@apache.org>
6 years agoFix warnings
Alexander Shorin [Thu, 15 Oct 2015 16:33:11 +0000 (19:33 +0300)] 
Fix warnings

6 years agoAdd license header
Alexander Shorin [Thu, 15 Oct 2015 11:29:14 +0000 (14:29 +0300)] 
Add license header

6 years agoMerge remote-tracking branch 'github/pr/19' into multipart
Alexander Shorin [Thu, 15 Oct 2015 11:28:08 +0000 (14:28 +0300)] 
Merge remote-tracking branch 'github/pr/19' into multipart

6 years agoUse couch_log for startup notifications 122/head
Alexander Shorin [Wed, 14 Oct 2015 16:46:35 +0000 (19:46 +0300)] 
Use couch_log for startup notifications

6 years agoStabilize couch_task_status_tests:run_multiple_tasks/0 test. 119/head
Nick Vatamaniuc [Tue, 13 Oct 2015 19:54:37 +0000 (15:54 -0400)] 
Stabilize couch_task_status_tests:run_multiple_tasks/0 test.

Previously, at the end of the test, it kills each status process
with call(Pid1, done), then immediately calls couch_task_status:all().

This caused a race between couch_task_status receiving the 'all'
call and the 'DOWN' message (from monitoring test processes). If
'DOWN' message came before 'all', test passed. If it came
after, it failed.

6 years agoIncrease EUnit test stability 118/head
Nick Vatamaniuc [Mon, 12 Oct 2015 13:59:56 +0000 (09:59 -0400)] 
Increase EUnit test stability

 * couchdb_1283 : suspend compaction process to reduce chance of
   race condition between it finishing and Writer3 process opening
   a database handle. Writer3 should fail because compactor should
   be keeping its handle.  (@Kxepal, thanks for the idea!)

 * In couchdb_1309, when waiting for view cleanup, test once,
   if fails due to race condition, wait a second and try again.

 * Increase wait time to wait for compactor to stabilize runs on
 slower machines.

COUCHDB-2848

6 years agoMerge branch 'add-filter-revs-limit'
Russell Branca [Mon, 12 Oct 2015 22:02:14 +0000 (22:02 +0000)] 
Merge branch 'add-filter-revs-limit'

6 years agoWhitespace and housekeeping
Russell Branca [Mon, 12 Oct 2015 19:26:30 +0000 (19:26 +0000)] 
Whitespace and housekeeping

6 years agoAdd specs to document validate_doc_update/5
Russell Branca [Mon, 12 Oct 2015 19:26:05 +0000 (19:26 +0000)] 
Add specs to document validate_doc_update/5

6 years agoAdd revs limit for docs passed to filter functions
Russell Branca [Tue, 29 Sep 2015 20:32:02 +0000 (20:32 +0000)] 
Add revs limit for docs passed to filter functions

The existing revs_limit logic only accounts for depth of individual
branches, and ignores the case where you have a lot of branches, for
instance when a doc is heavily conflicted. This patch truncates the list
of revs when passing docs to the JS filter functions, because given
enough revs this can cause the couchjs processes to explode.

6 years agoFix dialyzer crash
ILYA Khlopotov [Fri, 2 Oct 2015 17:57:48 +0000 (10:57 -0700)] 
Fix dialyzer crash

This closes #114

Signed-off-by: Alexander Shorin <kxepal@apache.org>
6 years agoHandle view server crashing during test compile of view functions. 117/head
Nick Vatamaniuc [Thu, 8 Oct 2015 19:21:59 +0000 (15:21 -0400)] 
Handle view server crashing during test compile of view functions.

Due to how libmozjs185 library is compiled on Ubuntu 12.04, given
invalid JS code, it will not return with expected error result:

 ["error","compilation_error",...]

but will crash. Otherwise library seems functional --  it passes
all other mrview tests.

Handle this crash in try_compile() function as a compilation
failure. Error message contains the exit status of the view process
to help debugging.

6 years agoThrow if parse_revs is not a list 116/head
Robert Newson [Thu, 8 Oct 2015 12:12:09 +0000 (13:12 +0100)] 
Throw if parse_revs is not a list

COUCHDB-2845

6 years agoFix status match for document create/update
Alexander Shorin [Thu, 8 Oct 2015 11:24:38 +0000 (14:24 +0300)] 
Fix status match for document create/update

CouchDB 2.0 returns 201 or 202 depending on the situation.

6 years agoRemove assertNotMatch macro
Alexander Shorin [Tue, 6 Oct 2015 20:59:11 +0000 (23:59 +0300)] 
Remove assertNotMatch macro

6 years agoExport couch_server:delete_file for reuse 115/head
ILYA Khlopotov [Tue, 6 Oct 2015 15:12:59 +0000 (08:12 -0700)] 
Export couch_server:delete_file for reuse

6 years agoMerge remote-tracking branch 'cloudant/simplify_couch_epi'
Robert Newson [Thu, 1 Oct 2015 15:06:49 +0000 (16:06 +0100)] 
Merge remote-tracking branch 'cloudant/simplify_couch_epi'

6 years agoFix "initialization from incompatible pointer type" warning for icu drv 113/head
Alexander Shorin [Thu, 1 Oct 2015 14:12:01 +0000 (17:12 +0300)] 
Fix "initialization from incompatible pointer type" warning for icu drv

It was caused by using ErlDrvSSizeT type instead of ErlDrvSizeT. It
was not an issue prior to R15 when ErlDrvSSizeT and ErlDrvSizeT where
basically int's.

Since we raised minimal Erlang release requirement up to R16B03-1,
there is no reason to maintain compatibility with pre-R15 for driver
so local COUCH_* types are replaced with ErlDrv* ones.

6 years agoRemove round for create/delete database for 1000 times 112/head
Alexander Shorin [Wed, 30 Sep 2015 17:55:45 +0000 (20:55 +0300)] 
Remove round for create/delete database for 1000 times

6 years agoProperly escape Location: HTTP header
Samuel Tardieu [Sat, 25 Apr 2015 22:10:04 +0000 (00:10 +0200)] 
Properly escape Location: HTTP header

Non-ASCII characters in the "Location:" header must be URL-encoded. This
can happen if a document is inserted with a user-defined "_id"
containing non-ASCII characters or if a filename contains non-ASCII
characters.

Fixes COUCHDB-2673

6 years agoMerge remote-tracking branch 'cloudant/25815-couch-stream-io-priority'
Robert Newson [Thu, 1 Oct 2015 10:16:42 +0000 (11:16 +0100)] 
Merge remote-tracking branch 'cloudant/25815-couch-stream-io-priority'

6 years agoInherit io_priority from the process creating the stream 105/head
Levi McAuley [Mon, 28 Sep 2015 22:20:18 +0000 (15:20 -0700)] 
Inherit io_priority from the process creating the stream

COUCHDB-2828
BugzID: 25815

6 years agoIntegrate with Travis CI 90/head
Alexander Shorin [Sun, 23 Aug 2015 09:59:20 +0000 (12:59 +0300)] 
Integrate with Travis CI

6 years agoFix chttpd port usage 111/head
Alexander Shorin [Wed, 30 Sep 2015 17:41:53 +0000 (20:41 +0300)] 
Fix chttpd port usage

6 years agoAdd license header
Alexander Shorin [Wed, 30 Sep 2015 17:40:56 +0000 (20:40 +0300)] 
Add license header

6 years agoFix task status unit test dependency 110/head
Nick Vatamaniuc [Wed, 30 Sep 2015 17:16:39 +0000 (13:16 -0400)] 
Fix task status unit test dependency

It depends on couch_log to be running. Otherwise it
throw this error:

```
unexpected termination of test process*
::{{badmatch,undefined},
   [{couch_log,debug,2,[{file,"src/couch_log.erl"},{line,32}]},
    {couch_task_status,handle_cast,2,
                       [{file,"src/couch_task_status.erl"},{line,137}]},
```

And only 6 out of 11 tests are run.

COUCHDB-2832

6 years agoFix OS Daemons test dependency. 109/head
Nick Vatamaniuc [Wed, 30 Sep 2015 14:37:20 +0000 (10:37 -0400)] 
Fix OS Daemons test dependency.

In isolation was failing in configuration_reader_test_
Because fixtures/os_daemon_configer.escript was
requesting uuids.algorithm from config application,
which was not set up.

COUCHDB-2831

6 years agoFix tests for 8bbfba7 commit 106/head
Alexander Shorin [Tue, 29 Sep 2015 13:44:23 +0000 (16:44 +0300)] 
Fix tests for 8bbfba7 commit

6 years agoTurn couch_doc_json_tests into unit tests
Alexander Shorin [Tue, 29 Sep 2015 13:42:18 +0000 (16:42 +0300)] 
Turn couch_doc_json_tests into unit tests

There are two issues:
1. There is no any reason to start server instance to ensure that we
accepts valid decoded JSON objects and throw right errors on bad ones;
2. Tests get actually executed before setup/0 call

6 years agoEnsure clean teardown in os_daemons_test
Klaus Trainer [Wed, 30 Sep 2015 13:37:39 +0000 (15:37 +0200)] 
Ensure clean teardown in os_daemons_test

We want to call `test_util:stop/1` at the end of the `os_daemons_test`
`teardown/2` function, so that we have a clean teardown without a
timeout exception being thrown.