summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2020-09-24 13:36:10 -0500
committerAdam Kocoloski <kocolosk@apache.org>2021-11-04 23:24:40 +0000
commit8e11f778121504dcb48bb30e02b30640935c256b (patch)
tree28a92938dcebd4f1134ae8447424b5cdf50c5835
parent701d9663d349cce9c175b6ba75ea074889c35633 (diff)
downloadcouchdb-8e11f778121504dcb48bb30e02b30640935c256b.tar.gz
Remove quorum tests
Quorum is no longer a thing now that we rely on FoundationDB.
-rw-r--r--Makefile18
-rw-r--r--Makefile.win16
-rw-r--r--test/elixir/test/cluster_with_quorum_test.exs186
-rw-r--r--test/elixir/test/cluster_without_quorum_test.exs185
4 files changed, 3 insertions, 402 deletions
diff --git a/Makefile b/Makefile
index 8400b70eb..652625d64 100644
--- a/Makefile
+++ b/Makefile
@@ -243,7 +243,7 @@ elixir: elixir-init elixir-check-formatted elixir-credo devclean
--enable-erlang-views \
--locald-config test/elixir/test/config/test-config.ini \
--erlang-config rel/files/eunit.config \
- --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)'
+ --no-eval 'mix test --trace $(EXUNIT_OPTS)'
.PHONY: elixir-only
elixir-only: devclean
@@ -253,27 +253,13 @@ elixir-only: devclean
--enable-erlang-views \
--locald-config test/elixir/test/config/test-config.ini \
--erlang-config rel/files/eunit.config \
- --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)'
+ --no-eval 'mix test --trace $(EXUNIT_OPTS)'
.PHONY: elixir-init
elixir-init: MIX_ENV=test
elixir-init: config.erl
@mix local.rebar --force && mix local.hex --force && mix deps.get
-.PHONY: elixir-cluster-without-quorum
-elixir-cluster-without-quorum: export MIX_ENV=integration
-elixir-cluster-without-quorum: elixir-init elixir-check-formatted elixir-credo devclean
- @dev/run -n 3 -q -a adm:pass \
- --degrade-cluster 2 \
- --no-eval 'mix test --trace --only without_quorum_test $(EXUNIT_OPTS)'
-
-.PHONY: elixir-cluster-with-quorum
-elixir-cluster-with-quorum: export MIX_ENV=integration
-elixir-cluster-with-quorum: elixir-init elixir-check-formatted elixir-credo devclean
- @dev/run -n 3 -q -a adm:pass \
- --degrade-cluster 1 \
- --no-eval 'mix test --trace --only with_quorum_test $(EXUNIT_OPTS)'
-
.PHONY: elixir-suite
elixir-suite: export MIX_ENV=integration
elixir-suite: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
diff --git a/Makefile.win b/Makefile.win
index a6966c182..ac8b187e3 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -207,27 +207,13 @@ elixir: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
elixir: elixir-init elixir-check-formatted elixir-credo devclean
@dev\run $(TEST_OPTS) -a adm:pass -n 1 --enable-erlang-views \
--locald-config test/elixir/test/config/test-config.ini \
- --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)'
+ --no-eval 'mix test --trace $(EXUNIT_OPTS)'
.PHONY: elixir-init
elixir-init: MIX_ENV=test
elixir-init: config.erl
@mix local.rebar --force && mix local.hex --force && mix deps.get
-.PHONY: elixir-cluster-without-quorum
-elixir-cluster-without-quorum: export MIX_ENV=integration
-elixir-cluster-without-quorum: elixir-init elixir-check-formatted elixir-credo devclean
- @dev\run -n 3 -q -a adm:pass \
- --degrade-cluster 2 \
- --no-eval 'mix test --trace --only without_quorum_test $(EXUNIT_OPTS)'
-
-.PHONY: elixir-cluster-with-quorum
-elixir-cluster-with-quorum: export MIX_ENV=integration
-elixir-cluster-with-quorum: elixir-init elixir-check-formatted elixir-credo devclean
- @dev\run -n 3 -q -a adm:pass \
- --degrade-cluster 1 \
- --no-eval 'mix test --trace --only with_quorum_test $(EXUNIT_OPTS)'
-
.PHONY: elixir-suite
elixir-suite: export MIX_ENV=integration
elixir-suite: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
diff --git a/test/elixir/test/cluster_with_quorum_test.exs b/test/elixir/test/cluster_with_quorum_test.exs
deleted file mode 100644
index dc3d66be3..000000000
--- a/test/elixir/test/cluster_with_quorum_test.exs
+++ /dev/null
@@ -1,186 +0,0 @@
-defmodule WithQuorumTest do
- use CouchTestCase
-
- @moduletag :with_quorum_test
- @moduletag kind: :cluster
-
- @moduledoc """
- Test CouchDB API in a cluster without quorum.
- """
- @tag :with_db_name
- test "Creating/Deleting DB should return 201-Created/202-Acepted", context do
- db_name = context[:db_name]
- resp = Couch.put("/#{db_name}")
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
- resp = Couch.delete("/#{db_name}")
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
- end
-
- @tag :with_db_name
- test "Creating-Updating/Deleting doc should return 201-Created/200-OK", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
-
- resp = Couch.post("/#{context[:db_name]}", body: %{:_id => "0", :a => 1})
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
-
- resp = Couch.get("/#{context[:db_name]}/0")
- rev = resp.body["_rev"]
-
- resp =
- Couch.put("/#{context[:db_name]}/0", body: %{:_id => "0", :_rev => rev, :a => 2})
-
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
-
- resp = Couch.get("/#{context[:db_name]}/0")
- rev = resp.body["_rev"]
- resp = Couch.delete("/#{context[:db_name]}/0", query: %{:rev => rev})
- msg = "Should return 200-OK"
- assert resp.status_code == 200, msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Creating-Updating/Deleting doc with overriden quorum should return 202-Acepted/200-OK",
- context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
-
- resp =
- Couch.post(
- "/#{context[:db_name]}",
- query: %{:w => 3},
- body: %{:_id => "0", :a => 1}
- )
-
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
-
- resp = Couch.get("/#{context[:db_name]}/0")
- rev = resp.body["_rev"]
-
- resp =
- Couch.put(
- "/#{context[:db_name]}/0",
- query: %{:w => 3},
- body: %{:_id => "0", :_rev => rev, :a => 2}
- )
-
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
-
- resp = Couch.get("/#{context[:db_name]}/0")
- rev = resp.body["_rev"]
- resp = Couch.delete("/#{context[:db_name]}/0", query: %{:w => 1, :rev => rev})
- msg = "Should return 200-Ok"
- assert resp.status_code == 200, msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Copy doc should return 201-Created", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
-
- Couch.post(
- "/#{context[:db_name]}",
- body: %{:_id => "0", :a => 1}
- )
-
- headers = [Destination: "1"]
- resp = Couch.request(:copy, "/#{context[:db_name]}/0", headers: headers)
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
- Couch.delete("/#{db_name}")
- end
-
- @doc_range 1..5
-
- @tag :with_db_name
- test "Bulk docs should return 201-Created", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
- docs = create_docs(@doc_range)
- resp = Couch.post("/#{db_name}/_bulk_docs", body: %{docs: docs})
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Bulk docs overriden quorum should return 202-Acepted", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
- docs = create_docs(@doc_range)
- resp = Couch.post("/#{db_name}/_bulk_docs", query: %{:w => 3}, body: %{docs: docs})
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Attachments should return 201-Created", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
- resp = Couch.post("/#{context[:db_name]}", body: %{:_id => "0"})
- rev = resp.body["rev"]
-
- resp =
- Couch.put(
- "/#{context[:db_name]}/0/foo.txt",
- query: %{:rev => rev},
- body: "This is a no bas64 encoded text",
- headers: ["Content-Type": "text/plain;charset=utf-8"]
- )
-
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
-
- rev = resp.body["rev"]
- resp = Couch.delete("/#{context[:db_name]}/0/foo.txt", query: %{:rev => rev})
- msg = "Should return 200-Ok"
- assert resp.status_code == 200, msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Attachments overriden quorum should return 202-Acepted", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
- resp = Couch.post("/#{context[:db_name]}", body: %{:_id => "0"})
- rev = resp.body["rev"]
-
- resp =
- Couch.put(
- "/#{context[:db_name]}/0/foo.txt",
- query: %{:rev => rev, :w => 3},
- body: "This is a no bas64 encoded text",
- headers: ["Content-Type": "text/plain;charset=utf-8"]
- )
-
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
-
- rev = resp.body["rev"]
-
- resp =
- Couch.delete(
- "/#{context[:db_name]}/0/foo.txt",
- query: %{:rev => rev, :w => 3}
- )
-
- msg = "Should return 200-Ok"
- assert resp.status_code == 200, msg
-
- Couch.delete("/#{db_name}")
- end
-end
diff --git a/test/elixir/test/cluster_without_quorum_test.exs b/test/elixir/test/cluster_without_quorum_test.exs
deleted file mode 100644
index 63371f1a6..000000000
--- a/test/elixir/test/cluster_without_quorum_test.exs
+++ /dev/null
@@ -1,185 +0,0 @@
-defmodule WithoutQuorumTest do
- use CouchTestCase
-
- @moduletag :without_quorum_test
- @moduletag kind: :degraded_cluster
-
- @moduledoc """
- Test CouchDB API in a cluster without quorum.
- """
- @tag :with_db_name
- test "Creating/Deleting DB should return 202-Acepted", context do
- db_name = context[:db_name]
- resp = Couch.put("/#{db_name}")
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
- resp = Couch.delete("/#{db_name}")
- assert resp.status_code == 202, msg
- end
-
- @tag :with_db_name
- test "Creating/Updating/Deleting doc should return 202-Acepted", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
-
- resp = Couch.post("/#{context[:db_name]}", body: %{:_id => "0", :a => 1})
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
-
- resp = Couch.get("/#{context[:db_name]}/0")
- rev = resp.body["_rev"]
-
- resp =
- Couch.put("/#{context[:db_name]}/0", body: %{:_id => "0", :_rev => rev, :a => 2})
-
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
-
- resp = Couch.get("/#{context[:db_name]}/0")
- rev = resp.body["_rev"]
- resp = Couch.delete("/#{context[:db_name]}/0", query: %{:rev => rev})
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Creating-Updating/Deleting doc with overriden quorum should return 201-Created/200-OK",
- context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
-
- resp =
- Couch.post(
- "/#{context[:db_name]}",
- query: %{:w => 1},
- body: %{:_id => "0", :a => 1}
- )
-
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
-
- resp = Couch.get("/#{context[:db_name]}/0")
- rev = resp.body["_rev"]
-
- resp =
- Couch.put(
- "/#{context[:db_name]}/0",
- query: %{:w => 1},
- body: %{:_id => "0", :_rev => rev, :a => 2}
- )
-
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
-
- resp = Couch.get("/#{context[:db_name]}/0")
- rev = resp.body["_rev"]
- resp = Couch.delete("/#{context[:db_name]}/0", query: %{:w => 1, :rev => rev})
- msg = "Should return 200-Ok"
- assert resp.status_code == 200, msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Copy doc should return 202-Acepted", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
-
- Couch.post(
- "/#{context[:db_name]}",
- body: %{:_id => "0", :a => 1}
- )
-
- headers = [Destination: "1"]
- resp = Couch.request(:copy, "/#{context[:db_name]}/0", headers: headers)
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
- Couch.delete("/#{db_name}")
- end
-
- @doc_range 1..5
-
- @tag :with_db_name
- test "Bulk docs should return 202-Acepted", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
- docs = create_docs(@doc_range)
- resp = Couch.post("/#{db_name}/_bulk_docs", body: %{docs: docs})
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Bulk docs overriden quorum should return 201-Created", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
- docs = create_docs(@doc_range)
- resp = Couch.post("/#{db_name}/_bulk_docs", query: %{:w => 1}, body: %{docs: docs})
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Attachments should return 202-Acepted", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
- resp = Couch.post("/#{context[:db_name]}", body: %{:_id => "0"})
- rev = resp.body["rev"]
-
- resp =
- Couch.put(
- "/#{context[:db_name]}/0/foo.txt",
- query: %{:rev => rev},
- body: "This is a no bas64 encoded text",
- headers: ["Content-Type": "text/plain;charset=utf-8"]
- )
-
- msg = "Should return 202-Acepted"
- assert resp.status_code == 202, msg
-
- rev = resp.body["rev"]
- resp = Couch.delete("/#{context[:db_name]}/0/foo.txt", query: %{:rev => rev})
- msg = "Should return 200-Ok"
- assert resp.status_code == 200, msg
-
- Couch.delete("/#{db_name}")
- end
-
- @tag :with_db_name
- test "Attachments overriden quorum should return 201-Created", context do
- db_name = context[:db_name]
- Couch.put("/#{db_name}")
- resp = Couch.post("/#{context[:db_name]}", body: %{:_id => "0"})
- rev = resp.body["rev"]
-
- resp =
- Couch.put(
- "/#{context[:db_name]}/0/foo.txt",
- query: %{:rev => rev, :w => 1},
- body: "This is a no bas64 encoded text",
- headers: ["Content-Type": "text/plain;charset=utf-8"]
- )
-
- msg = "Should return 201-Created"
- assert resp.status_code in [201, 202], msg
-
- rev = resp.body["rev"]
-
- resp =
- Couch.delete(
- "/#{context[:db_name]}/0/foo.txt",
- query: %{:rev => rev, :w => 1}
- )
-
- msg = "Should return 200-Ok"
- assert resp.status_code == 200, msg
-
- Couch.delete("/#{db_name}")
- end
-end