summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Improve nouveau mango integrationRobert Newson2023-05-102-5/+49
| | | | | | 1) Fix sorting on strings and numbers 2) use 'string' type for string fields 3) use 'text' type for the default field
* remove Content-MD5 header supportRobert Newson2023-05-091-23/+0
| | | | Part of a series of changes to expunge MD5 entirely.
* finish partitioned support for nouveauRobert Newson2023-04-292-1/+74
|
* fix race condition when creating indexesRobert Newson2023-04-271-1/+0
|
* disable kenRobert Newson2023-04-271-0/+1
|
* capture warn/error in entiretyRobert Newson2023-04-271-0/+3
|
* enhance test diagnosticsRobert Newson2023-04-271-17/+22
|
* mango end-to-end tests for nouveauRobert Newson2023-04-272-1/+49
|
* Import nouveau (#4291)Robert Newson2023-04-223-0/+262
| | | Nouveau - a new (experimental) full-text indexing feature for Apache CouchDB, using Lucene 9. Requires Java 11 or higher (19 is preferred).
* Fix flaky elixir users_db_testsNick Vatamaniuc2023-03-041-2/+6
| | | | | | | | This fails more often on MacOS CI workers [1] but it seems to be a general flaky test as the users auth ddoc is not guaranteed to be inserted synchronously. [1] https://github.com/apache/couchdb/issues/4397#issue-1551336429
* Allow definition of JWT roles claim as comma-seperated list (#4431)Ronny Berndt2023-02-201-1/+39
| | | | Now it is possible to define a JWT roles claim as a comma-seperated list or as a JSON array of strings (the only allowed old behavior).
* Move elixir search tests to be with other elixir testsJay Doane2023-02-154-0/+508
| | | | | | Now that dreyfus is integrated into CouchDB, its elixir tests can be moved to be with the other elixir integration tests. As a bonus, remove some unnecessary configuration.
* Remove all javascript testsNick Vatamaniuc2023-02-089-2873/+0
| | | | | | | | | Most of them have been ported to Elixir except the two replication tests. Add the two replication tests to couch_replicator and remove the whole javascript subfolder. For the "replication_id" got a bit further and test that other fields are correctly replaced or ignored.
* Fix {eaddrnotavail} in elixir tests under WindowsRonny Berndt2022-12-212-3/+15
|
* add test coverage to prevent junk in eventsourceZach Lankton2022-09-152-0/+25
| | | | | | | | eventsource events should only ever contain data, id, event or empty lines adding a test to ensure that new code/changes will not break this rule
* Allow and evaluate nested json claim roles in JWT tokenRonny Berndt2022-08-301-0/+167
|
* Fix proxyauth_test and remove it from skipping tests (#4129)Ronny2022-08-082-68/+31
| | | | After reverting #4094, bringing this back as a seperate fix.
* Fix elixir :logger warningsRonny2022-07-281-1/+3
| | | | | Migrate deprecated config option variable to new config option for :logger application. Fixed `warning: :compile_time_purge_level option for the :logger application is deprecated, use :compile_time_purge_matching instead`.
* Revert "Replace SHA-1 with SHA-256 for cookie authentication (#4094)"Robert Newson2022-07-222-33/+70
| | | | This reverts commit daff65d8c8772c637eb60365d6e672543163a740.
* Fix the flaky tests for `create_doc()`jiahuili2022-07-191-2/+1
| | | | Add `retry_until()` to `create_doc()` to remove unstable tests.
* Replace SHA-1 with SHA-256 for cookie authentication (#4094)Ronny2022-07-182-70/+33
| | | | | * Replace Sha-1 with Sha-256 for cookie authentication * Fix proxyauth_test and remove it from skipping tests
* Fix flaky "validate doc update" elixir testNick Vatamaniuc2022-07-081-6/+7
| | | | | | | | We saw it fail quite a few times already so adding a retry around it. Unfortunately it could now fail with a timeout instead of an assert but since we're updating a document there is no idempotent way to testing it (retry until, then do the actual assert again below).
* Fix Elixir 13 compatibilityNick Vatamaniuc2022-06-304-4/+4
| | | | | | | | | | | | | | | | | | | | | Elixir 13 is the only one which seems to work with Erlang 25. But we can't use Elixir 13 because of a few compatibility issues so have to fix this. That involves upgrading credo. However, as soon as credo was upgraded it noticed a bunch of issues which also had to be fixed. Some of those were: * Enum.map + join should be Enum.map_join * Invalid module name in teardown `%___MODULE__` -> `%__MODULE__` * `Mix.Config` is deprecated, use `Config` * `db_test.ex` looks like a test module to credo, so renamed it, otherwise it has to have an .exs extension * ibrowse had to be compiled so it could be properly analysed Tested on macos (intel) with asdf installed elixir and erlang: ``` 25.0.1 / 1.13.4-otp-25 24.3.4.1 / 1.13.4-otp-24 23.3.4.14 / 1.10.4-otp-23 ```
* Backport commits from fdbmain into main (old 3.x)Ronny Berndt2022-06-235-10/+10
| | | | | Cherry-picked commits from 0156a55012b76adb652c11032596d9801c71665e Thx @kianmeng
* Fix ES{256,384,512} supportRobert Newson2022-05-251-1/+2
| | | | | | | | We forgot to transform the JOSE signature format to DER when verifying ES signatures (and the reverse when signing). Co-authored-by: Nick Vatamaniuc <vatamane@apache.org> Co-authored-by: Jay Doane <jaydoane@apache.org>
* Make sure to wait for the attachments to uploaded before responding to the userNick Vatamaniuc2022-05-181-5/+15
| | | | | | | | | | | If workers drop after when new_edits=false and revisions are already present, attachment parser will go into `mp_abort_parse_atts` state but still keep consuming the request data, draining the uploaded attachment data, which helps ensure the connection process will be in a consistent state and ready to process the next HTTP request. Add a test to PUT the same attachment multiple times with new_edits=false and check that those requests all succeed.
* Add an integration testAdam Kocoloski2022-05-182-1/+59
| | | | | | This doesn't actually work as you'd expect. The response for the new_edits=false request does return quickly, but the request body is never consumed and so the _next_ request on the wire will hang.
* avoid timestamps in elixir-suite design docs (cleanup)Will2022-03-311-5/+1
|
* avoid timestamps in elixir-suite design docsWill Young2022-03-301-7/+1
|
* View collation upgrade testsNick Vatamaniuc2022-02-111-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking a few scenarios: * _design/*/_info returns collation versions * A 2.x view can upgraded to have a view info map * A 3.2.1 view can be upgraded to have a view info map * A view with multiple collator versions: - Can be opened and tagged with the current libicu version - Can be queried, written to and then queried again - Will be submitted for compaction when open and on updates - After compaction the view will have only one collator version Includes two new fixture views: * Version 3.2.1 view without the view info map field * A view with a bogus (old) libicu version "1.1.1.1" The bogus libicu version view is generated by overriding the collation version API to return `[1, 1, 1, 1]` [1]. And it can be re-created with this snippet [2] [1] ``` update_collator_versions(#{} = ViewInfo) -> Versions = maps:get(ucol_vs, ViewInfo, []), - Ver = tuple_to_list(couch_ejson_compare:get_collator_version()), + % Ver = tuple_to_list(couch_ejson_compare:get_collator_version()), + Ver = [1, 1, 1, 1], ``` [2] `http` is the `httpie` command line HTTP client ``` http delete $DB/colltest1 && http put $DB/colltest1'?q=1' && http put $DB/colltest1/_design/colltest1ddoc views:='{"colltest1view":{"map":"function(doc){emit(doc.id, null);}"}}' && http put $DB/colltest1/d1 a=b && http put $DB/colltest1/d2 c=d ```
* Do not start test name with "test "Adam Kocoloski2022-01-202-2/+2
| | | | | | | | | | | | The code that generates suite.elixir will repreatedly strip the "test " from the name of the test when writing the file, resulting in a mismatch between the actual test name and what's in suite.elixir. You can see this by searching for e.g. COUCHDB-497 in the suite file. I tried using String.replace_prefix instead of String.replace_leading in test_name() but that function seems to get called multiple times during the test grouping. Simpler to just avoid naming the tests that way for now.
* Reduce skipped integration testsJay Doane2021-11-141-285/+1
| | | | | | | | | The `skip.elixir` file was ported [1] from FDB-based main branch but contains more exclusions than necessary for 3.x. This removes tests from `skip.elixir` that pass on 3.x. [1] https://github.com/apache/couchdb/commit/65fbc6cfdb29bab1072a42f4d6005da452a7fa65#diff-d9485d6f3162015017bc09c9db3f87df0ca489d961c44347241a035854eb8044
* Eliminate elixir test compiler warningsJay Doane2021-11-103-3/+3
| | | | | | | | | | | | | | | | Eliminates the following: warning: variable "epoch" is unused (if the variable is not meant to be used, prefix it with an underscore) src/couchdb/test/elixir/test/replication_test.exs:1756: ReplicationTest.seq_to_shards/1 warning: variable "uuid" is unused (if the variable is not meant to be used, prefix it with an underscore) src/couchdb/test/elixir/test/replication_test.exs:1756: ReplicationTest.seq_to_shards/1 warning: variable "string" is unused (if the variable is not meant to be used, prefix it with an underscore) src/couchdb/test/elixir/test/utf8_test.exs:32: UTF8Test."test UTF8 support"/1 warning: variable "repeated_view_offset_test_fun" does not exist and is being expanded to "repeated_view_offset_test_fun()", please use parentheses to remove the ambiguity or change the variable name src/couchdb/test/elixir/test/view_offsets_test.exs:63: ViewOffsetTest."test repeated view offsets"/1
* Move custodian VDU to a BDU and fix _all_dbs off-by-one limit bugNick Vatamaniuc2021-10-242-0/+12
| | | | | | | | | This fixes issue: https://github.com/apache/couchdb/issues/3786 In addition, add few _all_dbs limit tests since we didn't seem to have any previously to catch such issues. Plus, test some of the corner cases which should be caught by the BDU and should return a 403 error code.
* Include shard uuids in db_info update sequencesNick Vatamaniuc2021-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | This means `update_seq` values from `GET $db` `last_seq` returned from ` GET $db/_changes?since=now&limit=` will be more resilient to change feed rewinds. Besides, those sequences will now be more consistent and users won't have to wonder why one opaque sequence works slightly differently than another opaque update sequence. Previously, when the sequences were returned only as numeric values, it was impossible to calculate replacements and change feeds had to always rewind back to 0 for those ranges. With uuids and epochs in play, it is possible to figure out that some shards might have moved to new nodes or find internal replication checkpoints to avoid streaming changes feeds from 0 on those ranges. Some replication Elixir tests decode update sequences, so those were updated to handle the new uuid and epoch format as well. Fixes: https://github.com/apache/couchdb/issues/3787 Co-author: Adam Kocoloski kocolosk@apache.org
* Properly sort descending=true view results when a key list is providedNick Vatamaniuc2021-09-221-5/+35
| | | | | | | | | | | | | Results should now be returned in descending {key, doc_id} order. The idea is to reverse the key list before sending it to the workers, so they will emit rows in reverse order. Also, we are using the same reversed list when building the KeyDict structure on the coordinator. That way the order of the sent rows and the expected coordinator sorting order will match. For testing, enhance an existing multi-key Elixir view test to test both ascending and descending cases and actually check that the rows are in the correct order each time.
* Disable some testsILYA Khlopotov2021-09-161-0/+4
|
* Update elixir test suiteILYA Khlopotov2021-09-161-32/+151
|
* Load test helpers to prevent crash of test case extractorILYA Khlopotov2021-09-161-0/+9
|
* Fix logic in ensure_exunit_startedILYA Khlopotov2021-09-161-1/+1
|
* Add ability to control which Elixir integration tests to runILYA Khlopotov2021-09-164-16/+1119
| | | | | | | | | | | | | | | | New `elixir-suite` Makefile target is added. It runs a predefined set of elixir integration tests. The feature is controlled by two files: - test/elixir/test/config/suite.elixir - contains list of all available tests - test/elixir/test/config/skip.elixir - contains list of tests to skip In order to update the `test/elixir/test/config/suite.elixir` when new tests are added. The one would need to run the following command: ``` MIX_ENV=integration mix suite > test/elixir/test/config/suite.elixir ```
* Discard a payload on a delete attachment requestEric Avdey2021-08-261-0/+15
| | | | | | | | | | | While including a payload within a DELETE request is not forbidden by RFC7231 its presence on a delete attachment request leaves a mochiweb acceptor in a semi-opened state since mochiweb's using lazy load for the request bodies. This makes a next immediate request to the same acceptor to hung until previous request's receive timeout. This PR adds a step to explicitly "drain" and discard an entity body on a delete attachment request to prevent that.
* Improve handling of + in urls 3.xncshaw2021-08-101-0/+56
|
* Fix response code for existing att and wrong revncshaw2021-07-301-0/+4
|
* Fix response code for nonexistent attachmentncshaw2021-07-191-0/+5
|
* normalize some config optionsjiahuili2021-06-211-1/+1
|
* move couch_httpd_auth options to chttpd_auth 3.xJiahui Li2021-05-274-4/+4
|
* Moved some config options from httpd to chttpdJiahui Li2021-05-246-30/+30
|
* Erlang 24 support for 3.x branchNick Vatamaniuc2021-05-191-1/+5
| | | | | | | | | The main fix is to switch crypto functions to use the new versions for 22+ while keeping Erlang 20 still working. ``` crypto:hmac(Alg, Key, Message) -> crypto:mac(hmac, Alg, Key, Message) ```
* Use correct args in get_doc_infoJay Doane2021-04-201-1/+1
| | | | | `fabric.get_doc_info/3` requires three arguments, but this line was only using one.