This is an automated email from the ASF dual-hosted git repository. davisp pushed a commit to branch elixir-suite in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 53dc90fd2ad5f39553b09c6895315737bf09147f Author: Paul J. Davis <[email protected]> AuthorDate: Fri Dec 15 12:08:33 2017 -0600 Integrate Elixir suite with `make` --- Makefile | 5 +++++ dev/run | 25 ++++++++++++++++--------- test/elixir/run | 4 ++++ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 248dddc..26a5905 100644 --- a/Makefile +++ b/Makefile @@ -112,6 +112,11 @@ soak-eunit: couch @$(REBAR) setup_eunit 2> /dev/null while [ $$? -eq 0 ] ; do $(REBAR) -r eunit $(EUNIT_OPTS) ; done +.PHONY: elixir +elixir: + @rm -rf dev/lib + @dev/run -a adm:pass --no-eval test/elixir/run + .PHONY: javascript # target: javascript - Run JavaScript test suites or specific ones defined by suites option javascript: diff --git a/dev/run b/dev/run index 4924de1..bdd0d0b 100755 --- a/dev/run +++ b/dev/run @@ -130,6 +130,8 @@ def setup_argparse(): help='The node number to seed them when creating the node(s)') parser.add_option('-c', '--config-overrides', action="append", default=[], help='Optional key=val config overrides. Can be repeated') + parser.add_option('--no-eval', action='store_true', default=False, + help='Do not eval subcommand output') return parser.parse_args() @@ -150,6 +152,7 @@ def setup_context(opts, args): 'haproxy': opts.haproxy, 'haproxy_port': opts.haproxy_port, 'config_overrides': opts.config_overrides, + 'no_eval': opts.no_eval, 'reset_logs': True, 'procs': []} @@ -549,15 +552,19 @@ def join(ctx, lead_port, user, password): @log('Exec command {cmd}') def run_command(ctx, cmd): - p = sp.Popen(cmd, shell=True, stdout=sp.PIPE, stderr=sys.stderr) - while True: - line = p.stdout.readline() - if not line: - break - eval(line) - p.wait() - exit(p.returncode) - + if ctx['no_eval']: + p = sp.Popen(cmd, shell=True) + p.wait() + exit(p.returncode) + else: + p = sp.Popen(cmd, shell=True, stdout=sp.PIPE, stderr=sys.stderr) + while True: + line = p.stdout.readline() + if not line: + break + eval(line) + p.wait() + exit(p.returncode) @log('Restart all nodes') def reboot_nodes(ctx): diff --git a/test/elixir/run b/test/elixir/run new file mode 100755 index 0000000..66a5947 --- /dev/null +++ b/test/elixir/run @@ -0,0 +1,4 @@ +#!/bin/bash -e +cd "$(dirname "$0")" +mix deps.get +mix test --trace -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
