Skip to content

Commit

Permalink
allow to elevate log_level to debug from Makefile for make simple-test
Browse files Browse the repository at this point in the history
Change-Id: I62e8949d640f4660d89e72cda7ebe9e7765e8fc3
Reviewed-on: http://review.couchbase.org/75711
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Arunkumar Senthilnathan <arun.couchbase@yahoo.com>
  • Loading branch information
vzasade committed Mar 31, 2017
1 parent 5766ca1 commit d87dde8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -3,6 +3,7 @@ DIRS=b conf lib longevity pytests resources scripts unittests
FILES=Makefile README TestInput.py
SLEEP_TIME=3
VERBOSE=0
DEBUG=0
TESTNAME=conf/py-all-dev.conf

.PHONY: clean testrunner test test-quick
Expand All @@ -24,7 +25,7 @@ dcp-test:
python testrunner.py -i b/resources/dev-4-nodes.ini -c conf/py-dcp.conf -p skip_cleanup=False,dev=True,test=$(TEST)

simple-test:
python scripts/start_cluster_and_run_tests.py $(MAKE) b/resources/dev-4-nodes-xdcr.ini conf/simple.conf $(VERBOSE)
python scripts/start_cluster_and_run_tests.py $(MAKE) b/resources/dev-4-nodes-xdcr.ini conf/simple.conf $(VERBOSE) $(DEBUG)

#test-views:
# scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes.ini conf/py-view.conf
Expand Down
20 changes: 18 additions & 2 deletions scripts/start_cluster_and_run_tests.py
Expand Up @@ -56,7 +56,7 @@ def ns_clean(make, verbose = 1):

clean or sys.exit(-1)

def run_test(ini, conf, verbose):
def run_test(ini, conf, verbose, debug):
""" run testrunner process """

rc = -1
Expand All @@ -68,6 +68,10 @@ def run_test(ini, conf, verbose):

if verbose == 0:
params += ",log_level=CRITICAL"
else:
if debug == 1:
params += ",log_level=DEBUG"

args.extend(["-p", params])

r, w = os.pipe()
Expand Down Expand Up @@ -95,6 +99,17 @@ def get_verbosity():
exit_with_help()
return 1

def get_debug():
""" 1 = debug, 0 = info """

if len(sys.argv) > 5:
try:
return int(sys.argv[5])
except TypeError:
print "Error: debug must be a numerical value"
exit_with_help()
return 1

def main():

# parse env vars
Expand All @@ -103,6 +118,7 @@ def main():
ini = sys.argv[2]
conf = sys.argv[3]
verbose = get_verbosity()
debug = get_debug()
num_nodes = parse_ini_servers(ini)


Expand All @@ -113,7 +129,7 @@ def main():
assert crm.start_nodes()

# run test
rc = run_test(ini, conf, verbose)
rc = run_test(ini, conf, verbose, debug)

# done
crm.stop_nodes()
Expand Down

0 comments on commit d87dde8

Please sign in to comment.