[Piglit] [PATCH 3/3] framework/resume: properly parse the no_retry option

Dylan Baker dylan at pnwbakers.com
Wed May 30 20:25:41 UTC 2018


Quoting Marek Olšák (2018-05-30 13:04:48)
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
> 
> ---
>  framework/programs/run.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/framework/programs/run.py b/framework/programs/run.py
> index bbc527b55..a970845dc 100644
> --- a/framework/programs/run.py
> +++ b/framework/programs/run.py
> @@ -377,20 +377,22 @@ def run(input_):
>  
>      time_elapsed.end = time.time()
>      backend.finalize({'time_elapsed': time_elapsed.to_json()})
>  
>      print('Thank you for running Piglit!\n'
>            'Results have been written to ' + args.results_path)
>  
>  
>  @exceptions.handler
>  def resume(input_):
> +    unparsed = parsers.parse_config(input_)[1]
> +
>      parser = argparse.ArgumentParser()
>      parser.add_argument("results_path",
>                          type=path.realpath,
>                          metavar="<Results Path>",
>                          help="Path to results folder")
>      parser.add_argument("-f", "--config",
>                          dest="config_file",
>                          type=argparse.FileType("r"),
>                          help="Optionally specify a piglit config file to use. "
>                               "Default is piglit.conf")
> @@ -399,32 +401,31 @@ def resume(input_):
>                          action="store_true",
>                          help="Do not retry incomplete tests")
>      parser.add_argument('-j', '--jobs',
>                          dest='jobs',
>                          action='store',
>                          type=int,
>                          default=core.PIGLIT_CONFIG.safe_get(
>                              'core', 'jobs', '-1'),
>                          help='Set the maximum number of jobs to run concurrently. '
>                               'By default, the reported number of CPUs is used.')
> -    args = parser.parse_args(input_)
> +    args = parser.parse_args(unparsed)
>      _disable_windows_exception_messages()
>  
>      results = backends.load(args.results_path)
>      options.OPTIONS.execute = results.options['execute']
>      options.OPTIONS.valgrind = results.options['valgrind']
>      options.OPTIONS.sync = results.options['sync']
>      options.OPTIONS.deqp_mustpass = results.options['deqp_mustpass']
>      options.OPTIONS.process_isolation = results.options['process_isolation']
>      options.OPTIONS.jobs = args.jobs
> -
> -    core.get_config(args.config_file)

I'd have to think really hard about whether dropping this line is actually safe,
since it loads the config file you passed and that can be used to set things
like the compression to use.

Without this line removed:
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>

> +    options.OPTIONS.no_retry = args.no_retry
>  
>      options.OPTIONS.env['PIGLIT_PLATFORM'] = results.options['platform']
>  
>      results.options['env'] = core.collect_system_info()
>      results.options['name'] = results.name
>  
>      # Resume only works with the JSON backend
>      backend = backends.get_backend('json')(
>          args.results_path,
>          file_start_count=len(results.tests) + 1)
> -- 
> 2.17.0
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20180530/085d4e5e/attachment.sig>


More information about the Piglit mailing list