Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
Cc: tarantool-patches@freelists.org, tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2] Add exclude option
Date: Fri, 18 Oct 2019 08:54:28 +0300	[thread overview]
Message-ID: <20191018055428.pqiffdfa4lkjjnle@tkn_work_nb> (raw)
In-Reply-To: <c30cba20e4a4b9fdaa28315fc26fb76c41824592.1571376225.git.avtikhon@tarantool.org>

Say, we have the following tests:

* foo/bar.test.lua
* foobar/bar.test.lua
* bar/foo.test.lua
* bar/foobar.test.lua

`./test-run.py foo` includes all of them. We can include only ones that
in `foo` test suite using `./test-run.py foo/`. In other words, test-run
just match suite/test by a substring. I found this way convenient and
propose to use it for --exclude too.

BTW, excluding tests is that the issue is requested.

Tests are filtered here (for tarantool tests, see app and unittest too):
https://github.com/tarantool/test-run/blob/eee42cbdbffe36fc206f4e81688bf1b49586475a/lib/tarantool_server.py#L1108-L1111

WBR, Alexander Turenko.

On Fri, Oct 18, 2019 at 08:25:35AM +0300, Alexander V. Tikhonov wrote:
> Added exclude option to be able to exclude the suites
> from testing, it means that exclude option even excludes
> the suites given with option suite.
> 
> Close #54
> ---
> 
> Github: https://github.com/tarantool/test-run/tree/avtikhon/gh-54-exclude-option
> Issue: https://github.com/tarantool/test-run/issues/54
> 
>  lib/options.py | 9 +++++++++
>  lib/worker.py  | 7 +++++--
>  2 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/options.py b/lib/options.py
> index 94dbd17..5270232 100644
> --- a/lib/options.py
> +++ b/lib/options.py
> @@ -58,6 +58,15 @@ class Options:
>                  help="""List of test suites to look for tests in. Default: "" -
>                  means find all available.""")
>  
> +        parser.add_argument(
> +                "--exclude",
> +                dest = 'exclude',
> +                metavar = "exclude",
> +                nargs="*",
> +                default = [],
> +                help = """List of test suites to exclude from testing. Default: "" -
> +                means no suites to exclude""")
> +
>          parser.add_argument(
>                  "--verbose",
>                  dest='is_verbose',
> diff --git a/lib/worker.py b/lib/worker.py
> index 86852fa..db3dea7 100644
> --- a/lib/worker.py
> +++ b/lib/worker.py
> @@ -25,8 +25,11 @@ def find_suites():
>              if "suite.ini" in names:
>                  suite_names.append(os.path.basename(root))
>  
> -    suites = [TestSuite(suite_name, lib.Options().args)
> -              for suite_name in sorted(suite_names)]
> +    exclude_names = lib.Options().args.exclude
> +    suites = []
> +    for suite_name in sorted(suite_names):
> +        if suite_name not in exclude_names:
> +            suites.append(TestSuite(suite_name, lib.Options().args))
>      return suites
>  
>  
> -- 
> 2.17.1
> 

           reply	other threads:[~2019-10-18  5:54 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <c30cba20e4a4b9fdaa28315fc26fb76c41824592.1571376225.git.avtikhon@tarantool.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191018055428.pqiffdfa4lkjjnle@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] Add exclude option' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox