You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2017/10/25 17:57:21 UTC

[couchdb] branch flexible-js-tests updated (9651c3f -> 54ac3ad)

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

tonysun83 pushed a change to branch flexible-js-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


    omit 9651c3f  Merge branch 'master' into flexible-js-tests
    omit 2a9134c  Mango test README formatting
    omit 69ebe61  Configurable Mango test parameters (#899)
    omit 0391912  make tests sorted
    omit 464a6b1  Mango text index test fixes (#894)
    omit 84edbb7  Add test to show selector works with old design docs (#893)
    omit 641aa56  Fix maximum key value when using JSON indexes (#881)
    omit 7f584da  Jenkins: Add Debian 9 (stretch), drop Ubuntu 12.04 (precise) (#891)
    omit b71bd68  fix intersection to use difference
    omit 339e1e1  add ability to ignore javascript test suites
    omit 7ae6928  Update Unix install dependencies (FreeBSD) (#888)
    omit d0445f5  Fix incorrect index selection when sort specified (#866)
    omit 9fe22b4  Merge pull request #882 from apache/janl-patch-1
    omit c3a18cc  chore: no need to make it look one needs to create an issue on top of a PR
    omit 703e6c5  Fix cluster upgrades when deploying ddoc_cache
     new 54ac3ad  add ability to ignore javascript test suites

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (9651c3f)
            \
             N -- N -- N   refs/heads/flexible-js-tests (54ac3ad)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .github/PULL_REQUEST_TEMPLATE.md                   |  11 +-
 INSTALL.Unix.md                                    |   5 -
 Jenkinsfile                                        |  83 ++++---------
 README-DEV.rst                                     |  11 +-
 src/ddoc_cache/src/ddoc_cache_lru.erl              |   7 +-
 src/mango/src/mango_cursor.erl                     |   2 +-
 src/mango/src/mango_cursor_view.erl                |  23 +---
 src/mango/src/mango_error.erl                      |   2 +-
 src/mango/src/mango_idx.erl                        |  55 ++++-----
 src/mango/src/mango_idx_special.erl                |   4 +-
 src/mango/src/mango_idx_text.erl                   |   4 +-
 src/mango/src/mango_idx_view.erl                   |  18 +--
 src/mango/src/mango_idx_view.hrl                   |  13 --
 src/mango/src/mango_selector.erl                   |   2 +-
 src/mango/test/01-index-crud-test.py               | 126 +++++++------------
 src/mango/test/02-basic-find-test.py               |  48 +-------
 src/mango/test/03-operator-test.py                 |   5 -
 src/mango/test/05-index-selection-test.py          | 137 ++++++++++-----------
 src/mango/test/09-text-sort-test.py                |  50 ++++----
 .../test/10-disable-array-length-field-test.py     |  14 ++-
 ...esign-docs-test.py => 11-ignore-design-docs.py} |   0
 ...rrect-index-test.py => 12-use-correct-index.py} |  17 +--
 ...on-pagination-test.py => 14-json-pagination.py} |   0
 ...dex-selectors-test.py => 16-index-selectors.py} |  30 -----
 src/mango/test/17-multi-type-value-test.py         |  90 --------------
 src/mango/test/README.md                           |  23 +---
 src/mango/test/mango.py                            |  36 ++----
 27 files changed, 237 insertions(+), 579 deletions(-)
 delete mode 100644 src/mango/src/mango_idx_view.hrl
 rename src/mango/test/{11-ignore-design-docs-test.py => 11-ignore-design-docs.py} (100%)
 rename src/mango/test/{12-use-correct-index-test.py => 12-use-correct-index.py} (86%)
 rename src/mango/test/{14-json-pagination-test.py => 14-json-pagination.py} (100%)
 rename src/mango/test/{16-index-selectors-test.py => 16-index-selectors.py} (90%)
 delete mode 100644 src/mango/test/17-multi-type-value-test.py

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].

[couchdb] 01/01: add ability to ignore javascript test suites

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

tonysun83 pushed a commit to branch flexible-js-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 54ac3adaabbac689cf344dfc9c53abd137c8ecbb
Author: Tony Sun <to...@gmail.com>
AuthorDate: Fri Oct 13 23:06:34 2017 -0700

    add ability to ignore javascript test suites
    
    Developers can now ignore javascript test suites with the new option
    ignore_js_suites.
    
    Example usage:
    
    make javascript ignore_js_suites="all_docs basics"
    make javascript suites="all_docs basics view_errors" ignore_js_suites=
    "view_errors"
    
    The second example is redundant but the functionality works.
---
 Makefile            |  8 ++++++--
 README-DEV.rst      | 11 +++++++++--
 test/javascript/run | 57 +++++++++++++++++++++++++++++++++++++----------------
 3 files changed, 55 insertions(+), 21 deletions(-)

diff --git a/Makefile b/Makefile
index 239a2db..2c4bca5 100644
--- a/Makefile
+++ b/Makefile
@@ -36,6 +36,8 @@ DIALYZE_OPTS=$(shell echo "\
 	skip_deps=$(skip_deps) \
 	" | sed -e 's/[a-z]\+= / /g')
 
+#ignore javascript tests
+ignore_js_suites=
 
 ################################################################################
 # Main commands
@@ -123,7 +125,8 @@ endif
 	@rm -rf dev/lib
 	@dev/run -n 1 -q --with-admin-party-please \
             -c 'startup_jitter=0' \
-            test/javascript/run $(suites)
+            'test/javascript/run --suites "$(suites)" \
+            --ignore "$(ignore_js_suites)"'
 
 .PHONY: soak-javascript
 soak-javascript:
@@ -138,7 +141,8 @@ endif
 	while [ $$? -eq 0 ]; do \
 		dev/run -n 1 -q --with-admin-party-please \
 				-c 'startup_jitter=0' \
-				test/javascript/run $(suites); \
+				'test/javascript/run --suites "$(suites)" \
+				--ignore "$(ignore_js_suites)"'  \
 	done
 
 .PHONY: check-qs
diff --git a/README-DEV.rst b/README-DEV.rst
index 613aea2..f8d80ac 100644
--- a/README-DEV.rst
+++ b/README-DEV.rst
@@ -173,8 +173,15 @@ JavaScript tests accepts only `suites` option, but in the same way::
     # Run only basic and design_options tests
     make javascript suites="basic design_options"
 
-Note that tests are delimited here by whitespace, not by comma. You can get list
-of all possible test targets with the following command::
+    # Ignore specific test suites via command line
+    make javascript ignore_js_suites="all_docs bulk_docs"
+
+    # Ignore specific test suites in makefile
+    ignore_js_suites=all_docs,bulk_docs
+
+Note that tests on the command line are delimited here by whitespace,
+not by comma.You can get list of all possible test targets with the
+following command::
 
     make list-js-suites
 
diff --git a/test/javascript/run b/test/javascript/run
index f7659b0..96b3a56 100755
--- a/test/javascript/run
+++ b/test/javascript/run
@@ -17,6 +17,7 @@ import optparse as op
 import os
 import subprocess as sp
 import sys
+import re
 
 
 USAGE = "%prog [options] [command to run...]"
@@ -100,7 +101,13 @@ def options():
                        help="Start from the given filename if multiple files "
                             "are passed"),
         op.make_option("-a", "--all", action="store_true", dest="all",
-                       help="Run all tests, even if one or more fail")
+                       help="Run all tests, even if one or more fail"),
+        op.make_option("-i", "--ignore", type="string", action="callback",
+                       default=None, callback=get_delimited_list,
+                       dest="ignore", help="Ignore test suites"),
+        op.make_option("-u", "--suites", type="string", action="callback",
+                       default=None, callback=get_delimited_list,
+                       dest="suites", help="Run specific suites")
     ]
 
 
