提交 dabc9390 编写于 作者: C Cleber Rosa

Multiplexer: formally introduce --multiplex option to run

And deprecate the --multiplex-files option, which was actually
the complete name of the option, but was not being used formally
by our documentation.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 2e86a17d
...@@ -132,7 +132,7 @@ class RemoteTestRunner(TestRunner): ...@@ -132,7 +132,7 @@ class RemoteTestRunner(TestRunner):
for mux_file in getattr(self.job.args, for mux_file in getattr(self.job.args,
'multiplex_files') or []] 'multiplex_files') or []]
if mux_files: if mux_files:
extra_params.append("--multiplex-files %s" % " ".join(mux_files)) extra_params.append("--multiplex %s" % " ".join(mux_files))
if getattr(self.job.args, "dry_run", False): if getattr(self.job.args, "dry_run", False):
extra_params.append("--dry-run") extra_params.append("--dry-run")
......
...@@ -100,7 +100,7 @@ class Replay(CLI): ...@@ -100,7 +100,7 @@ class Replay(CLI):
err = None err = None
if args.replay_teststatus and args.multiplex_files: if args.replay_teststatus and args.multiplex_files:
err = ("Option --replay-test-status is incompatible with " err = ("Option --replay-test-status is incompatible with "
"--multiplex-files.") "--multiplex.")
elif args.replay_teststatus and args.url: elif args.replay_teststatus and args.url:
err = ("Option --replay-test-status is incompatible with " err = ("Option --replay-test-status is incompatible with "
"test URLs given on the command line.") "test URLs given on the command line.")
......
...@@ -128,10 +128,13 @@ class Run(CLICmd): ...@@ -128,10 +128,13 @@ class Run(CLICmd):
if multiplexer.MULTIPLEX_CAPABLE: if multiplexer.MULTIPLEX_CAPABLE:
mux = parser.add_argument_group('multiplexer use on test execution') mux = parser.add_argument_group('multiplexer use on test execution')
mux.add_argument('-m', '--multiplex-files', nargs='*', mux.add_argument('-m', '--multiplex', nargs='*', dest='multiplex_files',
default=None, metavar='FILE', default=None, metavar='FILE',
help='Location of one or more Avocado multiplex (.yaml) ' help='Location of one or more Avocado multiplex (.yaml) '
'FILE(s) (order dependent)') 'FILE(s) (order dependent)')
mux.add_argument('--multiplex-files', nargs='*',
default=None, metavar='FILE',
help='DEPRECATED: please use --multiplex instead')
mux.add_argument('--filter-only', nargs='*', default=[], mux.add_argument('--filter-only', nargs='*', default=[],
help='Filter only path(s) from multiplexing') help='Filter only path(s) from multiplexing')
mux.add_argument('--filter-out', nargs='*', default=[], mux.add_argument('--filter-out', nargs='*', default=[],
......
...@@ -39,7 +39,7 @@ The replay feature will retrieve the original job urls, the multiplex ...@@ -39,7 +39,7 @@ The replay feature will retrieve the original job urls, the multiplex
tree and the configuration. Let's see another example, now using tree and the configuration. Let's see another example, now using
multiplex file:: multiplex file::
$ avocado run /bin/true /bin/false --multiplex-files mux-environment.yaml $ avocado run /bin/true /bin/false --multiplex mux-environment.yaml
JOB ID : bd6aa3b852d4290637b5e771b371537541043d1d JOB ID : bd6aa3b852d4290637b5e771b371537541043d1d
JOB LOG : $HOME/avocado/job-results/job-2016-01-11T21.56-bd6aa3b/job.log JOB LOG : $HOME/avocado/job-results/job-2016-01-11T21.56-bd6aa3b/job.log
TESTS : 48 TESTS : 48
......
...@@ -286,7 +286,7 @@ file (multiplex file) that produced the output above is:: ...@@ -286,7 +286,7 @@ file (multiplex file) that produced the output above is::
You can execute `sleeptest` in all variations exposed above with: You can execute `sleeptest` in all variations exposed above with:
$ avocado run sleeptest --multiplex-files examples/tests/sleeptest.py.data/sleeptest.yaml $ avocado run sleeptest --multiplex examples/tests/sleeptest.py.data/sleeptest.yaml
And the output should look like:: And the output should look like::
...@@ -313,13 +313,13 @@ the `filter-out` removes one or more paths from being processed. ...@@ -313,13 +313,13 @@ the `filter-out` removes one or more paths from being processed.
From the previous example, if we are interested to use the variants `/run/medium` From the previous example, if we are interested to use the variants `/run/medium`
and `/run/longest`, we do the following command line:: and `/run/longest`, we do the following command line::
$ avocado run sleeptest --multiplex-files examples/tests/sleeptest.py.data/sleeptest.yaml \ $ avocado run sleeptest --multiplex examples/tests/sleeptest.py.data/sleeptest.yaml \
--filter-only /run/medium /run/longest --filter-only /run/medium /run/longest
And if you want to remove `/small` from the variants created, And if you want to remove `/small` from the variants created,
we do the following:: we do the following::
$ avocado run sleeptest --multiplex-files examples/tests/sleeptest.py.data/sleeptest.yaml \ $ avocado run sleeptest --multiplex examples/tests/sleeptest.py.data/sleeptest.yaml \
--filter-out /run/medium --filter-out /run/medium
Note that both `--filter-only` and `--filter-out` filters can be arranged in Note that both `--filter-only` and `--filter-out` filters can be arranged in
......
...@@ -126,7 +126,7 @@ class ReplayTests(unittest.TestCase): ...@@ -126,7 +126,7 @@ class ReplayTests(unittest.TestCase):
expected_rc = exit_codes.AVOCADO_FAIL expected_rc = exit_codes.AVOCADO_FAIL
result = self.run_and_check(cmd_line, expected_rc) result = self.run_and_check(cmd_line, expected_rc)
msg = "Option --replay-test-status is incompatible with "\ msg = "Option --replay-test-status is incompatible with "\
"--multiplex-files." "--multiplex."
self.assertIn(msg, result.stderr) self.assertIn(msg, result.stderr)
def test_run_replay_status_and_urls(self): def test_run_replay_status_and_urls(self):
......
...@@ -103,7 +103,7 @@ _=/usr/bin/env''', exit_status=0) ...@@ -103,7 +103,7 @@ _=/usr/bin/env''', exit_status=0)
args = ("cd ~/avocado/tests; avocado run --force-job-id sleeptest.1 " args = ("cd ~/avocado/tests; avocado run --force-job-id sleeptest.1 "
"--json - --archive /tests/sleeptest /tests/other/test " "--json - --archive /tests/sleeptest /tests/other/test "
"passtest --multiplex-files ~/avocado/tests/foo.yaml " "passtest --multiplex ~/avocado/tests/foo.yaml "
"~/avocado/tests/bar/baz.yaml --dry-run") "~/avocado/tests/bar/baz.yaml --dry-run")
(Remote.should_receive('run') (Remote.should_receive('run')
.with_args(args, timeout=61, ignore_status=True) .with_args(args, timeout=61, ignore_status=True)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册