[CRIU] [PATCH] zdtm: allow --keep-going anytime when running multiple tests

Mike Rapoport mike.rapoport at gmail.com
Thu Dec 1 03:00:01 PST 2016


On Thu, Dec 1, 2016 at 12:03 PM, Pavel Emelyanov <xemul at virtuozzo.com> wrote:
> On 12/01/2016 12:40 PM, Mike Rapoport wrote:
>> Currently it's possible to continue testing despite failures only when
>> running zdtm.py with --all option. Let's make --keep-going option also
>> valid when more than one test is requested with --tests or --from.
>
> OK, but one question below.
>
>> Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
>> ---
>>  test/zdtm.py | 9 +++++----
>>  1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/test/zdtm.py b/test/zdtm.py
>> index a17cce4..8b0dda6 100755
>> --- a/test/zdtm.py
>> +++ b/test/zdtm.py
>> @@ -1521,8 +1521,7 @@ def run_tests(opts):
>>                       print "Tracking memory is not available"
>>                       return
>>
>> -     if opts['keep_going'] and (not opts['all']):
>> -             print "[WARNING] Option --keep-going is more useful with option --all."
>> +     opts['keep_going'] = opts['keep_going'] and True or False
>
> What does it mean?

if opts['keep_going' is not None:
        opts['keep_going'] = True
else
        opts['keep_going'] = False

>>
>>       if opts['all']:
>>               torun = all_tests(opts)
>> @@ -1530,11 +1529,9 @@ def run_tests(opts):
>>       elif opts['tests']:
>>               r = re.compile(opts['tests'])
>>               torun = filter(lambda x: r.match(x), all_tests(opts))
>> -             opts['keep_going'] = False
>>               run_all = True
>>       elif opts['test']:
>>               torun = opts['test']
>> -             opts['keep_going'] = False
>>               run_all = False
>>       elif opts['from']:
>>               if not os.access(opts['from'], os.R_OK):
>> @@ -1548,6 +1545,10 @@ def run_tests(opts):
>>               print "Specify test with -t <name> or -a"
>>               return
>>
>> +     if opts['keep_going'] and len(torun) < 2:
>> +             print "[WARNING] Option --keep-going is more useful when running multiple tests"
>> +             opts['keep_going'] = False
>> +
>>       if opts['exclude']:
>>               excl = re.compile(".*(" + "|".join(opts['exclude']) + ")")
>>               print "Compiled exclusion list"
>>
>



-- 
Sincerely yours,
Mike.


More information about the CRIU mailing list