You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2021/07/28 19:21:04 UTC

[couchdb] branch test-warnings created (now 9a3cdab)

This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a change to branch test-warnings
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 9a3cdab  Use correct fabric function names in elixir tests

This branch includes the following new commits:

     new 9a3cdab  Use correct fabric function names in elixir tests

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[couchdb] 01/01: Use correct fabric function names in elixir tests

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch test-warnings
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9a3cdab708c9fe43e95163ce5bf5ed9798589a4b
Author: Jay Doane <ja...@apache.org>
AuthorDate: Wed Jul 28 12:20:42 2021 -0700

    Use correct fabric function names in elixir tests
    
    This eliminates several warnings when running `make exunit`.
---
 test/elixir/lib/step/create_db.ex |  2 +-
 test/elixir/lib/step/user.ex      | 11 ++++++-----
 test/elixir/lib/utils.ex          |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/test/elixir/lib/step/create_db.ex b/test/elixir/lib/step/create_db.ex
index 412c858..7be5b80 100644
--- a/test/elixir/lib/step/create_db.ex
+++ b/test/elixir/lib/step/create_db.ex
@@ -36,7 +36,7 @@ defmodule Couch.Test.Setup.Step.Create.DB do
   def setup(setup, %__MODULE__{name: name} = step) do
     assert Setup.completed?(setup, Step.Start), "Require `Start` step"
     assert :fabric in Step.Start.apps(), "Fabric is not started"
-    res = :fabric2_db.create_db(name, [@admin])
+    res = :fabric2_db.create(name, [@admin])
     assert res in [:ok, :accepted], "Cannot create `#{name}` database"
     step
   end
diff --git a/test/elixir/lib/step/user.ex b/test/elixir/lib/step/user.ex
index 63b8f44..3005160 100644
--- a/test/elixir/lib/step/user.ex
+++ b/test/elixir/lib/step/user.ex
@@ -36,9 +36,9 @@ defmodule Couch.Test.Setup.Step.User do
       :config.get('chttpd_auth', 'authentication_db', '_users'))
     if not Utils.db_exists?(users_db) do
       on_exit fn ->
-        :fabric.delete_db(users_db, [@admin])
+        :fabric2_db.delete(users_db, [@admin])
       end
-      res = :fabric.create_db(users_db, [@admin])
+      res = :fabric2_db.create(users_db, [@admin])
       assert res in [:ok, :accepted], "Cannot create `users` database #{users_db}"
     end
 
@@ -63,7 +63,7 @@ defmodule Couch.Test.Setup.Step.User do
         roles: roles,
         password: pass
       })
-      res = :fabric.update_doc(users_db, user_doc, [@admin])
+      res = :fabric2_db.update_doc(users_db, user_doc, [@admin])
       assert res in [:ok, :accepted], "Cannot create user document"
       %{step |
         name: name,
@@ -79,13 +79,14 @@ defmodule Couch.Test.Setup.Step.User do
       :config.delete("admins", String.to_charlist(name), false)
     else
       doc_id = "org.couchdb.user:#{name}"
-      assert {:ok, doc_info(revs: [rev | _])} = :fabric.get_doc_info(users_db)
+      assert {:ok, doc_info(revs: [rev | _])} =
+        :fabric2_db.get_doc_info(users_db, doc_id)
       doc = :couch_doc.from_json_obj(%{
         _id: doc_id,
         _rev: rev,
         _deleted: true
       })
-      assert {:ok, _resp} = :fabric.update_doc(users_db, doc, [@admin])
+      assert {:ok, _resp} = :fabric2_db.update_doc(users_db, doc, [@admin])
     end
     :ok
   end
diff --git a/test/elixir/lib/utils.ex b/test/elixir/lib/utils.ex
index 3ecf878..26bda1e 100644
--- a/test/elixir/lib/utils.ex
+++ b/test/elixir/lib/utils.ex
@@ -23,7 +23,7 @@ defmodule Couch.Test.Utils do
 
   def db_exists?(db_name) do
     try do
-      :fabric.get_db_info(db_name)
+      :fabric2_db.get_db_info(db_name)
     catch
       :error, :database_does_not_exist -> false
     end