From 3f8cb244e2ed0ed26178cb10987d16fd87aaaf1f Mon Sep 17 00:00:00 2001 From: PhilipDeegan Date: Thu, 6 Jun 2024 20:46:44 +0200 Subject: [PATCH] reverse order tests (#25) --- phlop/run/test_cases.py | 7 +++++++ pyproject.toml | 2 +- setup.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/phlop/run/test_cases.py b/phlop/run/test_cases.py index 83a7394..43ef29e 100644 --- a/phlop/run/test_cases.py +++ b/phlop/run/test_cases.py @@ -29,6 +29,7 @@ def cli_args_parser(): dump="Dump discovered tests as YAML, no execution", load="Run tests exported from dump", regex="Filter out non-matching execution strings", + reverse="reverse order - higher core count tests preferred", logging="0=off, 1=on non zero exit code, 2=always", ) @@ -48,6 +49,9 @@ def cli_args_parser(): ) parser.add_argument("--load", default=None, help=_help.load) parser.add_argument("-r", "--regex", default=None, help=_help.regex) + parser.add_argument( + "-R", "--reverse", action="store_true", default=False, help=_help.reverse + ) parser.add_argument("--logging", type=int, default=1, help=_help.logging) return parser @@ -153,6 +157,9 @@ def main(): else: test_batches = log(test_batches) + if cli_args.reverse: + test_batches = list(reversed(test_batches)) + pp.process( test_batches, n_cores=cli_args.cores, diff --git a/pyproject.toml b/pyproject.toml index 964e51a..98268d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "phlop" -version = "0.0.21" +version = "0.0.22" dependencies = [ diff --git a/setup.py b/setup.py index 5c3240e..cc236fa 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="phlop", - version="0.0.21", + version="0.0.22", cmdclass={}, classifiers=[], include_package_data=True,