public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Daniel Axtens <dja@axtens.net>
To: u-boot@lists.denx.de
Subject: [RFC PATCH 01/16] patman: Use test_util to show test results
Date: Mon, 06 Jul 2020 14:46:15 +1000	[thread overview]
Message-ID: <87imf145ew.fsf@dja-thinkpad.axtens.net> (raw)
In-Reply-To: <20200706034203.2171077-2-sjg@chromium.org>

Hi Simon,

I can't see a cover letter so apologies if I've misunderstood something
basic, but this doesn't appear to apply to the patchwork tree - I'm
guessing the patchwork relevance is with regards to the last few patches
that (AFAICT) parse the patchwork web interface for information?

I haven't fully digested the patches (and I lack a lot of context) but
is there a reason the patchwork API isn't able to meet your needs here?
(And if so, could we extend it rather than having you parse the frontend?)

Regards,
Daniel

> This handles skipped tests correctly, so use it instead of the existing
> code.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  tools/patman/main.py      | 8 ++------
>  tools/patman/test_util.py | 6 +++---
>  2 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/tools/patman/main.py b/tools/patman/main.py
> index 28a9a26087..03668d1bb8 100755
> --- a/tools/patman/main.py
> +++ b/tools/patman/main.py
> @@ -25,6 +25,7 @@ from patman import patchstream
>  from patman import project
>  from patman import settings
>  from patman import terminal
> +from patman import test_util
>  from patman import test_checkpatch
>  
>  
> @@ -101,12 +102,7 @@ elif options.test:
>          suite = doctest.DocTestSuite(module)
>          suite.run(result)
>  
> -    # TODO: Surely we can just 'print' result?
> -    print(result)
> -    for test, err in result.errors:
> -        print(err)
> -    for test, err in result.failures:
> -        print(err)
> +    sys.exit(test_util.ReportResult('patman', None, result))
>  
>  # Called from git with a patch filename as argument
>  # Printout a list of additional CC recipients for this patch
> diff --git a/tools/patman/test_util.py b/tools/patman/test_util.py
> index aac58fb72f..0827488f33 100644
> --- a/tools/patman/test_util.py
> +++ b/tools/patman/test_util.py
> @@ -123,12 +123,12 @@ def ReportResult(toolname:str, test_name: str, result: unittest.TestResult):
>      for test, err in result.failures:
>          print(err, result.failures)
>      if result.skipped:
> -        print('%d binman test%s SKIPPED:' %
> -              (len(result.skipped), 's' if len(result.skipped) > 1 else ''))
> +        print('%d %s test%s SKIPPED:' % (len(result.skipped), toolname,
> +            's' if len(result.skipped) > 1 else ''))
>          for skip_info in result.skipped:
>              print('%s: %s' % (skip_info[0], skip_info[1]))
>      if result.errors or result.failures:
> -        print('binman tests FAILED')
> +        print('%s tests FAILED' % toolname)
>          return 1
>      return 0
>  
> -- 
> 2.27.0.212.ge8ba1cc988-goog
>
> _______________________________________________
> Patchwork mailing list
> Patchwork at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork

  reply	other threads:[~2020-07-06  4:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06  3:41 [RFC PATCH 00/16] RFC: patman: Collect review tags and comments from Patchwork Simon Glass
2020-07-06  3:41 ` [RFC PATCH 01/16] patman: Use test_util to show test results Simon Glass
2020-07-06  4:46   ` Daniel Axtens [this message]
2020-07-06  4:50     ` Daniel Axtens
2020-07-06 14:52       ` Simon Glass
2020-07-07  1:09         ` Daniel Axtens
2020-07-08 17:42           ` Stephen Finucane
2020-07-19 20:49             ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 02/16] patman: Move main code out to a control module Simon Glass
2020-07-19 20:49   ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 03/16] patman: Add a test that uses gitpython Simon Glass
2020-07-19 20:49   ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 04/16] patman: Allow creating patches for another branch Simon Glass
2020-07-19 20:49   ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 05/16] patman: Allow skipping patches at the end Simon Glass
2020-07-19 20:49   ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 06/16] patman: Convert to ArgumentParser Simon Glass
2020-07-19 20:49   ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 07/16] patman: Allow different commands Simon Glass
2020-07-19 20:49   ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 08/16] patman: Add a 'test' subcommand Simon Glass
2020-07-19 20:49   ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 09/16] patman: Allow disabling 'bright' mode with Print output Simon Glass
2020-07-19 20:49   ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 10/16] patman: Support collecting response tags in Patchstream Simon Glass
2020-07-19 20:49   ` Simon Glass
2020-07-06  3:41 ` [RFC PATCH 11/16] patman: Allow linking a series with patchwork Simon Glass
2020-07-06  3:41 ` [RFC PATCH 12/16] patman: Add a -D option to enable debugging Simon Glass
2020-07-06  3:42 ` [RFC PATCH 13/16] patchstream: Support parsing of review snippets Simon Glass
2020-07-06  3:42 ` [RFC PATCH 14/16] patman: Support checking for review tags in patchwork Simon Glass
2020-07-06  3:42 ` [RFC PATCH 15/16] patman: Support updating a branch with review tags Simon Glass
2020-07-06  3:42 ` [RFC PATCH 16/16] patman: Support listing comments from patchwork Simon Glass
2020-07-15  9:10 ` [RFC PATCH 00/16] RFC: patman: Collect review tags and comments from Patchwork Michal Simek

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=87imf145ew.fsf@dja-thinkpad.axtens.net \
    --to=dja@axtens.net \
    --cc=u-boot@lists.denx.de \
    /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