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 2019/12/25 17:45:24 UTC
[couchdb] 21/41: Speedup eunit: couch_flags_config_tests
This is an automated email from the ASF dual-hosted git repository.
davisp pushed a commit to branch speedup-test-suite
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 3f467ede5a5e23c0417f1bcd64a53a3186d9ea97
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Wed Dec 25 11:32:26 2019 -0600
Speedup eunit: couch_flags_config_tests
This undoes the test per combination approach to avoid the time spent
printing each name to the console.
---
src/couch/test/eunit/couch_flags_config_tests.erl | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/couch/test/eunit/couch_flags_config_tests.erl b/src/couch/test/eunit/couch_flags_config_tests.erl
index 1a66cdc..ed7df11 100644
--- a/src/couch/test/eunit/couch_flags_config_tests.erl
+++ b/src/couch/test/eunit/couch_flags_config_tests.erl
@@ -16,8 +16,10 @@ couch_flags_config_test_() ->
{
"test couch_flags_config",
{
- setup, fun setup/0, fun teardown/1,
- all_combinations_return_same_result()
+ setup,
+ fun setup/0,
+ fun teardown/1,
+ [fun all_combinations_return_same_result/0]
++ latest_overide_wins()
++ [
{"rules_are_sorted", fun rules_are_sorted/0}
@@ -41,8 +43,9 @@ all_combinations_return_same_result() ->
{{<<"*">>},{<<"*">>, 1, [bar, foo]}}
],
Combinations = couch_tests_combinatorics:permutations(Config),
- [{test_id(Items), ?_assertEqual(Expected, couch_flags_config:data(Items))}
- || Items <- Combinations].
+ lists:foreach(fun(Items) ->
+ ?assertEqual(Expected, couch_flags_config:data(Items))
+ end, Combinations).
rules_are_sorted() ->
Expected = [