From dabc939056e1aff25716cfee8760d4f17da8fe64 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Wed, 16 Mar 2016 15:31:00 -0300 Subject: [PATCH] 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: Cleber Rosa --- avocado/core/remote/runner.py | 2 +- avocado/plugins/replay.py | 2 +- avocado/plugins/run.py | 5 ++++- docs/source/Replay.rst | 2 +- man/avocado.rst | 6 +++--- selftests/functional/test_replay_basic.py | 2 +- selftests/unit/test_remote.py | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/avocado/core/remote/runner.py b/avocado/core/remote/runner.py index 5884a4c2..d14e73f1 100644 --- a/avocado/core/remote/runner.py +++ b/avocado/core/remote/runner.py @@ -132,7 +132,7 @@ class RemoteTestRunner(TestRunner): for mux_file in getattr(self.job.args, 'multiplex_files') or []] 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): extra_params.append("--dry-run") diff --git a/avocado/plugins/replay.py b/avocado/plugins/replay.py index 9953b2d5..65cd296b 100644 --- a/avocado/plugins/replay.py +++ b/avocado/plugins/replay.py @@ -100,7 +100,7 @@ class Replay(CLI): err = None if args.replay_teststatus and args.multiplex_files: err = ("Option --replay-test-status is incompatible with " - "--multiplex-files.") + "--multiplex.") elif args.replay_teststatus and args.url: err = ("Option --replay-test-status is incompatible with " "test URLs given on the command line.") diff --git a/avocado/plugins/run.py b/avocado/plugins/run.py index e4430006..58ec4057 100644 --- a/avocado/plugins/run.py +++ b/avocado/plugins/run.py @@ -128,10 +128,13 @@ class Run(CLICmd): if multiplexer.MULTIPLEX_CAPABLE: 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', help='Location of one or more Avocado multiplex (.yaml) ' '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=[], help='Filter only path(s) from multiplexing') mux.add_argument('--filter-out', nargs='*', default=[], diff --git a/docs/source/Replay.rst b/docs/source/Replay.rst index b9a1c314..d2835c14 100644 --- a/docs/source/Replay.rst +++ b/docs/source/Replay.rst @@ -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 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 LOG : $HOME/avocado/job-results/job-2016-01-11T21.56-bd6aa3b/job.log TESTS : 48 diff --git a/man/avocado.rst b/man/avocado.rst index 7f873ca4..a939ae24 100644 --- a/man/avocado.rst +++ b/man/avocado.rst @@ -286,7 +286,7 @@ file (multiplex file) that produced the output above is:: 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:: @@ -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` 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 And if you want to remove `/small` from the variants created, 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 Note that both `--filter-only` and `--filter-out` filters can be arranged in diff --git a/selftests/functional/test_replay_basic.py b/selftests/functional/test_replay_basic.py index 2dae91c7..1ad3f4da 100644 --- a/selftests/functional/test_replay_basic.py +++ b/selftests/functional/test_replay_basic.py @@ -126,7 +126,7 @@ class ReplayTests(unittest.TestCase): expected_rc = exit_codes.AVOCADO_FAIL result = self.run_and_check(cmd_line, expected_rc) msg = "Option --replay-test-status is incompatible with "\ - "--multiplex-files." + "--multiplex." self.assertIn(msg, result.stderr) def test_run_replay_status_and_urls(self): diff --git a/selftests/unit/test_remote.py b/selftests/unit/test_remote.py index b22071f0..052ffb9d 100644 --- a/selftests/unit/test_remote.py +++ b/selftests/unit/test_remote.py @@ -103,7 +103,7 @@ _=/usr/bin/env''', exit_status=0) args = ("cd ~/avocado/tests; avocado run --force-job-id sleeptest.1 " "--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") (Remote.should_receive('run') .with_args(args, timeout=61, ignore_status=True) -- GitLab