You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/06/21 19:12:44 UTC
[couchdb] branch optimize-ddoc-cache updated (bba3df8 -> f4c352a)
This is an automated email from the ASF dual-hosted git repository.
davisp pushed a change to branch optimize-ddoc-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git.
from bba3df8 ss - test suite boom
new 78ffb4a Disable cover to avoid crashing the test suite
new f4c352a unload ddoc_cache modules before each test
The 2 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.
Summary of changes:
src/ddoc_cache/rebar.config | 2 --
src/ddoc_cache/test/ddoc_cache_eviction_test.erl | 2 +-
src/ddoc_cache/test/ddoc_cache_refresh_test.erl | 2 +-
src/ddoc_cache/test/ddoc_cache_remove_test.erl | 3 ++-
src/ddoc_cache/test/ddoc_cache_tutil.erl | 13 +++++++++++++
5 files changed, 17 insertions(+), 5 deletions(-)
delete mode 100644 src/ddoc_cache/rebar.config
--
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].
[couchdb] 01/02: Disable cover to avoid crashing the test suite
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davisp pushed a commit to branch optimize-ddoc-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 78ffb4a89b43088d7cb6a427147caf6b3baae371
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Wed Jun 21 10:39:47 2017 -0500
Disable cover to avoid crashing the test suite
---
src/ddoc_cache/rebar.config | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/ddoc_cache/rebar.config b/src/ddoc_cache/rebar.config
deleted file mode 100644
index e0d1844..0000000
--- a/src/ddoc_cache/rebar.config
+++ /dev/null
@@ -1,2 +0,0 @@
-{cover_enabled, true}.
-{cover_print_enabled, true}.
--
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.
[couchdb] 02/02: unload ddoc_cache modules before each test
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davisp pushed a commit to branch optimize-ddoc-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit f4c352a64d4335f97f3f8d17a228efe903ec5346
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Wed Jun 21 14:12:35 2017 -0500
unload ddoc_cache modules before each test
---
src/ddoc_cache/test/ddoc_cache_eviction_test.erl | 2 +-
src/ddoc_cache/test/ddoc_cache_refresh_test.erl | 2 +-
src/ddoc_cache/test/ddoc_cache_remove_test.erl | 3 ++-
src/ddoc_cache/test/ddoc_cache_tutil.erl | 13 +++++++++++++
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/ddoc_cache/test/ddoc_cache_eviction_test.erl b/src/ddoc_cache/test/ddoc_cache_eviction_test.erl
index aeca337..62ed0e8 100644
--- a/src/ddoc_cache/test/ddoc_cache_eviction_test.erl
+++ b/src/ddoc_cache/test/ddoc_cache_eviction_test.erl
@@ -34,7 +34,7 @@ start_couch() ->
stop_couch(Ctx) ->
- meck:unload(ddoc_cache_ev),
+ meck:unload(),
ddoc_cache_tutil:stop_couch(Ctx).
diff --git a/src/ddoc_cache/test/ddoc_cache_refresh_test.erl b/src/ddoc_cache/test/ddoc_cache_refresh_test.erl
index 7cdcff5..7bc1704 100644
--- a/src/ddoc_cache/test/ddoc_cache_refresh_test.erl
+++ b/src/ddoc_cache/test/ddoc_cache_refresh_test.erl
@@ -34,7 +34,7 @@ start_couch() ->
stop_couch(Ctx) ->
- meck:unload(ddoc_cache_ev),
+ meck:unload(),
ddoc_cache_tutil:stop_couch(Ctx).
diff --git a/src/ddoc_cache/test/ddoc_cache_remove_test.erl b/src/ddoc_cache/test/ddoc_cache_remove_test.erl
index 8c081ba..91f8ac2 100644
--- a/src/ddoc_cache/test/ddoc_cache_remove_test.erl
+++ b/src/ddoc_cache/test/ddoc_cache_remove_test.erl
@@ -43,7 +43,7 @@ start_couch() ->
stop_couch(Ctx) ->
- meck:unload(ddoc_cache_ev),
+ meck:unload(),
ddoc_cache_tutil:stop_couch(Ctx).
@@ -65,6 +65,7 @@ check_refresh_test_() ->
remove_ddoc({DbName, _}) ->
ddoc_cache_tutil:clear(),
meck:reset(ddoc_cache_ev),
+ ?assertEqual(0, ets:info(?CACHE, size)),
{ok, _} = ddoc_cache:open_doc(DbName, ?FOOBAR),
?assertEqual(1, ets:info(?CACHE, size)),
[#entry{key = Key, val = DDoc}] = ets:tab2list(?CACHE),
diff --git a/src/ddoc_cache/test/ddoc_cache_tutil.erl b/src/ddoc_cache/test/ddoc_cache_tutil.erl
index 8321dd5..6782b9d 100644
--- a/src/ddoc_cache/test/ddoc_cache_tutil.erl
+++ b/src/ddoc_cache/test/ddoc_cache_tutil.erl
@@ -21,6 +21,7 @@
start_couch() ->
+ purge_modules(),
Ctx = test_util:start_couch(?CONFIG_CHAIN, [chttpd, ddoc_cache]),
TmpDb = ?tempdb(),
ok = fabric:create_db(TmpDb, [{q, "1"}, {n, "1"}]),
@@ -69,3 +70,15 @@ ddocs() ->
]}
},
[FooBar, VDU, Custom].
+
+
+purge_modules() ->
+ case application:get_key(ddoc_cache, modules) of
+ {ok, Mods} ->
+ lists:foreach(fun(Mod) ->
+ code:delete(Mod),
+ code:purge(Mod)
+ end, Mods);
+ undefined ->
+ ok
+ end.
--
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.