You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2021/03/25 13:45:21 UTC

[couchdb] branch main updated: Remove compact elixir test (#3459)

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

bessbd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 4e6117e  Remove compact elixir test (#3459)
4e6117e is described below

commit 4e6117eb0e144aad04cf91444e87e645ac27b215
Author: Bessenyei Balázs Donát <be...@users.noreply.github.com>
AuthorDate: Thu Mar 25 14:45:12 2021 +0100

    Remove compact elixir test (#3459)
---
 test/elixir/test/compact_test.exs    | 89 ------------------------------------
 test/elixir/test/config/skip.elixir  |  2 -
 test/elixir/test/config/suite.elixir |  3 --
 3 files changed, 94 deletions(-)

diff --git a/test/elixir/test/compact_test.exs b/test/elixir/test/compact_test.exs
deleted file mode 100644
index 18aeab2..0000000
--- a/test/elixir/test/compact_test.exs
+++ /dev/null
@@ -1,89 +0,0 @@
-defmodule CompactTest do
-  use CouchTestCase
-
-  @moduletag :compact
-  @moduletag kind: :single_node
-
-  @moduledoc """
-  Test CouchDB compaction
-  This is a port of compact.js
-  """
-
-  @att_doc_id "att_doc"
-  @att_name "foo.txt"
-  @att_plaintext "This is plain text"
-
-  # Need to investigate why compaction is not compacting (or compactor cannot complete)
-  # Refer:- https://github.com/apache/couchdb/pull/2127
-  @tag :pending
-  @tag :skip_on_jenkins
-  @tag :with_db
-  test "compaction reduces size of deleted docs", context do
-    db = context[:db_name]
-    docs = populate(db)
-    info = get_info(db)
-    orig_data_size = info["sizes"]["active"]
-    orig_disk_size = info["sizes"]["file"]
-    start_time = info["instance_start_time"]
-    assert is_integer(orig_data_size) and is_integer(orig_disk_size)
-    assert orig_data_size < orig_disk_size
-
-    delete(db, docs)
-
-    retry_until(fn ->
-      deleted_data_size = get_info(db)["data_size"]
-      assert deleted_data_size > orig_data_size
-    end)
-
-    deleted_data_size = get_info(db)["data_size"]
-
-    compact(db)
-
-    retry_until(fn ->
-      assert get_info(db)["instance_start_time"] == start_time
-      assert_attachment_available(db)
-      info = get_info(db)
-      final_data_size = info["sizes"]["active"]
-      final_disk_size = info["sizes"]["file"]
-      assert final_data_size < final_disk_size
-      assert is_integer(final_data_size) and is_integer(final_disk_size)
-      assert final_data_size < deleted_data_size
-    end)
-  end
-
-  defp assert_attachment_available(db) do
-    resp = Couch.get("/#{db}/#{@att_doc_id}/#{@att_name}")
-    assert resp.body == @att_plaintext
-    assert resp.headers["content-type"] == "text/plain"
-    assert Couch.get("/#{db}").body["doc_count"] == 1
-  end
-
-  defp populate(db) do
-    docs = create_docs(0..19)
-    resp = Couch.post("/#{db}/_bulk_docs", body: %{docs: docs})
-    assert resp.status_code in [201, 202]
-    docs = rev(docs, resp.body)
-
-    doc = %{
-      _id: "#{@att_doc_id}",
-      _attachments: %{
-        "#{@att_name}": %{content_type: "text/plain", data: Base.encode64(@att_plaintext)}
-      }
-    }
-
-    resp = Couch.put("/#{db}/#{doc._id}", body: doc)
-    assert resp.status_code in [201, 202]
-    docs
-  end
-
-  defp delete(db, docs) do
-    docs = Enum.map(docs, &Map.put(&1, :_deleted, true))
-    resp = Couch.post("/#{db}/_bulk_docs", body: %{docs: docs})
-    assert resp.status_code in [201, 202]
-    assert Couch.post("/#{db}/_ensure_full_commit").body["ok"] == true
-  end
-
-  defp get_info(db) do
-    Couch.get("/#{db}").body
-  end
-end
diff --git a/test/elixir/test/config/skip.elixir b/test/elixir/test/config/skip.elixir
index bc581b6..88263e4 100644
--- a/test/elixir/test/config/skip.elixir
+++ b/test/elixir/test/config/skip.elixir
@@ -42,8 +42,6 @@
   "CoffeeTest": [
     "CoffeeScript basic functionality"
   ],
-  "CompactTest": [
-  ],
   "ConfigTest": [
     "Atoms, binaries, and strings suffice as whitelist sections and keys.",
     "Blacklist is functional",
diff --git a/test/elixir/test/config/suite.elixir b/test/elixir/test/config/suite.elixir
index c508b44..7d2fc79 100644
--- a/test/elixir/test/config/suite.elixir
+++ b/test/elixir/test/config/suite.elixir
@@ -128,9 +128,6 @@
   "CoffeeTest": [
     "CoffeeScript basic functionality"
   ],
-  "CompactTest": [
-    "compaction reduces size of deleted docs"
-  ],
   "ConcurrentWritesTest": [
     "Primary data tests",
     "Secondary data tests",