2020-07-02 15:58:13 +00:00
|
|
|
import os
|
|
|
|
|
2020-10-15 20:23:49 +00:00
|
|
|
def onoff(v):
|
|
|
|
if v in ["yes", "1", "on"]:
|
|
|
|
return True
|
|
|
|
elif v in ["no", "0", "off"]:
|
|
|
|
return False
|
|
|
|
raise ValueError(f"invalid {v}")
|
|
|
|
|
2020-07-02 15:58:13 +00:00
|
|
|
def argparser(parser):
|
|
|
|
"""Default argument parser for regressions.
|
|
|
|
"""
|
2020-07-28 20:14:52 +00:00
|
|
|
parser.add_argument("--local",
|
2020-07-02 15:58:13 +00:00
|
|
|
action="store_true",
|
|
|
|
help="run regression in local mode", default=False)
|
2020-07-28 20:14:52 +00:00
|
|
|
|
|
|
|
parser.add_argument("--clickhouse-binary-path",
|
2020-07-02 15:58:13 +00:00
|
|
|
type=str, dest="clickhouse_binary_path",
|
|
|
|
help="path to ClickHouse binary, default: /usr/bin/clickhouse", metavar="path",
|
2020-10-15 20:23:49 +00:00
|
|
|
default=os.getenv("CLICKHOUSE_TESTS_SERVER_BIN_PATH", "/usr/bin/clickhouse"))
|
|
|
|
|
|
|
|
parser.add_argument("--stress", action="store_true", default=False,
|
|
|
|
help="enable stress testing (might take a long time)")
|
|
|
|
|
|
|
|
parser.add_argument("--parallel", type=onoff, default=True, choices=["yes", "no", "on", "off", 0, 1],
|
|
|
|
help="enable parallelism for tests that support it")
|