@@ -108,23 +115,15 @@ def main():
     parser = op.OptionParser(usage=USAGE, option_list=options())
     opts, args = parser.parse_args()
 
+    run_list = []
+    ignore_list = []
     tests = []
-    if not len(args):
-        args = ["test/javascript/tests"]
-    for name in args:
-        if os.path.isdir(name):
-            tests.extend(sorted(glob.glob(os.path.join(name, "*.js"))))
-        elif os.path.isfile(name):
-            tests.append(name)
-        else:
-            pname = os.path.join("test/javascript/tests", name)
-            if os.path.isfile(pname):
-                tests.append(pname)
-            elif os.path.isfile(pname + ".js"):
-                tests.append(pname + ".js")
-            else:
-                sys.stderr.write("Unknown test: " + name + os.linesep)
-                exit(1)
+
+    run_list = ["test/javascript/tests"] if not opts.suites else opts.suites
+    run_list = build_test_case_paths(run_list)
+    ignore_list = build_test_case_paths(opts.ignore)
+    # sort is needed because certain tests fail if executed out of order
+    tests = sorted(list(set(run_list)-set(ignore_list)))
 
     if opts.start is not None:
         tmp = []
@@ -152,6 +151,30 @@ def main():
         failed, passed) + os.linesep)
     exit(failed > 0)
 
+def build_test_case_paths(args=None):
+    tests = []
+    if args is None:
+        args = []
+    for name in args:
+        if os.path.isdir(name):
+            tests.extend(sorted(glob.glob(os.path.join(name, "*.js"))))
+        elif os.path.isfile(name):
+            check = tests.append(name)
+        else:
+            pname = os.path.join("test/javascript/tests", name)
+            if os.path.isfile(pname):
+                tests.append(pname)
+            elif os.path.isfile(pname + ".js"):
+                tests.append(pname + ".js")
+            else:
+                sys.stderr.write("Unknown test: " + name + os.linesep)
+                exit(1)
+    return tests
+
+
+def get_delimited_list(option, opt, value, parser):
+    delimited = [i for i in re.split(r',|\s', value.strip()) if i]
+    setattr(parser.values, option.dest, delimited)
 
 if __name__ == "__main__":
     try:

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.