xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [XTF PATCH v2 4/4] xtf-runner: regularise runner exit code
Date: Fri, 22 Jul 2016 10:51:48 +0100	[thread overview]
Message-ID: <20160722095148.GH927@citrix.com> (raw)
In-Reply-To: <7563007e-0f40-4966-5200-c6c37c970883@citrix.com>

On Fri, Jul 22, 2016 at 10:49:18AM +0100, Andrew Cooper wrote:
> On 22/07/16 10:43, Wei Liu wrote:
> 
> >The script now returns the most severe result. Document the exit code in
> >help string.
> >
> >Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> >---
> >  xtf-runner | 22 ++++++++++++++++++----
> >  1 file changed, 18 insertions(+), 4 deletions(-)
> >
> >diff --git a/xtf-runner b/xtf-runner
> >index 1c96750..15b98c6 100755
> >--- a/xtf-runner
> >+++ b/xtf-runner
> >@@ -251,23 +251,30 @@ def run_tests(args):
> >      if not len(tests):
> >          raise RunnerError("No tests to run")
> >-    rc = 0
> >+    rc = all_results.index('SUCCESS')
> >      results = []
> >      for test in tests:
> >          res = run_test(test)
> >-        if res != "SUCCESS":
> >-            rc = 1
> >+        res_idx = all_results.index(res);
> >+        if res_idx > rc:
> >+            rc = res_idx
> >          results.append(res)
> >+    if rc == exit_code('SUCCESS'):
> >+        for res in results:
> >+            if res == 'SKIP':
> >+                rc = exit_code('SKIP')
> >+                break
> 
> Why is this conditional needed? SKIP has index 1 so will automatically
> displace SUCCESS in the change above.
> 

Forgot to delete that hunk. I will resend.

> >+
> >      print "\nCombined test results:"
> >      for test, res in zip(tests, results):
> >          print "%-40s %s" % (test, res)
> >-    return rc
> >+    return exit_code(all_results[rc])
> >  def main():
> >@@ -308,6 +315,13 @@ def main():
> >                    "       List all 'functional' or 'special' tests\n"
> >                    "    ./xtf-runner --list hvm64\n"
> >                    "       List all 'hvm64' tests\n"
> >+                  "\n"
> >+                  "  Exit code for this script:\n"
> >+                  "    0:    everythin is ok\n"
> 
> everything

Fixed.

Wei.

> 
> ~Andrew
> 
> >+                  "    1,2:  reserved for python interpreter\n"
> >+                  "    3:    test(s) are skipped\n"
> >+                  "    4:    test(s) report error\n"
> >+                  "    5:    test(s) report failure\n"
> >                    ),
> >      )
> 

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

  reply	other threads:[~2016-07-22  9:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22  9:43 [XTF PATCH v2 0/4] Runner exit code clean up Wei Liu
2016-07-22  9:43 ` [XTF PATCH v2 1/4] gitignore: ignore vim swp file Wei Liu
2016-07-22  9:43 ` [XTF PATCH v2 2/4] xtf-runner: sync all test results Wei Liu
2016-07-22  9:43 ` [XTF PATCH v2 3/4] xtf-runner: provide a set of exit codes for different results Wei Liu
2016-07-22  9:43 ` [XTF PATCH v2 4/4] xtf-runner: regularise runner exit code Wei Liu
2016-07-22  9:49   ` Andrew Cooper
2016-07-22  9:51     ` Wei Liu [this message]
2016-07-22  9:58       ` Wei Liu
2016-07-22 10:14         ` Andrew Cooper

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=20160722095148.GH927@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).