This is an automated email from the ASF dual-hosted git repository. nickva pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 5dd12873cc3f535d52812296304dbf1052103d87 Author: Nick Vatamaniuc <[email protected]> AuthorDate: Thu Jul 30 18:07:09 2026 -0400 Fix elixir warnings Warnings (not sure how long these have been around) showed some errors in the tests like unused variables, using strings keys instead of having to quote them. The duplicates in the mango tests were ported from Python but they are just noise as the last entry wins and if we want to test duplicate JSON behavior in Python or Elixir we should do that in a different test. --- config/integration.exs | 1 - config/test.exs | 1 - test/elixir/config/test.exs | 1 - test/elixir/test/attachments_multipart_test.exs | 9 ++++----- test/elixir/test/basics_test.exs | 2 -- test/elixir/test/mango/03_operator_test.exs | 2 +- test/elixir/test/mango/05_index_selection_test.exs | 20 -------------------- test/elixir/test/mango/06_basic_text_test.exs | 2 +- test/elixir/test/mango/14_json_pagination_test.exs | 2 -- test/elixir/test/search_test.exs | 1 - 10 files changed, 6 insertions(+), 35 deletions(-) diff --git a/config/integration.exs b/config/integration.exs index 46cfad0fa..bdb6c562e 100644 --- a/config/integration.exs +++ b/config/integration.exs @@ -1,7 +1,6 @@ import Config config :logger, - backends: [:console], compile_time_purge_matching: [ [level_lower_than: :debug] ], diff --git a/config/test.exs b/config/test.exs index e2336a31b..ee6ebf932 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1,7 +1,6 @@ import Config config :logger, - backends: [:console], compile_time_purge_matching: [ [level_lower_than: :debug] ], diff --git a/test/elixir/config/test.exs b/test/elixir/config/test.exs index 9fe475bbb..159c49420 100644 --- a/test/elixir/config/test.exs +++ b/test/elixir/config/test.exs @@ -1,5 +1,4 @@ config :logger, - backends: [:console], compile_time_purge_matching: [ [level_lower_than: :debug] ] diff --git a/test/elixir/test/attachments_multipart_test.exs b/test/elixir/test/attachments_multipart_test.exs index 6a63df0e0..f940bae10 100644 --- a/test/elixir/test/attachments_multipart_test.exs +++ b/test/elixir/test/attachments_multipart_test.exs @@ -386,11 +386,10 @@ defmodule AttachmentMultipartTest do if Enum.at(inner_sections, 1).body == hello_data do assert Enum.at(inner_sections, 2).body != lorem else - if assert Enum.at(inner_sections, 2).body == hello_data do - assert Enum.at(inner_sections, 1).body != lorem - else - assert false, "Could not found data.bin attachment data" - end + assert Enum.at(inner_sections, 2).body == hello_data, + "Could not find data.bin attachment data" + + assert Enum.at(inner_sections, 1).body != lorem end # now test that it works together with the atts_since parameter diff --git a/test/elixir/test/basics_test.exs b/test/elixir/test/basics_test.exs index a76510a13..f685f4b52 100644 --- a/test/elixir/test/basics_test.exs +++ b/test/elixir/test/basics_test.exs @@ -389,14 +389,12 @@ defmodule BasicsTest do assert resp.headers["X-Couch-Request-ID"] == uuid end - @tag test "_all_dbs/_all_docs is not found", _context do resp = Couch.get("/_all_dbs/_all_docs") assert resp.status_code == 404 assert resp.body["error"] == "not_found" end - @tag test "_dbs_info/_all_docs is not found", _context do resp = Couch.get("/_dbs_info/_all_docs") assert resp.status_code == 404 diff --git a/test/elixir/test/mango/03_operator_test.exs b/test/elixir/test/mango/03_operator_test.exs index 97569e244..879e83380 100644 --- a/test/elixir/test/mango/03_operator_test.exs +++ b/test/elixir/test/mango/03_operator_test.exs @@ -44,7 +44,7 @@ defmodule OperatorTest do q = %{ "_id" => %{"$gt" => nil}, - "bang" => %{"$elemMatch" => %{"foo": %{"$gte": 1}, "bam": true}} + "bang" => %{"$elemMatch" => %{"foo" => %{"$gte" => 1}, "bam" => true}} } {:ok, docs} = MangoDatabase.find(@db_name, q) diff --git a/test/elixir/test/mango/05_index_selection_test.exs b/test/elixir/test/mango/05_index_selection_test.exs index 92358e40b..42e1abde3 100644 --- a/test/elixir/test/mango/05_index_selection_test.exs +++ b/test/elixir/test/mango/05_index_selection_test.exs @@ -202,13 +202,6 @@ defmodule IndexSelectionTest do design_doc = %{ "_id" => "_design/bad_view_index", "language" => "query", - "views" => %{ - "queryidx1" => %{ - "map" => %{"fields" => %{"age" => "asc"}}, - "reduce" => "_count", - "options" => %{"def" => %{"fields" => [%{"age" => "asc"}]}, "w" => 2}, - } - }, "views" => %{ "views001" => %{ "map" => "function(employee){if(employee.training)" @@ -354,19 +347,6 @@ defmodule TextIndexSelectionTest do design_doc = %{ "_id" => "_design/bad_text_index", "language" => "query", - "indexes" => %{ - "text_index" => %{ - "default_analyzer" => "keyword", - "default_field" => %{}, - "selector" => %{}, - "fields" => "all_fields", - "analyzer" => %{ - "name" => "perfield", - "default" => "keyword", - "fields" => %{"$default" => "standard"}, - }, - } - }, "indexes" => %{ "st_index" => %{ "analyzer" => "standard", diff --git a/test/elixir/test/mango/06_basic_text_test.exs b/test/elixir/test/mango/06_basic_text_test.exs index 08c39c631..5447bac56 100644 --- a/test/elixir/test/mango/06_basic_text_test.exs +++ b/test/elixir/test/mango/06_basic_text_test.exs @@ -78,7 +78,7 @@ defmodule ElemMatchTests do end test "elem match non object" do - q = %{"bestfriends" => %{"$elemMatch" => %{"$eq" => "Wolverine", "$eq" => "Cyclops"}}} + q = %{"bestfriends" => %{"$elemMatch" => %{"$eq" => "Cyclops"}}} {:ok, docs} = MangoDatabase.find(@db_name, q) assert length(docs) == 1 assert Enum.at(docs, 0)["bestfriends"] == ["Wolverine", "Cyclops"] diff --git a/test/elixir/test/mango/14_json_pagination_test.exs b/test/elixir/test/mango/14_json_pagination_test.exs index 6a8dc0883..3eee9e952 100644 --- a/test/elixir/test/mango/14_json_pagination_test.exs +++ b/test/elixir/test/mango/14_json_pagination_test.exs @@ -57,7 +57,6 @@ defmodule PaginateJsonDocs do # Page 3 {:ok, resp} = MangoDatabase.find(@db_name, selector, bookmark: bookmark, limit: 5, return_raw: true) - bookmark = resp["bookmark"] docs = resp["docs"] assert Enum.empty?(docs) end @@ -104,7 +103,6 @@ defmodule PaginateJsonDocs do assert Enum.at(docs, 0)["_id"] == "800" assert length(docs) == 1 {:ok, resp} = MangoDatabase.find(@db_name, selector, bookmark: bookmark, limit: 5, return_raw: true) - bookmark = resp["bookmark"] docs = resp["docs"] assert Enum.empty?(docs) end diff --git a/test/elixir/test/search_test.exs b/test/elixir/test/search_test.exs index edf6858cf..526cfda0d 100644 --- a/test/elixir/test/search_test.exs +++ b/test/elixir/test/search_test.exs @@ -313,7 +313,6 @@ defmodule SearchTest do create_ddoc(db_name) url = "/#{db_name}/_design/inventory/_search/fruits" - ranges = %{"price" => %{}} resp = Couch.get(url, query: %{q: "*:*", group_field: "state"}) assert_on_status(resp, 200, "Fail to do search.")
