[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH XTF 1/3] xtf-runner: sync all test states



On 21/07/2016 16:44, Wei Liu wrote:
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
>  xtf-runner | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/xtf-runner b/xtf-runner
> index 50a5e96..ad7dcf9 100755
> --- a/xtf-runner
> +++ b/xtf-runner
> @@ -17,6 +17,9 @@ try:
>  except ImportError:
>      import simplejson as json
>  
> +# All states of a test, keep in sync with C code report.h.
> +# Note that warning is not a state on its own.
> +all_states = [ 'SUCCESS', 'SKIP', 'ERROR', 'FAILURE' ]

This is never going to change, so using a tuple (like all_categories) is
more efficient.

Also, I would recommend all_results as a sightly more appropriate name.

Finally, if you aren't already aware, please check the result of `make
pylint` (not that I have spotted specific issues).

~Andrew

>  
>  # All test categories and configurations
>  all_categories   = ("special", "functional", "xsa", "utility")
> @@ -161,7 +164,7 @@ def run_test(test):
>      if not "Test result:" in test_result:
>          return "ERROR"
>  
> -    for res in ("SUCCESS", "SKIP", "FAILURE"):
> +    for res in all_states:
>  
>          if res in test_result:
>              return res


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.