diff options
Diffstat (limited to 'functest/cli/commands')
-rw-r--r-- | functest/cli/commands/cli_testcase.py | 17 | ||||
-rw-r--r-- | functest/cli/commands/cli_tier.py | 17 |
2 files changed, 20 insertions, 14 deletions
diff --git a/functest/cli/commands/cli_testcase.py b/functest/cli/commands/cli_testcase.py index d019632a..b6566245 100644 --- a/functest/cli/commands/cli_testcase.py +++ b/functest/cli/commands/cli_testcase.py @@ -42,7 +42,14 @@ class CliTestcase: click.echo(description) @staticmethod - def run(testname, noclean=False): + def run(testname, noclean=False, report=False): + + flags = "" + if noclean: + flags += "-n " + if report: + flags += "-r " + if testname == 'vacation': vacation.main() elif not os.path.isfile(CONST.env_active): @@ -51,10 +58,6 @@ class CliTestcase: else: tests = testname.split(",") for test in tests: - if noclean: - cmd = ("python %s/functest/ci/run_tests.py " - "-n -t %s" % (CONST.dir_repo_functest, test)) - else: - cmd = ("python %s/functest/ci/run_tests.py " - "-t %s" % (CONST.dir_repo_functest, test)) + cmd = ("python %s/functest/ci/run_tests.py " + "%s -t %s" % (CONST.dir_repo_functest, flags, test)) ft_utils.execute_command(cmd) diff --git a/functest/cli/commands/cli_tier.py b/functest/cli/commands/cli_tier.py index 01208498..b9d25b6d 100644 --- a/functest/cli/commands/cli_tier.py +++ b/functest/cli/commands/cli_tier.py @@ -54,15 +54,18 @@ class CliTier: click.echo("Test cases in tier '%s':\n %s\n" % (tiername, tests)) @staticmethod - def run(tiername, noclean=False): + def run(tiername, noclean=False, report=False): + + flags = "" + if noclean: + flags += "-n " + if report: + flags += "-r " + if not os.path.isfile(CONST.env_active): click.echo("Functest environment is not ready. " "Run first 'functest env prepare'") else: - if noclean: - cmd = ("python %s/functest/ci/run_tests.py " - "-n -t %s" % (CONST.dir_repo_functest, tiername)) - else: - cmd = ("python %s/functest/ci/run_tests.py " - "-t %s" % (CONST.dir_repo_functest, tiername)) + cmd = ("python %s/functest/ci/run_tests.py " + "%s -t %s" % (CONST.dir_repo_functest, flags, tiername)) ft_utils.execute_command(cmd) |